dbTalk Databases Forums  

Using temp tables in Sub Proc

comp.databases.sybase comp.databases.sybase


Discuss Using temp tables in Sub Proc in the comp.databases.sybase forum.



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

Default Using temp tables in Sub Proc - 12-15-2003 , 07:21 PM






I am trying to do something like this


CREATE PROC <mainProc>
CREATE TABLE #tmp(...)
subProcA
subProcB
<other code as needed>
go

Then, in a separate script, create the "sub" procedures:

CREATE TABLE #tmp (...)
CREATE PROC subProcA
<code which manipulates #tmp>
go
CREATE PROC subProcA
<code which manipulates #tmp>
go
DROP TABLE #tmp


But the problem is that when i try to create subProc with create #temp
as 1st command i get

"CREATE PROCEDURE must be the first command in a query batch"\


any ideas?

Reply With Quote
  #2  
Old   
Larry Coon
 
Posts: n/a

Default Re: Using temp tables in Sub Proc - 12-15-2003 , 07:46 PM






Shahzad Zafar wrote:

Quote:
But the problem is that when i try to create subProc with create #temp
as 1st command i get

"CREATE PROCEDURE must be the first command in a query batch"\

any ideas?
Separate batches. Run the create table #tmp, then run the
create proc.


Larry Coon
University of California


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.