| Author |
Create a subroutine within a stored proc?
|
|
|
| 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
| |
|
|
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.
>
>
>
>
|
|
|
|