You have specified the returnType as query, but you seem to be returning only the ID. Change one or the other to make it happy.
On Nov 6, 2007 10:43 AM, Bruce Sorge <[EMAIL PROTECTED]> wrote: > I have a CFC that both inserts a series of field variables and returns > the ID number that was just created. I am getting an error that states > "the value returned from the insertProposal function is not of type > query". Here is the function: > > <cffunction name="insertProposal" access="public" returntype="query"> > <cfargument name="BidType" type="string" required="yes"> > <cfargument name="Number" type="string" required="yes"> > <cfargument name="Description" type="string" required="yes"> > <cfargument name="Contact_Name" type="string" required="yes"> > <cfargument name="Contact_Phone" type="string" required="yes"> > <cfargument name="Contact_Email" type="string" required="yes"> > <cfargument name="Job_Walk_Date" type="string" required="yes"> > <cfargument name="Job_Walk_Time" type="string" required="yes"> > <cfargument name="Status" type="numeric" required="yes"> > <cfargument name="Create_Date" type="date" required="yes"> > <cfargument name="Create_Time" type="string" required="yes"> > <cfset propID="foo"> > <cfstoredproc procedure="pr_InsertRFP" > datasource="#Request.dsn#"> > <cfprocparam cfsqltype="cf_sql_varchar" > dbvarname="BidType" type="in" value="#Arguments.BidType#"> > <cfprocparam cfsqltype="cf_sql_varchar" > dbvarname="Number" type="in" value="#Arguments.Number#"> > <cfprocparam cfsqltype="cf_sql_longvarchar" > dbvarname="Description" value="#Arguments.Description#"> > <cfprocparam cfsqltype="cf_sql_varchar" > dbvarname="Contact_Name" type="in" value="#Arguments.Contact_Name#"> > <cfprocparam cfsqltype="cf_sql_varchar" > dbvarname="Contact_Phone" type="in" value="#Arguments.Contact_Phone#"> > <cfprocparam cfsqltype="cf_sql_varchar" > dbvarname="Contact_Email" type="in" value="#Arguments.Contact_Email#"> > <cfprocparam cfsqltype="cf_sql_date" > dbvarname="Job_Walk_Date" type="in" value="#Arguments.Job_Walk_Date#"> > <cfprocparam cfsqltype="cf_sql_time" > dbvarname="Job_Walk_Time" type="in" value="#Arguments.Job_Walk_Time#"> > <cfprocparam cfsqltype="cf_sql_integer" > dbvarname="Status" type="in" value="#Arguments.Status#"> > <cfprocparam cfsqltype="cf_sql_date" > dbvarname="Create_Date" type="in" value="#Arguments.Create_Date#"> > <cfprocparam cfsqltype="cf_sql_time" > dbvarname="Create_Time" type="in" value="#Arguments.Create_Time#"> > </cfstoredproc> > <cfreturn propID> > </cffunction> > > When I run the page, the insert query works. I captured the SP in SQL > Profiler, copied it into a new query in SQL Server Manager, and it > inserts the information and returns the newly created ID as it should, > so I am baffeled. Perhaps I need another pair of eyes to see what might > end up being a glaringly obvious error on my part. > > Thanks, > > Bruce > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292770 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4