Skip to Main Content

SQL & PL/SQL

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!

execute immediate shows ORA-00900: invalid SQL statement

249698Oct 31 2007 — edited Oct 31 2007
Hi,

First to avoid misleading:

I know that I need to grant neccessary privileges directly to user, to make execute immediate work.

I have a Function, which generates a "create trigger..." statement and execute it by "execute immediate sql_stmt;" afterwards.

This line always brings ORA-00900: invalid SQL statement.
When I output the stmt and execute that output directly at SQL*Plus, it's fine, no errors !

Here is, what I did to isolate the problem:

1. I granted all (!) system-privileges directly to the Function-owner. Problem is unchanged.

2. I paste the generated stmt hard-coded in variable "sql_stmt" (just for testing) and let it execute with 'execute immediate sql_stmt;'. That works fine as well.

Can anyone tell me, what is still missing ? Is it some more privileges ?

thanks for any tip
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2007
Added on Oct 31 2007
4 comments
1,071 views