Strange Behaviour in Sybase SP Execution -
05-20-2010
, 12:54 PM
Greetings,
I am getting a strange error while execution of an sp. Here is the
basic flow.
Procedure P1-->
1)Create #summary
2)---some business rules--
3)Call procedure P2 with flag as 5
4)return result set from #summary
Procedure P2 -->
1) If flag is something else other than 5, then do some updates.
2) If flag is 5, then insert data into #summary.
This procedure P2, is called in the wrapper procedure P1 (for flag 5)
and called directly with flag as 0,1,2,3 by some other set of
procedures.
Now when I call P2 with flag other than 5, it should not go to the
code which does an INSERT into
#summary,as it is an IF block. However, even though it does not
executes this code piece
(one specific to flag value 5) whie executing P2 with falg 1 or 2 or 3
or 0, but still looks for
table #summary and gives a run time error saying #summary not found.
This procedure has not been compiled/executed with recompile option. I
am not sure why is it still
looking for the hash table, even though it is not going to execute
that code peice.
Appreciate you valueable ideas!
Regards,
Rajpreet |