Have a look at this people, it's strange SQL things [message #78619] |
Wed, 06 March 2002 02:13 |
nik
Messages: 55 Registered: January 2002
|
Member |
|
|
The following cursor returns a different value compared to when the select is run in SQL, does anyone know why please?
SQL> get time_cur
1 declare
2 v_time number;
3 cursor c1 is
4 select 6 + (to_number(to_char(trunc(90/60))))||'.'||to_number(to_char(mod(90,60)))
5 from dual;
6 begin
7 open c1;
8 fetch c1 into v_time;
9 dbms_output.put_line('time is'||' '||v_time);
10 close c1;
11* end;
SQL> /
time is 7.3
PL/SQL procedure successfully completed.
SQL> get time_cur_sql
1 select 6 + (to_number(to_char(trunc(90/60))))||'.'||to_number(to_char(mod(90,60)))
2* from dual
SQL> /
6+(T
----
7.30
SQL>
|
|
|
|