Cursors.. - Mailing list pgsql-sql

From David Calle
Subject Cursors..
Date
Msg-id a354e4430808181419k38a95c09gdcad026d69d4546e@mail.gmail.com
Whole thread Raw
Responses Re: Cursors..
List 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;



pgsql-sql by date:

Previous
From: "Oliveiros Cristina"
Date:
Subject: Re: Join question
Next
From: "Yura Gal"
Date:
Subject: Re: Cursors..