This discussion is archived
3 Replies Latest reply: Mar 12, 2012 5:32 PM by Gary Graham RSS

Oracle Sql Developer prblem with variable format

896548 Newbie
Currently Being Moderated
Hello All

pls help me when I am using
variable winnien number;
exec :winnien := 3.1415;
print winnien;
I got

anonymous block completed
WINNIEN
-
3

why?

what should I do for display full number.

Rgds
  • 1. Re: Oracle Sql Developer prblem with variable format
    Gary Graham Expert
    Currently Being Moderated
    Hi Krzysztof,

    Your example will work in SQL*Plus (unless you change the "set numformat" value to something too small), but not (so far) in SQL Developer. Over time SQL Developer is moving toward more complete support of SQL*Plus command syntax, but there is no guarantee of perfect compatibility.

    Here is a slightly modified version of your example that demonstrates how SQL Developer currently (3.1.07.42) works.
    variable winnien number;
    variable winnies varchar2;
    exec :winnien := 3.1415;
    exec :winnies := '3.1415';
    print winnien;
    print winnies;
    select :winnien, :winnies, to_number(:winnies) as winnies from dual;
    Output:
    anonymous block completed
    anonymous block completed
    WINNIEN
    -
    3
    
    WINNIES
    ------
    3.1415
    
    :WINNIEN :WINNIES                         WINNIES
    -------- -------------------------------- -------
           3 3.1415                            3.1415 
    Note: "set numformat" is not supported, but "col <colname> format ..." is.

    Regards,
    Gary
    SQL Developer Team
  • 2. Re: Oracle Sql Developer prblem with variable format
    896548 Newbie
    Currently Being Moderated
    Gary, thank you very much for your reply.

    it's not good. I am trying using this to get function's result.

    Regards
  • 3. Re: Oracle Sql Developer prblem with variable format
    Gary Graham Expert
    Currently Being Moderated
    There is actually a bug logged on this matter that slipped my mind earlier:
    Bug 13790813 - FORUM: BIND VARIABLES IN RUN SCRIPT LIMITED TO NUMFORMAT(10,0) RANGE

    in this thread:
    Re: NUMBER - numeric overflow

    -Gary

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points