0
I’m creating the pl sequinte:
declare
cont integer;
tabela varchar2(100) := 'TABLE_TESTE';
col varchar2(100) := 'TESTE';
begin
SELECT COUNT(*) into cont FROM USER_TAB_COLUMNS
WHERE TABLE_NAME = UPPER(tabela)
AND COLUMN_NAME = UPPER(col);
if cont = 0 then
execute immediate 'ALTER TABLE tabela ADD col number(19,0)';
end if;
end;
/
How can I use variables tabela
and col
in the execute immediate
?
take a look here http://www.sqlines.com/oracle-to-sql-server/execute_immediate
– Leandro Angelo