Wrong select result (carriage return characters)

Scale

Member
All below SQL results are visible throw usual TDBGrid.

Just execute simple select:
-----------------------------------------
SELECT piece,sql_text
FROM v$sqltext_with_newlines q, v$session s
WHERE sid in (select sid from v$session where s.last_call_et = 0 and username = user)
and q.address = s.sql_address AND q.hash_value = s.sql_hash_value
ORDER BY piece
-------------------------------------------
In the result you can see truncated strings:
for example line:
"v$sqltext_with_newlines q, v$sessi"
Instead line (last char truncated):
"v$sqltext_with_newlines q, v$session s"
If you execute this example in BDE or sqlplus then results will be OK.
I don't no why DOA truncate such many characters from the end of line as there are quantity carriage return (CR) characters.
 
The "SQL_TEXT" column is VARCHAR2(64), and contains just a piece that cannot contain more that the 64 characters you mentioned, including linefeeds. The line goes on at the next "PIECE" for the session.

------------------
Marco Kalter
Allround Automations
 
Sorry I mentioned difficult example.
Just execute next example:

select 'A'| |chr(10)| |'B' from dual

You'll see just string 'A' as result instead string 'AB'.

If you execute this select in sqlplus or throw Inprise BDE you'll get right result.

I'm afraid that DOA OracleDataSet component can't proccess special characters properly.
 
That is indeed a simpler example. The problem is caused by the fact that TOracleSession.CovertCRLF is True. The field is defined as a string with up to 3 characters, but #10 is converted to #13#10, leading to 4 characters.

You can set TOracleSession.CovertCRLF to False to fix this, or use a TOracleQuery instead, which doesn't use the fixed field length concept of the TField.

------------------
Marco Kalter
Allround Automations
 
That's a pity.
There is no CovertCRLF property in TOracleSession objects.
I use DOA 3.4.6.1 for Delphi 5.
 
At design time you can double-click on the Preferences property of the TOracleSession instance. This will open up a set of options that includes the ConvertCRLF option.
 
I encountered the same problem in DOA version 4.1 (Delphi 2010), so I've got a question: is this a bug of a DOA or Deplhi's VCL ? If the former: is there a newer version of DOA than 4.1 with this bug fixed ?
 
Yes, I know, but I thought that there is a newer version of DOA with this bug fixed or changed dafault state of ConvertCRLF to false - after several months of coding, sometimes I forget that this parameter must be switched to false.
 
Back
Top