现有包代码:
CREATE OR REPLACE PACKAGE PKG_aaa is
TYPE myrctype IS REF CURSOR;
PROCEDURE usp_aaa(cur_out OUT myrctype,aa char,tablename in varchar2);
end PKG_aaa;
/
CREATE OR REPLACE PACKAGE BODY PKG_aaa AS
PROCEDURE usp_aaa
(
cur_out OUT myrctype,aa char,tablename in varchar2
)
IS
BEGIN
OPEN cur_out FOR
'select data.stope_id
from (select *
from ' ||tablename||' where stope_id='''||aa||''' and MineArea_ID=''J'') data';
END usp_aaa;
END PKG_aaa;
/
上面的代码执行时是没有问题的,现在想在data.stope_id 后加上“合计”两个字,不知道该怎么加,用
'select ''||data.stope_id||''合计''
......'总是提示未找到预期的关键字,这里应该怎么写呢?
CREATE OR REPLACE PACKAGE PKG_aaa is
TYPE myrctype IS REF CURSOR;
PROCEDURE usp_aaa(cur_out OUT myrctype,aa char,tablename in varchar2);
end PKG_aaa;
/
CREATE OR REPLACE PACKAGE BODY PKG_aaa AS
PROCEDURE usp_aaa
(
cur_out OUT myrctype,aa char,tablename in varchar2
)
IS
BEGIN
OPEN cur_out FOR
'select data.stope_id
from (select *
from ' ||tablename||' where stope_id='''||aa||''' and MineArea_ID=''J'') data';
END usp_aaa;
END PKG_aaa;
/
上面的代码执行时是没有问题的,现在想在data.stope_id 后加上“合计”两个字,不知道该怎么加,用
'select ''||data.stope_id||''合计''
......'总是提示未找到预期的关键字,这里应该怎么写呢?
'select ''''||data.stope_id||''合计''
....'
就可以了