It should be IS, not AS. This also worked for me in a .cfm template. However, putting it in a CFC broke it in the way you described. As annoying as it is, this has been a bug with CF for a while; PL/SQL needs to be put into a CFC in one of two ways:
1) all on one line (no carriage returns, so it runs off the edge of your editor) or 2) as an include - cfinclude the cfquery tag into the body of the CFC method and the carriage returns in the PL/SQL won't screw things up. This is one of those cool practical joke bugs with CF that are fun at parties, but I m serious - try it and it will work. -----Original Message----- From: Rick Root [mailto:[EMAIL PROTECTED] Sent: Friday, 4 February 2005 2:49 To: CF-Talk Subject: Re: OT: Monitoring services This doesn't work for me.... <cfquery datasource="ADSPRD_blogcfm" name="qry1"> CREATE OR REPLACE FUNCTION year (MyDate DATE) RETURN NUMBER AS BEGIN RETURN extract(YEAR FROM MyDate); END year; </cfquery> <cfquery name="qry2" datasource="ADSPRD_blogcfm"> SELECT year(SYSDATE) FROM DUAL </cfquery> <cfdump var="#qry2#"> The user I'm connecting with has dba privileges, and is able to do this via SQL Plus. I verified that the datasource settings allow CREATE statements. The error, which occurs on qry2, is: [Macromedia][Oracle JDBC Driver][Oracle]ORA-06575: Package or function YEAR is in an invalid state I might also add that no matter what I do, I can't get qry1 to return an error. I actually had "IS" instead of "AS" and it still generated no error. - rIck ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193026 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

