![]() | ![]() |
Home |
|
|
Access Service User's Guide DirectConnect for AS/400 |
|
| Chapter 12 Accessing catalog information with CSPs |
|
| Coding instructions |
|
| Coding examples |
You can execute CSPs with a language command or through an RPC event.
To specify the parameters for a CSP or system procedure, use one of the following forms:
Supply all of the parameters:
sp_columns publishers, "dbo", "pubs2", "pub_id"
Use "null" or a comma as a placeholder:
sp_columns publishers, null, null,"pub_id"
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:
sp_columns @table_name = publishers, @column_name = "pub_id"
Be sure that the parameter names in the syntax statement matches the parameter names defined by the CSP.
You cannot use this named parameter form if you process a CSP as an RPC event.
Table Name, Owner, and Qualifier parametersThis 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 name of the collection in which the database object resides.
If you are using OS/400 version 3.1 or higher and the CSPCatalogQualifier configuration property value is QSYS2 (the global catalog), the CSP table_owner parameter represents a specific collection containing the object in question.
If the CSPCatalogQualifier is the name of a collection, the table_owner parameter can be ignored, set to NULL, or set to the value of the CSPCatalogQualifier (collection name).
table_qualifier is the name of the AS/400 system. An access service is configured for only one AS/400 system. The access service ignores the table_qualifier parameter except for checking the syntax. Clients should leave table_qualifier blank or NULL.
When a CSP returns results, the TABLE_QUALIFIER column is always NULL.
The following figure shows how CSP parameters relate to the AS/400 system.
Figure 12-1: CSP parameters and the AS/400
|
|