Re: CFC Not acting like I expect

2007-11-06 Thread Matt Williams
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


Re: CFC Not acting like I expect

2007-11-06 Thread Bruce Sorge
There were a few things wrong with this once I stepped away, had a cup of
coffee and looked at it again. This is what happens when you are knee deep
into your work and then you get called up by your unit and don't look at
code for over two weeks. LOL

So what I did was remove the returntype attribute since it is not needed,
set the propID to 0, added a CFPROCRESULT tag and all works well now.

Bruce


On 11/6/07, Chris Jordan  wrote:

 It seems to me from looking at the code that propID is just a string:
 foo. That's not a query, and you have your return type set to
 query. Change your return type to string or any and the error
 will go away.

 Chris




~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292775
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFC Not acting like I expect

2007-11-06 Thread Raymond Camden
You set return type to query, but you set propID to foo and returned
it. foo is a string.

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

 

~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292766
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: CFC Not acting like I expect

2007-11-06 Thread Ben Doom
I'm not seeing where you are actually assigning the return from your SP 
to propID.  foo is not a query.

--Ben Doom

Bruce Sorge 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
 
 

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292778
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: CFC Not acting like I expect

2007-11-06 Thread Adkins, Randy
Well the function indicates to return a query structure where you are
returning a single ID. Change the CFFUNCTION to return an integer 

-Original Message-
From: Bruce Sorge [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 06, 2007 11:44 AM
To: CF-Talk
Subject: CFC Not acting like I expect

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



~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292771
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: CFC Not acting like I expect

2007-11-06 Thread Rich
In the code you provided, you set propID as foo, perform the SP call, and
return propID unchanged.  You can add an out parameter to the SP call,
something similar to the following:

cfprocparam dbvarname=@Return_ID variable=retVal cfsqltype=CF_SQL_INT
type=out


~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292780
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFC Not acting like I expect

2007-11-06 Thread Chris Jordan
It seems to me from looking at the code that propID is just a string:
foo. That's not a query, and you have your return type set to
query. Change your return type to string or any and the error
will go away.

Chris

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

 

~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292772
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFC Not acting like I expect

2007-11-06 Thread Eric Cobb
You're trying to return propID, but you don't reference it anywhere in 
your Stored Procedure.  The only time you reference it is with cfset 
propID=foo.  This is just setting a variable, it's not a query, which 
is what your function is expecting as a return type.

Thanks,

Eric

Bruce Sorge 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
 
 

~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292781
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: CFC Not acting like I expect

2007-11-06 Thread Bobby Hartsfield
propID is 'foo' which is not a valid query type. Change returntype=query
to returntype=string just to make it work as is. You will of course want
to change propID from 'foo' to your new ID and change the returntype to the
correct datatype for propID.




~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292790
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4