Skip to main content
Known Participant
November 20, 2008
Question

Store Procedure Help!

  • November 20, 2008
  • 1 reply
  • 368 views
I did stor proc before and they're working just fine but this time for some reason I did not get any error and did not get any result as well. When I tested the query in analyzer I got records.
I'm using CF8 and Sybase

I tested it with a simple select and still not working:

CREATE PROCEDURE sp_GetRpt
@9277005 varchar (10),
@5113364 varchar (10)

AS
BEGIN

SELECT *
FROM a_table
WHERE code IN ('@code1', '@code2')

END

I'm calling it from my cf application:

<cfstoredproc procedure="sp_GetRpt" datasource="xxxx">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" value="ADA">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" value="TADA">

OR I also tried it with dbvarname, I still got no records but no error:

<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="code1" value="ADA">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="code2" value="TADA">

<cfprocresult name="q_Rpt">
</cfstoredproc>

<cfdump var="#q_Rpt#">

Is there something wrong with my codes?
This topic has been closed for replies.

1 reply

Inspiring
November 20, 2008
> code IN ('@code1', '@code2')

First remove the single quotes from the variables. Otherwise the select will search for the literal string "@code1", not the value of the variable @code1

aleckenAuthor
Known Participant
November 20, 2008
Oh Gosh!!! thank you!!