Problem viewing field [message #10166] |
Wed, 07 January 2004 01:53 |
Wim
Messages: 5 Registered: June 2002
|
Junior Member |
|
|
I have made a table of employees whith a bank account number , like this NUmber(11) , but when I want to watch my table i see this number as an scientific number , how can I solve this ????
Thnx Ora-people
Grtzzz
|
|
|
Re: Problem viewing field [message #10167 is a reply to message #10166] |
Wed, 07 January 2004 02:45 |
Frank Naude
Messages: 4579 Registered: April 1998
|
Senior Member |
|
|
Hi,
You can use COLUMN formatting. Look at this example:
SQL> create table accounts (accno number(11));
Table created.
SQL> insert into accounts values (12345678901);
1 row created.
SQL> select * from accounts;
ACCNO
----------
1.2346E+10
SQL> column accno format 999999999999
SQL> select * from accounts;
ACCNO
-------------
12345678901
Best regards.
Frank
|
|
|
Re: Problem viewing field [message #10168 is a reply to message #10167] |
Wed, 07 January 2004 02:59 |
Rishi Maini
Messages: 4 Registered: January 2004
|
Junior Member |
|
|
Dear Frank..
please help me out...
The soultion that u have given is..
> column accno format 999
But I cant find out that how Oracle determines which column to Operate on.... as "accno" can be field of other tables to and that can also be of other Data type.
My guess is that if accno exists in two different tables then v have to mention the table name also along with column name...like > column emp.accno format 999 Am I right...????
|
|
|
Re: Problem viewing field [message #10170 is a reply to message #10168] |
Wed, 07 January 2004 03:09 |
Frank Naude
Messages: 4579 Registered: April 1998
|
Senior Member |
|
|
Hi,
Specifying the table name will not help. Nevertheless, you can use column aliases. Another example:
col accno clear
col "MyAccount" format 99999999999
SQL> select accno, accounts.accno, accno AS "MyAccount" from accounts;
ACCNO ACCNO MyAccount
---------- ---------- ------------
1.2346E+10 1.2346E+10 12345678901
Best regards.
Frank
|
|
|
Re: Problem viewing field [message #10172 is a reply to message #10166] |
Wed, 07 January 2004 03:55 |
Art Metzer
Messages: 2480 Registered: December 2002
|
Senior Member |
|
|
You can also change the default width for displaying all numbers in your SQL*Plus session with the SET NUMWIDTH command:SQL> CREATE TABLE t_num (n NUMBER(11));
Table created.
SQL> INSERT INTO t_num VALUES (12345678901);
1 row created.
SQL> COMMIT;
Commit complete.
SQL> SHOW NUMWIDTH
numwidth 10
SQL> SELECT n FROM t_num;
N
----------
1.2346E+10
SQL> <A HREF="http://www.engin.umich.edu/caen/wls/software/oracle/server.901/a88827/ch840.htm#82029">SET NUMWIDTH 15</A>
SQL> SHOW NUMWIDTH
numwidth 15
SQL> SELECT n FROM t_num;
N
---------------
12345678901
SQL> HTH,
A.
|
|
|
|