Try hardcoding the SQL statement, so remove the cfqueryparam and place the value you think is being passed in.
Adrian -----Original Message----- From: Teresa Robinson [mailto:[EMAIL PROTECTED] Sent: 25 June 2007 17:01 To: CF-Newbie Subject: Re: Query works in SQL*Plus, not in CF Hi Adrian, Thank you for your suggestions! Below are the results: *********** The log still records "example_status is undefined". Here's the cfquery: <cffunction name="getExample_status" output="true" access="public" returntype="query"> <cfargument name="status" hint="Argument for status."> <cfset var example_status = "" > <cfquery name="example_status" datasource="#application.dsn#" username=" test" password="test"> <!--- UPDATE test_view SET status = UPPER(TRIM(<cfqueryparam value="#arguments.status#" cfsqltype="cf_sql_varchar">)) ---> SELECT * FROM test_view WHERE test_id IN ( SELECT test_ID FROM test_VIEW WHERE UPPER(TRIM(STATUS)) = UPPER(TRIM( <cfqueryparam value="#arguments.status#" cfsqltype="cf_sql_varchar">)) AND EXPIRE_DATE <= SYSDATE) </cfquery> <cfdump var="#example_status#" expand="yes"> <cfabort> <cfreturn example_status> </cffunction> I ran the query and got the same result as before: 0 records with empty status values, just as if I had never run the update, with no error. When I change back to the UPDATE statement, I copy the cfdump to before the query, and it shows [empty string]. The log records the same error statement, and of course no records are updated (as can be expected if the query variable is undefined). Strange that example_status is recognized just before the query but not just after. Any ideas? Thanks, Teresa ************** >You're running an UPDATE and don't return a query. > >To see the problem: > >- change output to true >- add <cfdump var="#example_status#"><cfabort> under the cfquery block >- run the page > >You should get a example_status is undefined error. > >Then: > >- comment out your UPDATE code >- add SELECT * FROM test_VIEW in it's place >- run the page again > >You should now get a dump of the query. > >Adrian ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2874 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
