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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored procedure calling a char based parameter

Status
Not open for further replies.

mattbrenn

Programmer
Jun 4, 2003
11
GB
SQL2K
Hi,


I've created a stored procedure with a CHAR datatype as the parameter that is passed to it and cant seem to get it to work. I've tried using different fields with different datatypes such as int and numeric and its successful. Is there a problem using a Char datatype as a parameter, if so is there a way around it?
TIA
Matt
(New to SQL)

Stored procedure
@PONUM CHAR

tables etc

Where
( POP_HEADERS.PO_NUMBER = @PONUM)


query analyser


EXEC POPRINT @PONUM ='100051'
 
if you don't specify the size of ur char the default value will be 1

so what u wrote means @PONUM CHAR(1)

then if the field PO_NUMBER is a numeric field u'd better use an numeric parameter

 
Thanks for the tip its very much appreciated
Worked first time.
Best regards
Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top