+ -
当前位置:首页 → 问答吧 → 求助oracle存储过程转postgresql

求助oracle存储过程转postgresql

时间:2011-12-09

来源:互联网

需要将oracle数据库迁移到postgresql 表已经成功转了,现在就是一些存储过程弄不起来 求高人指点
下面是其中的一个
有没有人能给个相应的postgresql版本
============================================================================================
create or replace function GETORGANIZATIONCODE(p_id numeric)
return varchar as
  str varchar(2000);
  temp_text varchar(100);
  cursor myCur is
  select b.code
  from tbl_person_organization a, tbl_organization b
  where a.organizationId = b.id
  and a.personid = p_id;
begin
  str := '';
  open myCur;
  fetch myCur
  into temp_text;
  loop

  str := str || temp_text || ',';
  fetch myCur
  into temp_text;
  exit when myCur%notfound;

  end loop;
  close myCur;

  if str is not null then
  return substr(str, 1, length(str) - 1);
  end if;
  return str;
end;


=========================================================================================================

分数有限还望包含

作者: liuhuangyue945   发布时间: 2011-12-09

木人回复啊 存储过程不是很熟啊~

作者: hllfl   发布时间: 2011-12-09