I'm creating the following pl:
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 the variables tabela
and col
in execute immediate
?