Hi Friends,
I'm facing a rather strange problem in sybase stored procedure
Code:
I have a 3 databases A , C and C_TEST
and a stored proc in A named B
The B stored proc is called from isql as
use A
go
B
go
Now B is defined as
create proc B @x=-1 ( x is a varaible here)
select seq_num from C..table
Now when I execute it, i get value from the same tablename in database C_TEST(and not C) of seq_num despite the C..table above(in bold)
However when I insert a debugging line into the stored proc
create proc B @x=-1 ( x is a varaible here)
insert int temptable {@x} ( i inserted it as just a debugging statement)
select seq_num from C..table
It is giving me a correct value that is the value from database C.
Strangely this happening as i have tried it multiple times by removing the debug stmt and then inserting it and the result is same every time
I am not getting any ideas?
Please Advice