The stored procedure
CATALOG_PKS returns the list of fields that
make up the primary key of a view, or of all the views of a database.
We recommend you use the procedure GET_PRIMARY_KEYS instead of this one because “GET_PRIMARY_KEYS” can search on any database, not just in the one you are connected to and it returns the same information.
CATALOG_PKS ( input_view_name : text )
input_view_name(optional): name of the view for which you want to obtain the list of primary key fields. You need to be connected to the database of this view.
NULL, it returns the list of primary key fields of all the views of the database that you are currently connected to.
The procedure returns one row per field that makes up the primary key of each view. The output schema has the following fields:
database_name: database that the view belongs to.
view_name: name of the view.
column_name: field name of the primary key.
pk_name: the name of the primary key. This is the name of the view followed by “_pk”.
The procedure only returns information about the views over which the user has read privileges.
Let us say that there is a view
order_line whose primary key is made
up of the fields
If you execute the following query:
The result will be this: