Print Thread
Page 1 of 2 1 2
Wrong select result (carriage return characters)
#4281 12/04/02 12:08 PM
Joined: Aug 2001
Posts: 6
S
Scale Offline OP
Member
OP Offline
Member
S
Joined: Aug 2001
Posts: 6
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.

Re: Wrong select result (carriage return characters)
#4282 12/04/02 10:49 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
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


Marco Kalter
Allround Automations
Re: Wrong select result (carriage return characters)
#4283 12/05/02 04:49 PM
Joined: Aug 2001
Posts: 6
S
Scale Offline OP
Member
OP Offline
Member
S
Joined: Aug 2001
Posts: 6
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.

Re: Wrong select result (carriage return characters)
#4284 12/05/02 09:29 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
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


Marco Kalter
Allround Automations
Re: Wrong select result (carriage return characters)
#4285 12/06/02 11:12 AM
Joined: Aug 2001
Posts: 6
S
Scale Offline OP
Member
OP Offline
Member
S
Joined: Aug 2001
Posts: 6
Thank you very much!!!!

Re: Wrong select result (carriage return characters)
#4286 12/06/02 11:23 AM
Joined: Aug 2001
Posts: 6
S
Scale Offline OP
Member
OP Offline
Member
S
Joined: Aug 2001
Posts: 6
That's a pity.
There is no CovertCRLF property in TOracleSession objects.
I use DOA 3.4.6.1 for Delphi 5.

Re: Wrong select result (carriage return characters)
#4287 12/06/02 01:49 PM
Joined: Sep 2000
Posts: 52
London, UK
J
Member
Offline
Member
J
Joined: Sep 2000
Posts: 52
London, UK
Look at TOracleSession.Preferences.ConvertCRLF

Re: Wrong select result (carriage return characters)
#4288 12/06/02 06:57 PM
Joined: Aug 2001
Posts: 6
S
Scale Offline OP
Member
OP Offline
Member
S
Joined: Aug 2001
Posts: 6
Thank you again

Re: Wrong select result (carriage return characters)
#4289 05/19/05 09:32 PM
Joined: Nov 2004
Posts: 7
USA
M
Member
Offline
Member
M
Joined: Nov 2004
Posts: 7
USA
Excuse me for my ignorance but where would you look to edit TOracleSession.Preferences.ConvertCRLF?

Re: Wrong select result (carriage return characters)
#4290 05/20/05 06:50 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
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.


Marco Kalter
Allround Automations
Page 1 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.038s Queries: 12 (0.009s) Memory: 2.5600 MB (Peak: 3.0429 MB) Data Comp: Off Server Time: 2024-05-20 17:12:05 UTC
Valid HTML 5 and Valid CSS