Simple PL/SQL Query

From: Computer Centre Visitor <ccev38_at_leonis.nus.sg>
Date: 1996/01/16
Message-ID: <4df5c5$2df_at_nuscc.nus.sg>#1/1


Hi everybody

Here is a simple PL/SQL problem

How do I select rowid and all the columns from a table in PL/SQL block. The declaration "%ROWTYPE" will not hold any rowid data type so the following code will be incorrect.

declare
x emp%rowtype;
begin

   select rowid, emp.* into x from emp where empno=1003;    dbms_output.put_line(x.rowid || ' '||to_char(x.empno)); end;
/

I tried another method by introducing one more declaration for rowid.

declare
pl_tmp_rowid rowid;
x emp%rowtype;
begin

   select rowid, emp.* into pl_tmp_rowid, x from emp where empno=1003;    dbms_output.put_line(pl_tmp_rowid || ' '||to_char(x.empno)); end;
/

Even now the declaration is not correct. Is there any way I can achieve this. I am not interested in specifying all the column names in select statement as well as in into clause.

Thanks in advance

Ramesha H.G.
Consultant
Hewlette Packard Singapore (Sales) Pte. Ltd. E-mail : ccev38_at_cce.nusstf.nus.sg
Ph : 7722527
Fax: 7722595

PS: We are working for a University Project Received on Tue Jan 16 1996 - 00:00:00 CET

Original text of this message