Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's wrong in: TYPE TYPE_row_cur1 IS RECORD...

Status
Not open for further replies.

SashaBuilder3

Programmer
Jan 13, 2002
131
CA
Hi everybody,

I am trying to work with dynamic cursors, so I wrote the following procedure (simplified version):


PROCEDURE p1 AS

TYPE TYPE_tbl_cursor IS REF cursor;

cur1 TYPE_tbl_cursor;


TYPE TYPE_row_cur1 IS RECORD
(
Smplno tbl_Carbons.Smplno%TYPE,
Q_OC tbl_Carbons.Q_OC%TYPE
};

row_cur1 TYPE_row_cur1;

SQL_str VARCHAR2(1024);

BEGIN

SQL_str:='SELECT Smplno, Q_OC FROM tbl_Carbons';

OPEN cur1 FOR SQL_str;
FETCH cur1 INTO row_cur1;

DBMS_OUTPUT.put_line(row_cur1.Smplno || ',' || TO_CHAR(row_cur1.Q_OC));


CLOSE cur1;


END;



However I get an error message when I try to compile (save) the proc in the Procedure Builder:

PDE-USW002 The source of the stored program unit source is incomplete


The main piece causing trouble is

TYPE TYPE_row_cur1 IS RECORD
(
Smplno tbl_Carbons.Smplno%TYPE,
Q_OC tbl_Carbons.Q_OC%TYPE
};

If I comment it out (with referencing it lines) it compiles OK.

I can't figure out what is wrong with this.

Can anyone help?


Thanks,

Alexandre
 
In ref curs def. add return type -
also I would declare return type first just
to be safe -

TYPE TYPE_tbl_cursor IS REF cursor RETURN row_cur1 ;
 
btw22,

The stupid thing about me is that I typed '}' instead of ')' at the end of TYPE_row_cur1 definition. And I didn't see it till someone pointed it out.


Anyway, thanks for the tip on return type.


Alexandre
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top