Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLSQL: %rowType for an unspecified table

mail8mzJul 19 2012 — edited Jul 20 2012
Hi All,

Can I declear a variable in PLSQL as the row type for a table, who's name is unknown during compile time, but will be determined when the PLSQL is runnning. The code is like following:

Procedure operTable( tableName IN VARCHAR2)
IS
TYPE ty_Row IS tableName%ROWTYPE

v_Row ty_Row;

CURSOR v_quey_cur
IS
select * from tableName;
BEGIN

OPEN v_query_cur;
FETCH v_query_cur INTO v_Row;
....

END operTable
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2012
Added on Jul 19 2012
5 comments
2,897 views