Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2007



Tip: Looking for answers? Try searching our database.

CF8 <cfQuery> Issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MikeP - 04 Sep 2007 18:23 GMT
In previous versions of CF you could execute a stored procedure using the
<cfQuery> tag and you would receive a query result set containing the returned
data.  For example:

<cfquery name="checkLogin" datasource="myDataSource">
    Execute    LoginUser
            @Email = 'jim@example.com',
            @PasswordHash = '5F4DCC31234765D61D8327DEB882CF99'
</cfquery>

In CF7 and prior this would return a query result set containing several
fields that specified the permission level of the user, etc.  In CF8 the result
set contains a single column called ?COMPUTED_COLUMN_1? and has a single blank
row.  

I?ve tested this same code on CF7 and it works fine.  We need to use <cfQuery>
rather than <cfStoredProcedure> because we need to be able to pass in the names
for parameters since they can be in any order and our stored procedures don?t
always require all parameters. <cfProcParam> does not allow you to pass in a
parameter name.  There is a dbVarName attribute but it hasn?t worked since the
pre-MX days even though it is still referred to in certain places in the docs.  

Anyone else having this problem?
cf_dev2 - 04 Sep 2007 19:28 GMT
> There is a dbVarName attribute but it hasn?t worked since the pre-MX days
even
> though it is still referred to in certain places in the docs.

IIRC dbVarName did work in 7.0.2.  Though this link suggests they may have
reversed this behavior in CF8. I'm not using CF8 so I can't test it.
http://rahulnarula.blogspot.com/2007/06/coldfusion-8-cfprocparam-update_15.html
MikeP - 05 Sep 2007 13:51 GMT
Thank you for your reply.  Yes, I did see that link in my search but since
dbVarName isn't officially noted in the docs I'm hesitant to use it.  
Furthermore, we use Microsoft's Java ODBC driver.  It doesn't seem to play well
with the dbVarName attribute for whatever reason.  It would be best if
<cfquery> simply worked for stored procedures like it used to in CF7.  Unless
this changes I don't see how my company could ever upgrade to CF8.
TomD_2 - 05 Sep 2007 15:02 GMT
I get correct results from a similar stored procedure with CF8 using either the
CF8-supplied SQLServer driver or the Microsoft v1.1 JDBC driver (
http://www.microsoft.com/downloads/thankyou.aspx?familyId=6d483869-816a-44cb-978
7-a866235efc7c )

It works OK with SQLServer 2000 and with SQLServer 2005.

Since you are not getting any error, it doesn't seem that you need to use
dbVarName.

Maybe you should try it with a test procedure which just returns the arguments
to see what is going on:

CREATE PROCEDURE TestProc
    @Email Varchar(128),
    @PasswordHash Varchar(128)
AS
BEGIN
   SELECT @Email as EMAIL, @PasswordHash as PASSWORDHASH
END

-tom-
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.