Home » Other » Client Tools » Problem with floating point values (Oracle 10G Express Edition)
Problem with floating point values [message #469656] Thu, 05 August 2010 07:00 Go to next message
gajatko
Messages: 4
Registered: August 2010
Junior Member
I use SQL Developer. I cannot select/print any floating point values.
My script:
variable xx NUMBER;

declare
  x number;
begin
  x := 1.5;
  :xx := x;
end;
.
run;

PRINT :xx;

Output:
anonymous block completed
xx
-
1


What is the problem? How can print a floating-point value?

Thanks in advance - Jacek
Re: Problem with floating point values [message #469658 is a reply to message #469656] Thu, 05 August 2010 07:03 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Try it sqlplus, works for me:
Oracle Database 10g Release 10.2.0.2.0 - 64bit Production

SQL> variable xx NUMBER;
SQL> 
SQL> declare
  2    x number;
  3  begin
  4    x := 1.5;
  5    :xx := x;
  6  end;
  7  .
SQL> run;
  1  declare
  2    x number;
  3  begin
  4    x := 1.5;
  5    :xx := x;
  6* end;

PL/SQL procedure successfully completed.

SQL> 
SQL> PRINT :xx;

        XX
----------
       1.5

SQL> 
SQL> 
SQL> 
Re: Problem with floating point values [message #469661 is a reply to message #469658] Thu, 05 August 2010 07:11 Go to previous messageGo to next message
gajatko
Messages: 4
Registered: August 2010
Junior Member
Thanks for a prompt reply.

However, it is critical to me to get it working in the SQL Developer.

Thanks for your patience -- J.
Re: Problem with floating point values [message #469664 is a reply to message #469661] Thu, 05 August 2010 07:23 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
That maybe so, but you should still try it in sqlplus.
That way we would know if the problem is specific to sqldevelop or not.
Re: Problem with floating point values [message #469665 is a reply to message #469661] Thu, 05 August 2010 07:27 Go to previous messageGo to next message
Roachcoach
Messages: 1576
Registered: May 2010
Location: UK
Senior Member
gajatko wrote on Thu, 05 August 2010 13:11
Thanks for a prompt reply.

However, it is critical to me to get it working in the SQL Developer.

Thanks for your patience -- J.


If its working in SQL*, it'll be a bug with SqlDev, there's a few.

Depending on the overall intention, there may be a way to work around it though, for example if you set the type to varchar, it'll print 1.5. whether this is allowed or not depends as I said.

It would appear its holding the correct value, just displaying the wrong one.

edit: further detail added

[Updated on: Thu, 05 August 2010 07:41]

Report message to a moderator

Re: Problem with floating point values [message #469679 is a reply to message #469665] Thu, 05 August 2010 07:57 Go to previous messageGo to next message
gajatko
Messages: 4
Registered: August 2010
Junior Member
Yep, it works in sqlplus. Too bad for SQL Developer

Thanks for help!
Re: Problem with floating point values [message #469697 is a reply to message #469679] Thu, 05 August 2010 09:38 Go to previous messageGo to next message
_jum
Messages: 577
Registered: February 2008
Senior Member
Did You try it in SQLDev with:
variable xx BINARY_FLOAT;

Should work, good luck!
icon14.gif  [SOLVED] Problem with floating point values [message #469836 is a reply to message #469656] Fri, 06 August 2010 01:59 Go to previous message
gajatko
Messages: 4
Registered: August 2010
Junior Member
Thanks, it works. Cool
Previous Topic: column heading
Next Topic: Return data from Oracle for Crystal
Goto Forum:
  


Current Time: Thu Apr 18 12:35:30 CDT 2024