Cursors..

From: "David Calle" <davydky(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Cursors..
Date: 2008-08-18 21:19:41
Message-ID: a354e4430808181419k38a95c09gdcad026d69d4546e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi List,

I need to convert this cursor of Oracle to Postgres...
I wait for your help!!

*declare**
v_num_dep integer := &v_num_dep;
v_cont integer:=0;

cursor cursor_dep is
select *
from hr.employees
where hr.employees.department_id = v_num_dep;
reg_dep cursor_dep%rowtype;

begin

for reg_dep in cursor_dep
loop
v_cont := v_cont + 1;
dbms_output.put_line (to_char(reg_dep.last_name)||' '||
to_char(reg_dep.salary)||' '|| to_char(reg_dep.manager_id));
exit when v_cont=v_num_dep;
end loop;

end;

*

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Yura Gal 2008-08-19 08:45:37 Re: Cursors..
Previous Message Oliveiros Cristina 2008-08-18 18:00:02 Re: Join question