Sql*plus and CHR(10) [message #72441] |
Tue, 17 June 2003 17:10 |
Kyle Channing
Messages: 2 Registered: June 2003
|
Junior Member |
|
|
I have a 2 column table LU_ASMT_COMMUNITY with fields CODE and DESCRIPTION. If I run the following script I get these included results ..
select code || '*' || description || '*' || sysdate from lu_asmt_community
14O*Residual Ward 14 - Sub Area 14o*17-JUN-03
14P*Residual Ward 14 - Sub Area 14p*17-JUN-03
14Q*Residual Ward 14 - Sub Area 14q*17-JUN-03
14S*Residual Ward 14 - Sub Area 14s*17-JUN-03
14T*Residual Ward 14 - Sub Area 14t*17-JUN-03
UKN*TYPE UNKNOWN*17-JUN-03
But if I add a CHR(10) to the middle of the script, as follows, I get different results ...
select code || '*' || CHR(10) || description || '*' || sysdate from lu_asmt_community
14O*
Residual Ward 14 - Sub Area 14o*17-JUN-03
14P*
Residual Ward 14 - Sub Area 14p*17-JUN-03
14Q*
Residual Ward 14 - Sub Area 14q*17-JUN-03
14S*
Residual Ward 14 - Sub Area 14s*17-JUN-03
14T*
Residual Ward 14 - Sub Area 14t*17-JUN-03
UKN*
TYPE UNKNOWN*17-JUN-03
The data returned is correct but Sql*plus adds a blank line after each record returned. If I use Toad, another Oracle tool, I do not get this result. Does anyone know why this is possibly happening?
|
|
|
Re: Sql*plus and CHR(10) [message #72444 is a reply to message #72441] |
Wed, 18 June 2003 03:03 |
waqas
Messages: 3 Registered: May 2002
|
Junior Member |
|
|
Common sense says that the character against that char(10) is a blank line i.e why that command behaves like that...
Nothing to worry abat!
|
|
|
|
Re: Sql*plus and CHR(10) [message #72550 is a reply to message #72444] |
Tue, 15 July 2003 17:15 |
Kyle Channing
Messages: 2 Registered: June 2003
|
Junior Member |
|
|
The problem was that there is a setting in SQL*Plus which, under certain circumstance, will add blank lines between the output records. To turn this off you have to set the follwoingproperty at the top of your script ...
set recsep off
This was not common sense problem. The other problem is that SQL*Plus will show a list of enviroment variables which can be set. Unfortunately this env. variable does not appear in the list.
|
|
|