Nonstop Database, HiRDB Version 9 System Operation Guide

[Contents][Index][Back][Next]

16.2 Creating (registering) a stored procedure or stored function

Organization of this section
(1) Creating a stored procedure
(2) Creating a stored function

(1) Creating a stored procedure

CREATE PROCEDURE is used to create a stored procedure. For details on how to use CREATE PROCEDURE to create a procedure, see the HiRDB Version 9 UAP Development Guide.

(2) Creating a stored function

CREATE FUNCTION is used to create a stored function. For details on how to use CREATE FUNCTION to create a function, see the HiRDB Version 9 UAP Development Guide.

(a) When a stored function is created, an existing stored function might be invalidated

When a stored function is created, an existing stored function might become invalid. For details about the invalidating conditions, see CREATE [PUBLIC] FUNCTION (Define function, define public function) in the manual HiRDB Version 9 SQL Reference.

If an existing stored function becomes invalid, use ALTER ROUTINE to re-create it.

(b) When a stored function is created, an existing stored procedure might be invalidated

When a stored function is created, an existing stored procedure might become invalid. For details about the invalidating conditions, see CREATE [PUBLIC] FUNCTION (Define function, define public function) in the manual HiRDB Version 9 SQL Reference.

If an existing stored procedure becomes invalid, use ALTER PROCEDURE or ALTER ROUTINE to re-create it.

(c) When a stored function is created, an existing trigger might be invalidated

When a stored function is created, an existing trigger might become invalid. For details about the invalidating conditions, see CREATE [PUBLIC] FUNCTION (Define function, define public function) in the manual HiRDB Version 9 SQL Reference.

If an existing trigger becomes invalid, use ALTER TRIGGER or ALTER ROUTINE to re-create it.

(d) A newly created stored function might be invalidated

A stored function created using the following procedure might become invalid.

Procedure
  1. Install a plug-in.
  2. Create a stored function for calling the plug-in function installed in step 1.#
  3. Install a different plug-in from the one installed in step 1.
#: If the plug-ins installed in steps 1 and 3 have the same function name and the same number of parameters, the stored function created in step 2 is invalidated when step 3 is executed. In such a case, ALTER ROUTINE can used to re-create the invalidated stored function.