This section includes general coding information that applies to all CSPs.
CSPs have optional and required parameters. Required parameters must have values supplied; optional parameters default to predefined values.
The following rules apply to CSP parameters:
Both positional and named parameters are supported, but not in the same statement.
Parameter values can be enclosed in double quotes (“”). Parameter values enclosed in quotes must be in the correct case for the target.
Object names (table names, column names, and index names) can be created using lowercase letters. The target database automatically converts object names to uppercase unless the object names are enclosed in double quotes.
Using the DirectConnect DB2 access service, a client application can initiate a CSP by issuing the following statement:
exec sp_name parm1, parm2, . . .
where:
sp_name is the name of the stored procedure (for example, sp_columns).
parm1 and parm2 are parameter values required or desired for that stored procedure.
Using the DirectConnect Transaction Router Service or from a two-tier, gateway-less environment, a client application can initiate a CSP by issuing the following statement:
exec|execute sp_name parm1, parm2, . . .
where:
sp_name is the name of the stored procedure (for example, sp_columns).
parm1 and parm2 are parameter values required or desired for that stored procedure.
You can execute CSPs with a language command or through an RPC event.
You can specify the parameters for a CSP in one of the following forms:
Supply all of the parameters:
exec sp_columns publishers, “dbo”, “pubs2”, “pub_id”
Use “null” or a comma as a placeholder:
exec sp_columns publishers, null, null,”pub_id”
exec sp_columns publishers, , , “pub_id”
Supply one or more parameters in the following form:
@parameter_name = value
For example, to find information about a particular column, issue the following statement:
exec sp_columns @table_name = publishers, @column_name = "pub_id"
The parameter names in the syntax statement must match the parameter names defined by the CSP.
You cannot use this named parameter form if you process a CSP as an RPC event.
This section explains how the parameters table_name, table_owner, and table_qualifier are used in this product:
table_name is the name of the database object about which you want to retrieve catalog information.
table_owner is the owner of the database object about which you want to retrieve catalog information.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |