-
sqlplus format help
set linesize 32000
set pagesize 32000
set trimspool on
spool c:\dataset.txt
select substr(column1,1,4) as column1,substr(column2,1,20) as column2,substr(column3,1,15) as column3,substr(column4,1,4) as column4 from table1;
spool off
but when i open its all wrapped.when i uncheck wordwrap its okay
but why is there so much gap between column1 and column2 and so on.is there a way so that it will display as given in substr
column1 column1 column1
---------------------------------------- -------------------- ------------
thanks
-
add formatting to the top of your script.
column column1 format a10
RTM - that really helps too...
Ken
-
thanks it's not working for number
column1 is a datatype number
it's not formatting they way i have given
such as column column1 format 9999
Also how to format a float column?
any help is much appreciated
-
Originally Posted by prodadmin
column1 is a datatype number
Not after you've wrapped in in SubStr() it isn't, even if it is stored as a number in the database. Run DESCRIBE on the table to see what it really is, and if you want to use a numberic format on that column either embed it in a to_char() or leave it alone and use COLUMN to format it. My preference would be the latter
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|