Entering content frame

This graphic is explained in the accompanying text DBPROCPARAMS Locate the document in the library structure

Prerequisites

You have generated the HOTEL Demo Schema for the SQL Tutorial.

Log on to the database instance DEMODB as user MONA.

Create database procedures and database functions and use them. Proceed as described in SQL Tutorial, Database Procedures and Database Functions.

Examples

You can use the system tableDBPROCPARAMS to determine the following database information, among other things:

·        All input parameters of the database function AVGPRICE in the HOTEL schema and the following parameter information: data type, length and the number of the affected parameter in the range of all parameters within that database function.

SELECT parametername, datatype, len, dec, pos
  FROM DOMAIN.DBPROCPARAMS
    WHERE schemaname = 'HOTEL'
      AND dbprocname = 'AVGPRICE'
      AND "IN/OUT-TYPE" = 'IN'

·        All output parameters of the database procedure AVG_PRICE in the HOTEL schema and the following parameter information: data type, length and the number of the affected parameter in the range of all parameters within that database procedure.

SELECT parametername, datatype, len, dec, pos
  FROM DOMAIN.DBPROCPARAMS
    WHERE schemaname = 'HOTEL'
      AND dbprocname = 'AVG_PRICE'
      AND "IN/OUT-TYPE" = 'OUT'

·        Total number of parameters of the database procedure AVG_PRICE in the schema HOTEL

SELECT COUNT(*)
  FROM DOMAIN.DBPROCPARAMS
    WHERE schemaname = 'HOTEL'
      AND dbprocname = 'AVG_PRICE'

Note

Database procedures: see DBPROCEDURES

Database Functions: see FUNCTIONS

 

Leaving content frame