Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Q: inconsistency between sql and pl/sql

Q: inconsistency between sql and pl/sql

From: <tedchyn_at_yahoo.com>
Date: Thu, 14 Oct 1999 14:59:44 GMT
Message-ID: <7u4r4n$n3t$1@nnrp1.deja.com>


Sir, why am I getting this inconsistency between sql and pl/sql for identical sql statement (sql 10 rows and pl/sql 5 rows).

Thanks in advance ted chyn

SQL> select to_char(odate,'yyyy-mon') from c_order   2 group by to_char(odate,'yyyy-mon') ;

TO_CHAR(


1973-nov
1999-apr
1999-aug
1999-jul
1999-jun
1999-mar
1999-may
1999-oct
1999-sep
2000-sep

10 rows selected.

SQL> declare v_date varchar2(100);
  2 cursor cur1 is select to_char(odate,'yyyy-mon') from c_order   3 group by to_char(odate,'yyyy-mon') ;   4 begin
  5 for rec in cur1 loop
  6 fetch cur1 into v_date;
  7 dbms_output.put_line(v_date);
  8 end loop;
  9 end;
 10 /

1999-apr
1999-jul
1999-mar
1999-oct
2000-sep  ** only 5 rows here

PL/SQL procedure successfully completed.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Oct 14 1999 - 09:59:44 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US