Print Thread
Truncation issues displaying large numeric values
#61009 02/17/20 02:44 PM
Joined: Feb 2020
Posts: 1
G
Member
OP Offline
Member
G
Joined: Feb 2020
Posts: 1
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.

Re: Truncation issues displaying large numeric values
gavman99 #61011 02/18/20 04:58 AM
Joined: Feb 2013
Posts: 251
UTC+10
I
Member
Offline
Member
I
Joined: Feb 2013
Posts: 251
UTC+10
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.

Re: Truncation issues displaying large numeric values
IvanZ #61615 05/12/20 09:07 PM
Joined: May 2012
Posts: 32
K
Member
Offline
Member
K
Joined: May 2012
Posts: 32
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>


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.066s Queries: 14 (0.022s) Memory: 2.5022 MB (Peak: 3.0380 MB) Data Comp: Off Server Time: 2024-05-10 07:33:51 UTC
Valid HTML 5 and Valid CSS