Home » SQL & PL/SQL » SQL & PL/SQL » i know there'll be only one record
i know there'll be only one record [message #2011] Sun, 16 June 2002 22:52 Go to next message
CH Phang
Messages: 2
Registered: June 2002
Junior Member
hi! i'm issuing the following:
...
Select id, user, marks from test where id='111';
res_rec r_cur%rowtype;
...

i know that the result return will only return one record set. how can i get that record set? i'm currently doing it via a loop, which is kind of "over-kill":

For res_rec in r_cur loop
htp.p(...);
end loop;
...

thx
Re: i know there'll be only one record [message #2015 is a reply to message #2011] Mon, 17 June 2002 00:11 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
is this helping you?
SQL> ed
Wrote file afiedt.buf

  1  declare
  2  v_dept dept%ROWTYPE;
  3  begin
  4      select * into v_dept from dept where deptno=10;
  5  dbms_output.put_line(v_dept.deptno||','||v_dept.loc||','||v_dept.dname);
  6* end;
SQL> /
10,NEW YORK,ACCOUNTING

PL/SQL procedure successfully completed.

SQL> 
Re: i know there'll be only one record [message #2023 is a reply to message #2011] Mon, 17 June 2002 19:53 Go to previous message
CH Phang
Messages: 2
Registered: June 2002
Junior Member
hi! thx for the advise.
Previous Topic: Design of database.
Next Topic: queries on oracle
Goto Forum:
  


Current Time: Fri Apr 26 09:15:26 CDT 2024