On May 11, 4:46 am, Vince <mortime...@hotmail.com> wrote:
> Hello,
>
> I'm trying to format output exactly as defined in Oracle table columns
> with sqlplus.
>
> Example:
> col1 VARCHAR (15);
> col2 NUMBER(8);
> col3 NUMBER(15);
>
> I want col1 to be output on 15 characters, col2 on 8 characters and
> col3 on 15 characters. Indeed for column col1 it works but for col2
> and col3, the output is on 10 characters. I can't set a default output
> length for NUMBER because I have NUMBER of different lengths.

But you DO have a default number output defined, it's  numwidth 10.

> And when
> I have more than 10 digits in a number in col3, the output is in
> scientific number format.

And that's because numwidth is set to 10.  Increase that value enough
and your scientific notation goes away.

> I tried to set format with 99999999 but it
> didn't work.
>

Does for me:

SQL> create table varform(
  2          col1 VARCHAR (15),
  3          col2 NUMBER(8),
  4          col3 NUMBER(15)
  5  );

Table created.

SQL>
SQL> insert
  2  into varform
  3  values ('Narkenflop sail', 99999999, 999999999999999)
  4  ;

1 row created.

SQL>
SQL> commit;

Commit complete.

SQL>
SQL> column col1 format a15
SQL> column col2 format 99999999
SQL> column col3 format 999999999999999
SQL>
SQL> select *
  2  from varform;

COL1                 COL2             COL3
--------------- --------- ----------------
Narkenflop sail  99999999  999999999999999

SQL>

> I tried to modify my sql request to set to_char(col2) but it then
> takes the char default length (40 on my system).
>
> Has someone idea to achieve this goal ?
>
> Thanx for any suggestion.
>
> Bye


David Fitzjarrell
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to