Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Simple Cursor

Re: Simple Cursor

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Thu, 26 Apr 2007 20:58:26 +0200
Message-ID: <f0qsj2$70n$1@news3.zwoll1.ov.home.nl>


Jimbo schreef:
> Ive been looking online and cant seem to find a good example of a
> cursor I need to create..I want to assign variables in a cursor then
> select them in a recordset....its simple to do in sql server..but i
> cant seem to find a way in oracle....I dont have permission to create
> temp tables and Im not looking to do db outputs...if someone could
> provide an example that would be great...
>
>
> Thanks
>
> -Jim
>

AAARRRRGGHHH!!! Temp tables, TEMP tables, TEMPTABLES?!?!

A cursor returns a pointer into your recordset, so I fail to see how you can "assign variables in a cursor" and "then select them".

what do you want to do - and why use a cursor? Never use pl/sql when you can do it in SQL.

Why would you:
declare
  cursor c_sel_emp IS select * from emp;   l_out varchar2(240);
begin
for r_emp in c_sel_emp
loop
  l_out := r_emp.ename;
  dbms_output.put_line(l_out);
end loop;
end;

when you can:
select ename from emp;

-- 
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Received on Thu Apr 26 2007 - 13:58:26 CDT

Original text of this message

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