Problem with floating point values [message #469656] |
Thu, 05 August 2010 07:00 |
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 |
cookiemonster
Messages: 13938 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 #469665 is a reply to message #469661] |
Thu, 05 August 2010 07:27 |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
gajatko wrote on Thu, 05 August 2010 13:11Thanks 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
|
|
|
|
|
|