Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IF NOT EXISTS .... THEN

785153Oct 5 2010 — edited Oct 5 2010
I have Windows XP with 10.2.0.1.0


I like to do something as below IF NOT EXISTS, but I got errors prompt
6/3 PL/SQL: Statement ignored
6/10 PLS-00204: function or pseudo-column 'EXISTS' may be used inside
a SQL statement only



IF NOT EXISTS (select col1, col2 from my_table ) THEN
execute immediate 'alter table ' || my_table || ' add(col1, col2)';
commit;
END IF;


Please shed a light.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2010
Added on Oct 5 2010
4 comments
2,826 views