5 个解决方案
#1
仅sql内是不行的,可以自己拼SQL串,然后执行,或编个存储过程执行
#2
查询动态sql 解决。execute immediate sql
#3
谁能举个例子呢?????谢谢大家了
#4
declare
v_sql varchar(100);
v_tblname varchar(20);
v_field varchar(10);
begin
v_sql:='insert into '||v_tblname||' values('||v_field||')';
exec immediate v_sql;
end;
#5
[code=SQL][declare
v_sql varchar(100);
v_tblname varchar(20);
v_field varchar(10);
begin
v_sql:='insert into ' ¦ ¦v_tblname ¦ ¦' values(' ¦ ¦v_field ¦ ¦')';
exec immediate v_sql;
end;]
v_sql varchar(100);
v_tblname varchar(20);
v_field varchar(10);
begin
v_sql:='insert into ' ¦ ¦v_tblname ¦ ¦' values(' ¦ ¦v_field ¦ ¦')';
exec immediate v_sql;
end;]
#1
仅sql内是不行的,可以自己拼SQL串,然后执行,或编个存储过程执行
#2
查询动态sql 解决。execute immediate sql
#3
谁能举个例子呢?????谢谢大家了
#4
declare
v_sql varchar(100);
v_tblname varchar(20);
v_field varchar(10);
begin
v_sql:='insert into '||v_tblname||' values('||v_field||')';
exec immediate v_sql;
end;
#5
[code=SQL][declare
v_sql varchar(100);
v_tblname varchar(20);
v_field varchar(10);
begin
v_sql:='insert into ' ¦ ¦v_tblname ¦ ¦' values(' ¦ ¦v_field ¦ ¦')';
exec immediate v_sql;
end;]
v_sql varchar(100);
v_tblname varchar(20);
v_field varchar(10);
begin
v_sql:='insert into ' ¦ ¦v_tblname ¦ ¦' values(' ¦ ¦v_field ¦ ¦')';
exec immediate v_sql;
end;]