求助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;
=========================================================================================================
分数有限还望包含
            下面是其中的一个
有没有人能给个相应的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
 相关阅读 更多  
      
    热门阅读
-  
 office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
          阅读:74
 -  
 如何安装mysql8.0
          阅读:31
 -  
 Word快速设置标题样式步骤详解
          阅读:28
 -  
 20+道必知必会的Vue面试题(附答案解析)
          阅读:37
 -  
 HTML如何制作表单
          阅读:22
 -  
 百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
          阅读:31
 -  
 ET文件格式和XLS格式文件之间如何转化?
          阅读:24
 -  
 react和vue的区别及优缺点是什么
          阅读:121
 -  
 支付宝人脸识别如何关闭?
          阅读:21
 -  
 腾讯微云怎么修改照片或视频备份路径?
          阅读:28
 















