我试图从我的nzplsq
当我直接拨打UDA时如:
create table newtable as select ncorrFactor(x0,x2) from test;
它有效
但是当我尝试这样做时:
p varchar;
p := X || 0 || '';
create table newtable as select ncorrFactor(p,x2) from test;
它给了我这个错误:
ERROR: pg_atoi: error in "x0": can't parse "x0"
我需要修理什么?
答案 0 :(得分:1)
假设第一个片段是用NZPLSQL编写的存储过程,p被视为'X0',您需要动态构建查询并在该查询中使用“execute immediate”。
例如:
declare
query varchar;
begin
query:='create table newtable as select ncorrFactor('|| 0 ||',x2) from test';
execute immediate query;
end;