Обсуждение: Cursors..

Поиск
Список
Период
Сортировка

Cursors..

От
"David Calle"
Дата:
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;



Re: Cursors..

От
"Yura Gal"
Дата:
Take a look at http://www.postgresql.org/docs/8.3/interactive/plpgsql-cursors.html
and you'll find answer you need.

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

-- 
Best regards, Yuri.