This discussion is archived
3 Replies Latest reply: Sep 16, 2013 10:23 AM by rp0428 RSS

Declaring bind variables using decimals

970021 Newbie
Currently Being Moderated

I'm on Oracle 11.2

 

In SQL Developer, I'm having hard time executing a SQL with a bind variable. Below is the test table.

 

create table TEST1 (TYP varchar2(3), NUM number(30,18));  
insert into TEST1 values ('TTT', 45.15168794137111);  
commit;  

 

Then I execute the below query and it returns no results. Why?

VARIABLE P1 number;  
EXEC :P1 := 45.15168794137111;  
select * from TEST1 where NUM = :P1;  

 

The above works in SQL Plus.

Legend

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