Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfprocparam error

Status
Not open for further replies.

newbiepg

Programmer
Nov 6, 2002
181
0
0
IN
<cfstoredproc datasource=&quot;test&quot; procedure=&quot;myProc
<cfprocparam type = &quot;IN&quot; CFSQLType=&quot;cf_sql_longvarchar&quot; value= &quot;var_in_clause&quot; maxLength=&quot;4000&quot; dbVarName = &quot;@in_clause&quot; null=&quot;no&quot;>
</cfstoredproc>


Throws this error


[Macromedia][SQLServer JDBC Driver][SQLServer]Syntax error converting the varchar value 'var_in_clause' to a column of data type smallint.


<cfoutput>#var_in_clause#</cfoutput>
gives

5003,5002,5001,5000,45,44,43,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11


The stored proc runs fine when I run it from the query analyzer

Any ideas?
 
never used this tag before but wouldn't you need #'s around the variable name to get the value? it is in quotes so it is trying to make &quot;var_in_clause&quot; into a number (according to the error)

<cfstoredproc datasource=&quot;test&quot; procedure=&quot;myProc
<cfprocparam type = &quot;IN&quot; CFSQLType=&quot;cf_sql_longvarchar&quot; value= &quot;[bold]#[/bold]var_in_clause[bold]#[/bold]&quot; maxLength=&quot;4000&quot; dbVarName = &quot;@in_clause&quot; null=&quot;no&quot;>
</cfstoredproc>


thereptilian120x120.gif
 
someday i'll earn to preview first.... :-
<cfstoredproc datasource=&quot;test&quot; procedure=&quot;myProc
<cfprocparam type = &quot;IN&quot; CFSQLType=&quot;cf_sql_longvarchar&quot; value= &quot;#var_in_clause#&quot; maxLength=&quot;4000&quot; dbVarName = &quot;@in_clause&quot; null=&quot;no&quot;>
</cfstoredproc>

thereptilian120x120.gif
 
Hi I managed to solve it

Putting &quot;#var_in_clause#&quot; was the problem
just inserted the values directly instead of assigning values to var_in_clause and trying to pass it

Thanks for trying
 
your original code didn't have pound signs around the variable name making &quot;var_in_clause&quot; a literal not passing the value of var_in_clause (5003,5002,5001,5000,45...)

thereptilian120x120.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top