Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

DB_STORED_PROCEDURE

Represents information of Java stored procedures for which the current user has access authorization in the 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

Definition

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

Example

The following is an example of retrieving Java stored procedures owned by the current user.

csql> select sp_name, target from db_stored_procedure
csql> where sp_type = 'FUNCTION'
csql> and owner = CURRENT_USER 
csql> ;x
 
=== <Result of SELECT Command in Line 3> ===
 
  sp_name               target             
============================================
  'hello'               'SpCubrid.HelloCubrid() return java.lang.String'
  'sp_int'              'SpCubrid.SpInt(int) return int'