|> >I'm attempting to create a generic Sybase stored procedure which will
|> >accept up to 254 input parameters. Within the stored procedure
|> >I would like to determine how many parameters were passed to the
|> >stored procedure & process them. To accomplish this, I'd like to
|> >have a loop which creates input parm names on the fly & retrieve
|> >the values stored in those input parameters. Can this be done?
|> >Here is an example of what I'm trying to do. The problem here is
|> >clear (see WHILE clause). The program will evaluate the temporary
|> > CREATE PROC processArguments
|> > ...
|> > AS
|> > ProcessArguments:
|> > BEGIN
|> > (blah, blah, blah)
|> > END
The suggestion on the recursive call got me thinking . . . .
Are you going to do similar processing, i.e., is the "(blah,
blah, blah)" the same?, or can you determine which processing to
do based on the actual *value* of the arg's? Will the processing
of the args be independent of each other?
If so . . and I know this isn't as slick as we'd all like . . but
hopefully a little easier to write and debug than the recursive
call(no offense!! ;-) . . .
Redefine your first proc like such:
CREATE PROC processArguments
Now define the second process:
CREATE PROC processArguments2
blah, blah, blah
Of course, you could go straight to processArguments2 from your front
end . . but you'd have to do 254 calls whereas using the two level
method above would require only one front-end-to-server call. The
calls between the processes within the server will take up much less
overhead than doing separate calls to the server(from the front-end)
for each possible variable.
Sybase isn't going to allow indirect variable processing . . . so this
is the . . .um . . 'cleanest' idea I can come up with . . .