Home » Other » Client Tools » SQL * PLUS - setting wrap on for column (9i, win xp)
SQL * PLUS - setting wrap on for column [message #309871] Sat, 29 March 2008 09:09 Go to next message
oraclewannabe
Messages: 26
Registered: January 2008
Junior Member
hi all, i am playing around with sql plus and i encountered the following problem.

1) is length 10 the default column length for columns with number datatype in sqlplus, i done a select statement and all my column for number have a length of 10

2) why cant i format the length of a number column. i type column empno format 999
although my numbers become #### but "empno" and a length of 10 is still shown at the column name instead of just "emp"

3) how come a column name canot be wrapped
when i set wrap on.
set wrap on
column ename format a3

only the values of ename are wrap
but the column name "ename" isnt wrap
into ena
me

thanks.
Re: SQL * PLUS - setting wrap on for column [message #309884 is a reply to message #309871] Sat, 29 March 2008 10:51 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1) yes, dependent on numwidth parameter
2) because number greater than 999 can't be format in "999" model
3) Put exemple of what you meant.

Before please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel
Re: SQL * PLUS - setting wrap on for column [message #309896 is a reply to message #309884] Sat, 29 March 2008 12:56 Go to previous messageGo to next message
oraclewannabe
Messages: 26
Registered: January 2008
Junior Member
Michel Cadot wrote on Sat, 29 March 2008 10:51
1) yes, dependent on numwidth parameter
2) because number greater than 999 can't be format in "999" model
3) Put exemple of what you meant.

Before please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel



2) simply put, how do i make EMPNO to be of length 4. If i were to set column EMPNO format 9999 -- i try and its always length of 5.

3)
SET WRAP OFF
COLUMN ENAME FORMAT A2
SELECT ENAME FRO EMP WHERE ENAME = 'SMITH';

EN
--
SM

CLEAR COLUMNS
SET WRAP ON
COLUMN ENAME FORMAT A2
SELECT ENAME FRO EMP WHERE ENAME = 'SMITH';

EN
--
SM
IT
H

Why isnt the column header EN also becomes

EN
AM
E
--
SM
IT
H

Thanks.
Re: SQL * PLUS - setting wrap on for column [message #309903 is a reply to message #309896] Sat, 29 March 2008 13:24 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You didn't read the link I posted.
I don't answer.

Regards
Michel
Previous Topic: REPORT generating dilema SQL plus, SQL worksheet, SQL developer, when to you choose to use which..
Next Topic: arraysize in plsql developer?
Goto Forum:
  


Current Time: Fri Mar 29 06:58:14 CDT 2024