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 -> PL/SQL: Return types of Result Set variables or query do not match

PL/SQL: Return types of Result Set variables or query do not match

From: funka <pjpameole_at_sopragroup.com>
Date: 31 Mar 2004 02:03:35 -0800
Message-ID: <da8084ca.0403310203.4cb59d8a@posting.google.com>


Hi all,

i'm trying to put a cursor fetch in a rowtype variable but apparaintly oracle disagrees the way i do that by answering : PL/SQL: Return types of Result Set variables or query do not match

here is my code ...

 CREATE OR REPLACE PACKAGE pkg AS

 TYPE ref_cur IS REF CURSOR;
 PROCEDURE loop_prxetu ( cur_prxetu IN OUT ref_cur, rec IN OUT prxetu%ROWTYPE );
 PROCEDURE dateshiftpdt ( cur_prxetu IN OUT ref_cur , rec IN OUT prxetu%ROWTYPE );

END pkg;
/

CREATE OR REPLACE PACKAGE BODY pkg AS  

 PROCEDURE loop_prxetu ( cur_prxetu IN OUT ref_cur, rec IN OUT prxetu%ROWTYPE ) IS
 BEGIN   OPEN cur_prxetu FOR SELECT idntecprxetu FROM prxetu;   LOOP
   FETCH cur_prxetu INTO rec;
    update prxetu set DATEFFPRXETU=TO_DATE('&2','YYYYMMDDHH24MISS') where idntecprxetu = rec.idntecprxetu and dateffprxetu=TO_DATE('&1','YYYYMMDDHH24MISS');

    DBMS_OUTPUT.PUT_LINE( 'PRXETU' || ';' || rec.idntecprxetu || ';' || 'Modif date' );
  END LOOP;
  CLOSE cur_prxetu;
 END loop_prxetu;

 PROCEDURE dateshiftpdt ( cur_prxetu IN OUT ref_cur, rec IN OUT prxetu%ROWTYPE ) IS
 BEGIN   loop_prxetu( cur_prxetu , rec );

 END dateshiftpdt;

END pkg;
/

DECLARE  cur_prxetu pkg.ref_cur;
 rec prxetu%ROWTYPE;

BEGIN  IF ( '&3' = 'PDT') THEN
  pkg.dateshiftpdt( cur_prxetu , rec);
 END IF; END;
/

thank's for any help :) Received on Wed Mar 31 2004 - 04:03:35 CST

Original text of this message

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