create or replace procedure UP_AAA ( PSRLN_LIST VARCHAR2 ) is
begin execute immediate 'update aaa set try_count=try_count-1 where srln in ('||PSRLN_LIST||')'; Commit; end UP_AAA;
非常感谢各位的回答,动态SQL的方法可行。请问有什么方法能够动态返回Cursor吗
看一下我这个方法 create or replace procedure UP_AAA ( PSRLN_LIST VARCHAR2 ) is
begin update aaa set try_count=try_count-1 where instr(PSRLN_LIST,srln) > 0; Commit; end UP_AAA;
create or replace procedure UP_AAA ( PSRLN_LIST VARCHAR2 ) is
begin execute immediate 'update aaa set try_count=try_count-1 where srln in ('||PSRLN_LIST||')'; Commit; end UP_AAA; -------------------------------------- 这个方法存在sql 注入的危险
(
PSRLN_LIST VARCHAR2
)
is
begin
execute immediate 'update aaa set try_count=try_count-1 where srln in ('||PSRLN_LIST||')';
Commit;
end UP_AAA;
create or replace procedure UP_AAA
(
PSRLN_LIST VARCHAR2
)
is
begin
update aaa set try_count=try_count-1 where instr(PSRLN_LIST,srln) > 0;
Commit;
end UP_AAA;
(
PSRLN_LIST VARCHAR2
)
is
begin
execute immediate 'update aaa set try_count=try_count-1 where srln in ('||PSRLN_LIST||')';
Commit;
end UP_AAA;
--------------------------------------
这个方法存在sql 注入的危险