As Jankovsky said in #2, you should check what myPkg.getViewSQL function returns. The error message seems to indicate that the function returns nothing (ie. you're trying to execute an empty statement).
And the reason DDL is not allowed within a trigger (Jankovsky's #1) without the suggested pragma is that DDL has an implied COMMIT (both before and after the execution of the provided statement), which is not allowed within a trigger.
Main Topics
Browse All Topics





by: JankovskyPosted on 2008-10-18 at 02:31:24ID: 22747538
There are 2 issues:
1. you have to use pragma autonomous transaction to use DDL command (such as Create or replace view) within trigger;
2. check value returned by the myPkg.getViewSQL function - current error has been caused by mistake in the returned statement.