Hi,
You might already solved the problem. Since I do not see any post here I
reply it anyway.
First, if you use SQL server , you have to set up the return code you self
in the stored procedure. Because the default return code is 0.
The stored procedure should look something like:
CREATE PROCEDURE spUpdateUser
@@picture char(20),
@@userid char(20 )
As
UPDATE PasUsers
SET picture = '@picture'
WHERE userid = '@userid'
Return @@Rowcount
GO
The @@Rowcount is the number of the record affected by the update action,
in this case should be 1.
I made up the data type by guessing you should change them to the correct
ones.
Second, after the calling of the stored procedure, You put:
<cfset UpdateOk = CFStoredProc.Statuscode>
<cfif UpdateOK is 1>
<cfoutput>UpdateOK </cfoutput> record has been updated in the database
<cfelse>
Sorry, it failed
</cfif>
You can customize the if statement to suit your needs.
Hope this helps
Sima
"S R"
<dharkangel333@ho To: CF-Talk
<[EMAIL PROTECTED]>
tmail.com> cc:
Subject: cfstoredproc problem
12/29/00 05:32 PM
Please respond to
cf-talk
I have been at this for the past 35 minutes and I just can't figure it out.
This cfstoredproc just isn't working. I've tested the actual stored
procedure on SQL Server by placing some actual values in the stored
procedure and it worked. But when I try to use this cfstoredproc to do the
stored procedure it doesn't do anything. The #cfstoredproc.statuscode# is
even at 0> can you see anything wrong?
<CFSTOREDPROC DATASOURCE="#application.datasource#"
PROCEDURE="sp_UpdatePicture" DBNAME="userpreferences" RETURNCODE="Yes">
<CFPROCPARAM CFSQLTYPE="CF_SQL_VARCHAR" DBVARNAME="@picture"
VALUE="#FORM.picture#" TYPE="In">
<CFPROCPARAM CFSQLTYPE="CF_SQL_VARCHAR" DBVARNAME="@userid"
VALUE="#session.userid#" TYPE="In">
</CFSTOREDPROC>
here is my stored procedure:
UPDATE PasUsers SET picture = '@picture'
WHERE userid = '@userid'
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server! Instant Activation for $99/month w/Free
Setup from SoloServer PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support
Visit SoloServer, https://secure.irides.com/clientsetup.cfm.
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists