Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET TERM ^ ;
- CREATE OR ALTER procedure sp_insupd (
- iaction varchar(3),
- iusuario varchar(20),
- iip varchar(15),
- imodulo varchar(30),
- ifieldsvalues varchar(2000),
- iwhere varchar(1000),
- idesclogs varchar(200))
- returns (
- oid integer)
- as
- declare variable vdesc varchar(10000);
- begin
- if (iaction = 'ins') then
- begin
- vdesc = idesclogs;
- /*** o erro está na linha abaixo ***/
- execute statement 'insert into '||:imodulo||' '||:ifieldsvalues||' returning ID into '||:oid||';';
- end else
- if (iaction = 'upd') then
- begin
- execute statement 'select '||:idesclogs||' from '||:imodulo||' where '||:iwhere into :vdesc;
- execute statement 'execute procedure SP_CREATE_AUDIT('''||:imodulo||''');';
- execute statement 'update '||:imodulo||' set '||:ifieldsvalues||' where '||:iwhere||';';
- end
- insert into LOGS(USUARIO, IP, MODULO, TIPO, DESCRICAO) values (
- :iusuario, :iip, :imodulo, (case :iaction when 'ins' then 1 when 'upd' then 2 end), :vdesc);
- end^
- SET TERM ; ^
- ...
- execute statement 'insert into '||:imodulo||' '||:ifieldsvalues||';';
- ...
Add Comment
Please, Sign In to add comment