Represents information of Java stored procedure for which the current user has access authorization to a database.
Attribute Name |
Data Type |
Description |
---|---|---|
sp_name |
VARCHAR(255) |
Stored procedure name |
sp_type |
VARCHAR(16) |
Stored procedure type (function or procedure) |
return_type |
VARCHAR(16) |
Return value type |
arg_count |
INTEGER |
The number of arguments |
lang |
VARCHAR(16) |
Implementing language (currently, Java) |
target |
VARCHAR(4096) |
Name of the Java method to be executed |
owner |
VARCHAR(256) |
Owner |
CREATE VCLASS db_stored_procedure
(sp_name, sp_type, return_type, arg_count, lang, target, owner)
AS
SELECT sp.sp_name,
CASE sp.sp_type WHEN 1 THEN 'PROCEDURE'
ELSE 'FUNCTION' END,
CASE WHEN sp.return_type = 0 THEN 'void'
WHEN sp.return_type = 28 THEN 'CURSOR'
ELSE ( SELECT dt.type_name
FROM _db_data_type dt
WHERE sp.return_type = dt.type_id) END,
sp.arg_count,
CASE sp.lang WHEN 1 THEN 'JAVA'
ELSE '' END, sp.target, sp.owner.name
FROM _db_stored_procedure sp
The following example shows how to retrieve Java stored procedures owned by the current user.
SELECT sp_name, target from db_stored_procedure WHERE sp_type = 'FUNCTION' AND owner = CURRENT_USER
sp_name target
============================================
'hello' 'SpCubrid.HelloCubrid() return java.lang.String'
'sp_int' 'SpCubrid.SpInt(int) return int'