user2247776
user2247776

Reputation:

Two queries on Sybase giving different result

Below are two proc running in sybase. The first has param name with value, the second only value. The first one runs fine, but when I run the second I get Implicit conversion from datatype 'INT' to 'VARCHAR' is not allowed. Use the CONVERT function to run this query Can someone tell me why?

First:

exec pu @a=null, @b=null, @c=null, @d=null, @e=null, @f=null, @g='2013-Jun-12 22:10:00.670', @h=100, @i=2, @j=null, @k=null, @l=null, @m=null, @n=0, @o='P', @p=null, @q=null, @r=null, @s=null, @t='junit', @u=null, @v=null, @w=null

Second:

exec pu ( null, null, null, null, null, null, '2013-Jun-12 22:10:00.187', 100, 2, null, null, null, null, 0, 'P', null, null, null, null, 'junit', null, null, null )

Upvotes: 0

Views: 128

Answers (1)

SmartDeveloper
SmartDeveloper

Reputation: 61

What could also be happening is that the parameters are not defined in the same as order as you are expecting them.

In scenario 1, you won't see a problem since parameters are referenced by name.

In scenario 2 however you are using positional reference which could be exposing this issue.

Please check the proc definition and make sure parameters are declared in same order as expected.

Upvotes: 1

Related Questions