- 论坛徽章:
- 0
|
需要将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;
=========================================================================================================
|
|