home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.databases:7833 comp.databases.sybase:310
- Newsgroups: comp.databases,comp.databases.sybase
- Path: sparky!uunet!devlgw!julies
- From: julies@ssf-corp.dhl.com (Julie Stephens)
- Subject: help needed on sybase stored procedure
- Sender: julies@ssf-corp.dhl.com (Julie Stephens)
- Message-ID: <1992Nov14.000317.58320@ssf-corp.dhl.com>
- Date: Sat, 14 Nov 1992 00:03:17 GMT
- Organization: DHL Worldwide Express, Redwood City, Calif., USA
- Lines: 40
-
- 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
- variable @argName--not the input parameter @arg1.
-
- CREATE PROC processArguments
- @arg1 varchar(255),
- @arg2 varchar(255),
- @arg3 varchar(255),
- ...
- @arg254 varchar(255)
- AS
- DECLARE @argName varchar(30)
- DECLARE @argInt int
-
- ProcessArguments:
- SELECT @argInt = 1
- SELECT @argName = '@arg1'
-
- WHILE @argName IS NOT NULL
- BEGIN
- (blah, blah, blah)
- SELECT @argInt = @argInt + 1
- SELECT @argName = '@arg' + (SELECT CONVERT(char(3), @argInt))
- END
-
- Thanks!
-
- Julie Stephens
- --
- Systems Arch., DHL Airways, Inc., 333 Twin Dolphin Dr, Redwood City, CA 94065
- INET: julies@ssfarch.attmail.com UUNET: uunet!ssfarch!julies
- VOICE: (415) 802-4694 FAX: (415) 593-1689
-
-