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;

*

Reply via email to