I've been using stored procedures extensively in my latest app, so I thought
I'd pass on some observations and opinions:
Firstly, I don't think you should be appending the @ symbol to your variable
names. Use dbvarname="ID", rather than dbvarname="@ID". As well, it has
been my experience that, when using cfstoredproc and cfprocparam, your
cfprocparam tags need to be in the same order as you've defined your
parameters within the stored procedure.
In my opinion, unless you're returning multiple result sets, it's better to
use <cfquery> to execute the SP, rather than <cfstoredproc>. I seem to get
much more meaningful error messages from cfquery, and I've not encountered
any problems using it instead of cfstoredproc. It also eliminates the need
to pass parameters in a particular order. In fact, it has allowed me to
write a really cool routine that I use with a fusebox-esque methodology
which eliminates the need for about 90% of all <cfstoredproc> or <cfquery>
tags. I just write my stored procedures and call them by name - I don't
have to explicitly set the parameters for them - my routine does that.
Anyway, I digress. All I wanted to say is that I am much happier with
cfquery for running stored procs.
Time to go home now,
Bob
-----Original Message-----
From: Robert Everland III [mailto:[EMAIL PROTECTED]]
Sent: February 3, 2001 6:11 PM
To: CF-Talk
Subject: Stored Procedure Problem
I am having problems passing to variables to a stored procedure. Am i doing
this right? The only time it updates is if the ID and Entry are the same
number.
<cfstoredproc procedure="sp_addvote" datasource="UCFHotties"
dbname="UCFHotties">
<!--- CFPROCPARAM tags --->
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="@ID"
value="#ID#" null="No">
<!--- CFPROCPARAM tags --->
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="@entry"
value="#entry#" null="No">
</CFSTOREDPROC>
Bob Everland
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists