We have a table where the primary key is defined as a NUMBER(20) and the contents typically contain 20 digit numbers (no leading zeroes). Every time I query the table within PLSQL Developer, the primary key column is truncated so we have to do a TO_CHAR on the primary key in order to retrieve it.

So as an example, by running the below query, I get the below result.

Query : SELECT to_number('12345678901234567890') AS NBR FROM dual
Result : 1.23456789012346E19

Converting the column from a NUMBER to a VARCHAR is not a quick option available to us and having to TO_CHAR the column every time I query it is a bit of a pain hence why I am hoping there is a quick win available.

So is anyone aware of any option within PLSQL Developer which would mean I can increase the length of the visible digits before truncation takes place ? If not, are there any other suggestions anyone can thing of ?

A colleague of mines uses SQL Developer and it doesn't truncate any numbers regardless of length, or at least it didn't when we tried it on a 40 digit number.

Thanks.
Gav.
There's an option in Preferences > SQL Window > Number fields to_char
That will do it for you.
But it might break other queries so use carefully.

No idea why PLD doesn't allow number length tuning.. It might be oracle client setting too.
It's almost certainly a PL/SQL Developer problem and not an Oracle Client problem. Here is a test from sqlplus:

Code
SQL> SELECT to_number('12345678901234567890') AS nbr
  2    FROM dual;

       NBR
----------
1.2346E+19

SQL> set numformat 999999999999999999999999999;
SQL> /

                         NBR
----------------------------
        12345678901234567890

SQL>
© Allround Automations forums