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

function returning error

Status
Not open for further replies.

melberti

Programmer
Oct 16, 2001
7
US
I have a pagehit function returning the error:
"Syntax error converting the varchar value '*' to a column of data type int."

The function does a count() on an integer column (pagehits), with a where clause matching pagename, and returns the integer pagehits. The function is actually getting called from within a cursor in a stored procedure, and it executes successfully for several pagenames but eventually gives the error when it gets to a particular pagename in the cursor. The function also takes month and year parameters, so I can query for hits during a specific timeframe. Depending on the timeframe, this same pagename will also execute successfully, which makes me think that the return value exceeds that allowable as datatype integer, or something like that. All other pagenames successfully execute. I tried changing the return type to bigint, and got the same message but without the asterisk.

Any ideas? Thanks.
melberti
 
*red face*
I looked closer at my function and discovered I had my return variable declared as a varchar instead of an int.
Thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top