Information Schema PARAMETERS Table

The Information Schema PARAMETERS table stores information about stored procedures and stored functions parameters.

It contains the following columns:

ColumnDescription
SPECIFIC_CATALOGAlways def.
SPECIFIC_SCHEMADatabase name containing the stored routine parameter.
SPECIFIC_NAMEStored routine name.
ORDINAL_POSITIONOrdinal position of the parameter, starting at 1. 0 for a function RETURNS clause.
PARAMETER_MODEOne of IN, OUT, INOUT or NULL for RETURNS.
PARAMETER_NAMEName of the parameter, or NULL for RETURNS.
DATA_TYPEThe column's data type.
CHARACTER_MAXIMUM_LENGTHMaximum length.
CHARACTER_OCTET_LENGTHSame as the CHARACTER_MAXIMUM_LENGTH except for multi-byte character sets.
NUMERIC_PRECISIONFor numeric types, the precision (number of significant digits) for the column. NULL if not a numeric field.
NUMERIC_SCALEFor numeric types, the scale (significant digits to the right of the decimal point). NULL if not a numeric field.
DATETIME_PRECISIONFractional-seconds precision, or NULL if not a time data type.
CHARACTER_SET_NAMECharacter set if a non-binary string data type, otherwise NULL.
COLLATION_NAMECollation if a non-binary string data type, otherwise NULL.
DTD_IDENTIFIERDescription of the data type.
ROUTINE_TYPEPROCEDURE or FUNCTION.

Information from this table is similar to that found in the param_list column in the mysql.proc table, and the output of the SHOW CREATE PROCEDURE and SHOW CREATE FUNCTION statements.

To obtain information about the routine itself, you can query the Information Schema ROUTINES table.

Example

SELECT * FROM information_schema.PARAMETERS
LIMIT 1 \G
********************** 1. row **********************
        SPECIFIC_CATALOG: def
         SPECIFIC_SCHEMA: accounts
           SPECIFIC_NAME: user_counts
        ORDINAL_POSITION: 1
          PARAMETER_MODE: IN
          PARAMETER_NAME: user_order
               DATA_TYPE: varchar
CHARACTER_MAXIMUM_LENGTH: 255
  CHARACTER_OCTET_LENGTH: 765
       NUMERIC_PRECISION: NULL
           NUMERIC_SCALE: NULL
      DATETIME_PRECISION: NULL
      CHARACTER_SET_NAME: utf8
          COLLATION_NAME: utf8_general_ci
          DTD_IDENTIFIER: varchar(255)
            ROUTINE_TYPE: PROCEDURE

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.