您的位置:首页 > 数据库 > Oracle

Oracle存储过程根据传入参数查询

2014-10-16 14:39 295 查看
Oracle存储过程中根据传入参数查询时无效

环境:Oracle11g

需求:根据传入的参数作为条件,查询相关数据

问题:条件无效

代码:

create or replace procedure XXX(associatedId in varchar,typeinfoid in varchar)

as

sheetcontent clob;

begin

select wm_concat(t.datasource) into sheetcontent from xly_associatedorder t

where t.associatedid = associatedId and t.typeinfoid = typeinfoid;

end XXX;

解决办法:

create or replace procedure XXX (associatedId in varchar,typeinfoid in varchar)

as

sheetcontent clob;

p1 varchar(50);

p2 varchar(50);

begin

p1:=associatedId;

p2:=typeinfoid;

select wm_concat(t.datasource) into sheetcontent from xly_associatedorder t

where t.associatedid =p1 and t.typeinfoid =p2;

end XXX;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐