Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Oracle: Invalid ALTER command in execute immediate

In the procedure, in the ALTER command, I need to dynamically substitute the name of the trigger that needs to be activated.

declare 
v_trg_name varchar2(25) := 'article_comment_audit';
begin 
execute immediate 'ALTER TRIGGER' || v_trg_name || 'ENABLE';
end;

I try to run this code, but it returns an error ORA-00940 invalid ALTER command
Please tell me what is the problem?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You’ll get 'ALTER TRIGGERarticle_comment_auditENABLE'.

Insert Blanks:

'ALTER TRIGGER ' || v_trg_name || ' ENABLE';

in order to get 'ALTER TRIGGER article_comment_audit ENABLE'.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading