Discussion:
My cfstoredproc is there but nothing happen on the db
(too old to reply)
alecken
2009-03-12 16:57:23 UTC
Permalink
I created a temp. error log, what I did, I wrote a detele statement to clear up
all the old error records in the begining and after that, I'm inserting new
error(s) if they become available.
I use stored procedure and the reason for doing this is just to practise with
<cfstoredproc tag.
The funny thing is, I can see the stored proc was run from the debug view but
the record did not get deleted? Have I done something wrong with the code? no
error on the screen.
I use CF8, DB Sybase & windows

<!--- start with a clean up older error records --->
<cfstoredproc procedure="sp_deletedOldError" datasource="#mydb#">
<cfprocparam cfsqltype="CF_SQL_VARCHAR" dbvarname="@user1"
value="#Trim(session.user)#">
<cfprocparam cfsqltype="CF_SQL_VARCHAR" dbvarname="@user2" value="">

</cfstoredproc>

Here is my simple procedures:
CREATE PROCEDURE dbo.sp_deletedOldError

@user1 varchar (2),
@user2 varchar (2)

AS
BEGIN
Delete from tbl_error
Where users IN ('@user1','@user2')
END
JR "Bob" Dobbs
2009-03-12 20:47:11 UTC
Permalink
A couple of observations:
1. The dbvarname attribute is obsolete. You need to specifiy your parameters
in order not by name.

2. I suspect you need to remove the single quotes from this line in your
stored procedure: Where users IN ('@user1','@user2').
Note I'm note a Sybase user I could be wrong about this part.

Loading...