我想使用不同的用户名和来自行类型的数据生成一个动态插入语句
我的片段
create or replace procedure test()
is
TYPE cv_typ is REF CURSOR;
cv cv_typ;
stmt varchar(2000);
zieldb varchar(20);
vKunden "Kunden"%rowtype;
BEGIN
execute immediate 'select * from "Kunden" where "KndNr"=55 ' into vKunden;
stmt:='select kc.zieldb from test.kunden_copy kc, test.transrel vd
where kc.zieldb=vd.dbname and kc.status=1 ';
OPEN cv FOR stmt;
LOOP
FETCH cv into nachdb;
EXIT WHEN cv%NOTFOUND;
...
...
stmt:='insert into ' || nachdb || ' ."Kunden" values ' || vKunden;
execute immediate stmt ;
...
...
END LOOP;
END;
我收到以下错误消息:
Please-00306 调用中的参数数量或类型错误
使用以下语法
stmt:='insert into ' || nachdb || ' ."Kunden" values vKunden ';
execute immediate stmt ;
我收到以下消息:
ORA-03001: 未实现的功能