dbTalk Databases Forums  

Strange Behaviour in Sybase SP Execution

comp.databases.sybase comp.databases.sybase


Discuss Strange Behaviour in Sybase SP Execution in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
test
 
Posts: n/a

Default 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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.