Home > Archive > ASE Database forum > April 2005 > Create a subroutine within a stored proc?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Create a subroutine within a stored proc?
Jim

2005-04-15, 8:24 pm

I want to create a subroutine in a stored proc with parms
so that I can call it multiple times within the stored proc.

What is the syntax?

Thanks
Mark A. Parsons

2005-04-15, 8:24 pm

uhhhhhhh ... just create another stored proc that contains the 'subroutine'
code ... call this the 'child' stored proc; then have the main/parent proc
call the 'child' proc multiple times

Jim wrote:

> I want to create a subroutine in a stored proc with parms
> so that I can call it multiple times within the stored proc.
>
> What is the syntax?
>
> Thanks


Jim

2005-04-18, 9:24 am


There's no way to create a subroutine within a stored
proc? I wanted to avoid creating a new stored proc because
I'm using temp tables. I know I could use global temp
tables but wanted to avoid that.



> uhhhhhhh ... just create another stored proc that contains
> the 'subroutine' code ... call this the 'child' stored
> proc; then have the main/parent proc call the 'child' proc
> multiple times
>
> Jim wrote:
>
> stored proc. >
>

Mark Maslow

2005-04-18, 1:24 pm

Temp tables created in parent SP can be accessed by child SP.

The only "trick" is that in order to compile the child SP you first have
to create the temp tables in the same batch that creates the SP.

In article <4263b335.544e.1681692777@sybase.com>, Jim says...
>
> There's no way to create a subroutine within a stored
> proc? I wanted to avoid creating a new stored proc because
> I'm using temp tables. I know I could use global temp
> tables but wanted to avoid that.
>
>
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com