good idea; let's start a new threat on the problem of writing/reading text into oracle 10g.
Here is my specific problem:
If we write a compressed text (e.g. " 1010101") into the database, and decompress it after reading it from the database, then the result is correct if we read the data from SQLBase. However, the same procedure with Oracle gives us a wrong result.
We have written a test program to detect the error. This program can create a table and write and read data into this table (see attachment).
If we write the data and fetch the data immediately from Oracle with "Call SqlSetLongBindDatatype( 1, DT_LONGBINARY )", then we get the error 1062. If we close TD6.0 and make the read directly, than there is no error but the data are wrong.
I hope that you can reconstruct the problem.
Thanks, and best regards
* What's the Oracle column type you are using for the CREATE? It must be something Oracle uses to store binary data, like BLOB:
* Maybe you are aware of this, but that compress string is a binary value now. A 'string' in TD v5.2/v6 is a Unicode 2-byte value. Once you call compress lstr is not a 'string' any longer, it's a buffer of binary bytes. Looks like you know that because you are calling SqlSetLongBindDatatype(), but it being binary will impact the Oracle column type you can use. Historically, LONG VARCHAR in SB was for either text or binary data. You calling the column 'text' though prompts me to mention this.
* One other thing I see: SqlSetLongBindDatatype() is in the wrong place for the fetch. It needs to come after prepExe and before the Fetch:
Code: Select all
If (SqlPrepare(hSql, strSqlStatement )) Call SqlExecute( hSql) Call SqlSetLongBindDatatype( 1, DT_LONGBINARY ) -- called after PrepExe and before FetchNext Call SqlFetchNext( hSql,nPFetch ) Call SalStrUncompress( lstr ) Set dflstrOut = lstr
We have make a test with the data type BLOB and than we can write/read the data correct. Therfore we will chance the data type.
Who is online
Users browsing this forum: [Ccbot] and 0 guests