Rip's Domain

ORA-04098: trigger is invalid and failed re-validation

Posted in CFWheels, ColdFusion, Oracle, Railo by rip747 on March 27, 2011

when running the cfwheels test suite under oracle you encounter the following with Railo (maybe also with ACF)

Problem: ORA-04098: trigger ‘WHEELSTESTDB.BI_USERS’ is invalid and failed re-validation

Solution: no whitespace can be in the cfquery tag.

This will cause the error:

<cfquery name=”loc.query” datasource=”#application.wheels.dataSourceName#”>
CREATE TRIGGER bi_#loc.i# BEFORE INSERT ON #loc.i# FOR EACH ROW BEGIN SELECT #loc.seq#.nextval INTO :NEW.<cfif loc.i IS “photogalleries”>photogalleryid<cfelseif loc.i IS “photogalleryphotos”>photogalleryphotoid<cfelse>id</cfif> FROM dual; END;
</cfquery>

change the cfquery to this:

<cfquery name=”loc.query” datasource=”#application.wheels.dataSourceName#”>CREATE TRIGGER bi_#loc.i# BEFORE INSERT ON #loc.i# FOR EACH ROW BEGIN SELECT #loc.seq#.nextval INTO :NEW.<cfif loc.i IS “photogalleries”>photogalleryid<cfelseif loc.i IS “photogalleryphotos”>photogalleryphotoid<cfelse>id</cfif> FROM dual; END;</cfquery>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: