You use CREATE PROCEDURE or CREATE FUNCTION to define an external C stored routine. CREATE PROCEDURE or CREATE FUNCTION defines the association of a C function with the procedure name or function name.
- C stored procedure
Use CREATE PROCEDURE to register a C function as a C stored procedure.
- C stored function
Use CREATE FUNCTION to register a C function as a C stored function.
The following figure shows an example of external C stored routine definition.
Figure 10-7 Example of an external C stored routine definition
![[Figure]](FIGURE/ZU100070.GIF)
- Defining public routines
- To use an external C stored routine defined by another user, you must specify its owner's authorization identifier and the routine identifier when you call the stored routine from within a UAP.
- However, if the external C stored routine was defined as a public routine by executing CREATE PUBLIC PROCEDURE or CREATE PUBLIC FUNCTION, then there is no need to specify the owner's authorization identifier when the stored routine is called from within a UAP (only the routine identifier needs to be specified).
- Redefining external C stored routines
- You use ALTER PROCEDURE or ALTER ROUTINE to redefine an external C stored routine, such as when you need to make changes to the C program.
- Deleting external C stored routines
- You use DROP PROCEDURE or DROP FUNCTION to delete an external C stored routine.
- To delete a public routine, use DROP PUBLIC PROCEDURE or DROP PUBLIC FUNCTION. Note that a public routine can be deleted only by the user who defined it or by a user with the DBA privilege.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.