PKG_UTIL
Table 1 lists all APIs supported by the PKG_UTIL package.
API |
Description |
---|---|
Obtains the length of a LOB. |
|
Reads a part of a LOB. |
|
Writes the source object to the target object in the specified format. |
|
Appends a specified number of characters of the source LOB to the target LOB. |
|
Compares two LOBs based on the specified length. |
|
Returns the position of the Nth occurrence of a character string in a LOB. |
|
Resets the character in specified position of a LOB to a specified character. |
|
Displays character strings. |
|
Obtains the length of RAW data. |
|
Converts VARCHAR2 data to RAW data. |
|
Converts binary integers to RAW data. |
|
Converts RAW data to binary integers. |
|
Sets a random seed. |
|
Returns a random value. |
|
Sets the directory to be operated. |
|
Opens a file based on the specified file name and directory. |
|
Sets the maximum length of a line to be written to a file. |
|
Checks whether a file handle is closed. |
|
Reads data of a specified length from an open file handle. |
|
Reads a line of data from an open file handle. |
|
Writes the data specified in the buffer to a file. |
|
Writes the buffer to a file and adds newline characters. |
|
Adds a line. |
|
Reads binary data of a specified length from an open file handle. |
|
Writes binary data to a file. |
|
Writes data from a file handle to a physical file. |
|
Closes an open file handle. |
|
Deletes a physical file. To do so, you must have the corresponding permission. |
|
Renames files on the disk, similar to mv in Unix. |
|
Returns the size of a file. |
|
Returns the number of blocks contained in a file. |
|
Checks whether a file exists. |
|
Specifies the offset of a returned file, in bytes. |
|
Sets the offset for file position. |
|
Closes all file handles opened in a session. |
|
Throws an exception. |
- PKG_UTIL.LOB_GET_LENGTH
Obtains the length of the input data.
The prototype of the PKG_UTIL.LOB_GET_LENGTH function is as follows:
1 2 3 4
PKG_UTIL.LOB_GET_LENGTH( lob IN anyelement ) RETURN INTEGER;
Table 2 PKG_UTIL.LOB_GET_LENGTH API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
lob
clob/blob
IN
No
Indicates the object whose length is to be obtained.
- PKG_UTIL.LOB_READ
Reads an object and returns the specified part.
The prototype of the PKG_UTIL.LOB_READ function is as follows:1 2 3 4 5 6 7
PKG_UTIL.LOB_READ( lob IN anyelement, len IN int, start IN int, mode IN int ) RETURN ANYELEMENT
Table 3 PKG_UTIL.LOB_READ API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
lob
clob/blob
IN
No
Specifies CLOB or BLOB data.
len
int
IN
No
Specifies the length of the returned result.
start
int
IN
No
Specifies the offset to the first character.
mode
int
IN
No
Specifies the type of the read operation. 0 indicates READ, 1 indicates TRIM, and 2 indicates SUBSTR.
- PKG_UTIL.LOB_WRITE
Writes the source object to the target object based on the specified parameters and returns the target object.
The prototype of the PKG_UTIL.LOB_WRITE function is as follows:1 2 3 4 5 6 7 8 9 10 11 12 13 14
PKG_UTIL.LOB_WRITE( dest_lob INOUT blob, src_lob IN raw len IN int, start_pos IN int ) RETURN BLOB; PKG_UTIL.LOB_WRITE( dest_lob INOUT clob, src_lob IN varchar2 len IN int, start_pos IN int ) RETURN CLOB;
Table 4 PKG_UTIL.LOB_WRITE API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
dest_lob
clob/blob
INOUT
No
Specifies the target object that data will be written to.
src_lob
clob/blob
IN
No
Specifies the source object to be written.
len
int
IN
No
Specifies the write length of the source object.
start_pos
int
IN
No
Specifies the write start position of the target object.
- PKG_UTIL.LOB_APPEND
Appends the source object to the target BLOB/CLOB and returns the target BLOB/CLOB.
The prototype of the PKG_UTIL.LOB_APPEND function is as follows:1 2 3 4 5 6 7 8 9 10 11 12 13
PKG_UTIL.LOB_APPEND( dest_lob INOUT blob, src_lob IN blob, len IN int default NULL ) RETURN BLOB; PKG_UTIL.LOB_APPEND( dest_lob INOUT clob, src_lob IN clob, len IN int default NULL ) RETURN CLOB;
Table 5 PKG_UTIL.LOB_APPEND API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
dest_lob
blob/clob
INOUT
No
Specifies the target BLOB/CLOB that data will be written to.
src_lob
blob/clob
IN
No
Specifies the source BLOB/CLOB to be written.
len
int
IN
Yes
Length of the source object to be written. If the value is NULL, the entire source object is written by default.
- PKG_UTIL.LOB_COMPARE
Checks whether objects are the same based on the specified start position and size. If lob1 is larger, 1 is returned. If lob2 is larger, –1 is returned. If lob1 is equal to lob2, 0 is returned.
The prototype of the PKG_UTIL.LOB_COMPARE function is as follows:1 2 3 4 5 6 7 8
PKG_UTIL.LOB_COMPARE( lob1 IN anyelement, lob2 IN anyelement, len IN int default 1073741771, start_pos1 IN int default 1, start_pos2 IN int default 1 ) RETURN INTEGER;
Table 6 PKG_UTIL.LOB_COMPARE API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
lob1
clob/blob
IN
No
Indicates the character string for comparison.
lob2
clob/blob
IN
No
Indicates the character string for comparison.
len
int
IN
No
Indicates the length to be compared.
start_pos1
int
IN
No
Specifies the start offset of lob1.
start_pos2
int
IN
No
Specifies the start offset of lob2.
- PKG_UTIL.LOB_MATCH
Returns the position where a pattern is displayed in a LOB for the match_nth time.
The prototype of the PKG_UTIL.LOB_MATCH function is as follows:1 2 3 4 5 6 7
PKG_UTIL.LOB_MATCH( lob IN anyelement, pattern IN anyelement, start IN int, match_nth IN int default 1 ) RETURN INTEGER;
Table 7 PKG_UTIL.LOB_MATCH API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
lob
clob/blob
IN
No
Indicates the character string for comparison.
pattern
clob/blob
IN
No
Specifies the pattern to be matched.
start
int
IN
No
Specifies the start position for LOB comparison.
match_nth
int
IN
No
Specifies the matching times.
- PKG_UTIL.LOB_RESET
Clears a character string and resets the string to the value of value.
The prototype of the PKG_UTIL.LOB_RESET function is as follows:1 2 3 4 5 6 7
PKG_UTIL.LOB_RESET( lob IN blob, len IN int, start IN int, value IN int default 0 ) RETURN record;
Table 8 PKG_UTIL.LOB_RESET API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
lob
blob
IN
No
Indicates the character string for reset.
len
int
IN
No
Specifies the length of the string to be reset.
start
int
IN
No
Specifies the start position for reset.
value
int
IN
Yes
Sets characters. Default value: 0.
- PKG_UTIL.IO_PRINT
The prototype of the PKG_UTIL.IO_PRINT function is as follows:
1 2 3 4 5
PKG_UTIL.IO_PRINT( format IN text, is_one_line IN boolean ) RETURN void;
Table 9 PKG_UTIL.IO_PRINT API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
format
text
IN
No
Indicates the character string to be output.
is_one_line
boolean
IN
No
Specifies whether to output the string as a line.
- PKG_UTIL.RAW_GET_LENGTH
Obtains the length of RAW data.
The prototype of the PKG_UTIL.RAW_GET_LENGTH function is as follows:1 2 3 4
PKG_UTIL.RAW_GET_LENGTH( value IN raw ) RETURN integer;
Table 10 PKG_UTIL.RAW_GET_LENGTH API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
raw
raw
IN
No
Indicates the object whose length is to be obtained.
- PKG_UTIL.RAW_CAST_FROM_VARCHAR2
Converts VARCHAR2 data to RAW data.
The prototype of the PKG_UTIL.RAW_CAST_FROM_VARCHAR2 function is as follows:1 2 3 4
PKG_UTIL.RAW_CAST_FROM_VARCHAR2( str IN varchar2 ) RETURN raw;
Table 11 PKG_UTIL.RAW_CAST_FROM_VARCHAR2 API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
str
varchar2
IN
No
Specifies the source data to be converted.
- PKG_UTIL.RAW_CAST_FROM_BINARY_INTEGER
Converts BIGINT data to RAW data.
The prototype of the PKG_UTIL.RAW_CAST_FROM_BINARY_INTEGER function is as follows:1 2 3 4 5
PKG_UTIL.RAW_CAST_FROM_BINARY_INTEGER( value IN BIGINT, endianess IN INTEGER ) RETURN RAW;
Table 12 PKG_UTIL.RAW_CAST_FROM_BINARY_INTEGER API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
value
BIGINT
IN
No
Specifies the source data to be converted.
endianess
INTEGER
IN
No
The value is an integer in lexicographic order. Currently, the value can be 1 (BIG_ENDIAN) or 2 (LITTLE_ENDIAN).
- PKG_UTIL.RAW_CAST_TO_BINARY_INTEGER
Converts RAW data into BINARY_INTEGER.
The prototype of the PKG_UTIL.RAW_CAST_TO_BINARY_INTEGER function is as follows:1 2 3 4 5
PKG_UTIL.RAW_CAST_TO_BINARY_INTEGER( value IN RAW, endianess IN INTEGER ) RETURN INTEGER;
Table 13 PKG_UTIL.RAW_CAST_TO_BINARY_INTEGER API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
value
RAW
IN
No
Specifies the source data to be converted.
endianess
INTEGER
IN
No
The value is an integer in lexicographic order. Currently, the value can be 1 (BIG_ENDIAN) or 2 (LITTLE_ENDIAN).
- PKG_UTIL.RANDOM_SET_SEED
The prototype of the PKG_UTIL.RANDOM_SET_SEED function is as follows:
1 2 3 4
PKG_UTIL.RANDOM_SET_SEED( seed IN int ) RETURN integer;
Table 14 PKG_UTIL.RANDOM_SET_SEED API parameters Parameter
Type
Input/Output Parameter
Can Be Empty
Description
seed
int
IN
No
Sets a random seed.
- PKG_UTIL.RANDOM_GET_VALUE
Returns a 15-digit random number ranging from 0 to 1.
The prototype of the PKG_UTIL.RANDOM_GET_VALUE function is as follows:1 2 3
PKG_UTIL.RANDOM_GET_VALUE( ) RETURN numeric;
- PKG_UTIL.FILE_SET_DIRNAME
Sets the directory to be operated. It must be called to set directory for each operation involving a single directory.
The prototype of the PKG_UTIL.FILE_SET_DIRNAME function is as follows:
1 2 3 4
PKG_UTIL.FILE_SET_DIRNAME( dir IN text ) RETURN bool
Table 15 PKG_UTIL.FILE_SET_DIRNAME API parameters Parameter
Description
dirname
Directory of a file. It is a string, indicating an object name.
NOTE:File directories need to be added to the system catalog PG_DIRECTORY. If the input path does not match the path in PG_DIRECTORY, an error indicating that the path does not exist is reported. Functions that involve location as parameters also comply with this rule.
- PKG_UTIL.FILE_OPEN
Opens a file. A maximum of 50 files can be opened at a time. This function returns a handle of the INTEGER type.
The prototype of the PKG_UTIL.FILE_OPEN function is as follows:
1 2 3
PKG_UTIL.FILE_OPEN( file_name IN text, open_mode IN integer)
Table 16 PKG_UTIL.FILE_OPEN API parameters Parameter
Description
file_name
File name with an extension (file type), excluding the path name. A path contained in a file name is ignored in the OPEN function. In Unix, the file name cannot end with the combination of a slash and a dot (/.).
open_mode
File opening mode, including r (read), w (write), and a (append).
NOTE:For the write operation, the system checks the file type. If the ELF file is written, an error is reported and the system exits.
- PKG_UTIL.FILE_SET_MAX_LINE_SIZE
Sets the maximum length of a line to be written to a file.
The prototype of the PKG_UTIL.FILE_SET_MAX_LINE_SIZE function is as follows:
1 2 3
PKG_UTIL.FILE_SET_MAX_LINE_SIZE( max_line_size in integer) RETURN BOOL
Table 17 PKG_UTIL.FILE_SET_MAX_LINE_SIZE API parameters Parameter
Description
max_line_size
Maximum number of characters in each line, including newline characters. The minimum value is 1 and the maximum is 32767. If this parameter is not specified, the default value 1024 is used.
- PKG_UTIL.FILE_IS_CLOSE
Checks whether a file handle is closed.
The prototype of the PKG_UTIL.FILE_IS_CLOSE function is as follows:
1 2 3 4
PKG_UTIL.FILE_IS_CLOSE( file in integer ) RETURN BOOL
Table 18 PKG_UTIL.FILE_IS_CLOSE API parameters Parameter
Description
file
Opened file handle.
- PKG_UTIL.FILE_READ
Reads a line of data from an open file handle based on the specified length.
The prototype of the PKG_UTIL.FILE_READ function is as follows:
1 2 3 4
PKG_UTIL.FILE_READ( file IN integer, buffer OUT text, len IN bigint default 1024)
Table 19 PKG_UTIL.FILE_READ API parameters Parameter
Description
file
File handle opened by calling the OPEN function. The file must be opened in read mode. Otherwise, the INVALID_OPERATION exception is thrown.
buffer
Buffer used to receive data.
len
Number of bytes read from a file.
- PKG_UTIL.FILE_READLINE
Reads a line of data from an open file handle based on the specified length.
The prototype of the PKG_UTIL.FILE_READLINE function is as follows:
1 2 3 4
PKG_UTIL.FILE_READLINE( file IN integer, buffer OUT text, len IN integer default NULL)
Table 20 PKG_UTIL.FILE_READLINE API parameters Parameter
Description
file
File handle opened by calling the OPEN function. The file must be opened in read mode. Otherwise, the INVALID_OPERATION exception is thrown.
buffer
Buffer used to receive data.
len
Number of bytes read from a file. The default value is NULL. If the default value NULL is used, max_line_size is used to specify the line size.
- PKG_UTIL.FILE_WRITE
Writes the data specified in the buffer to a file.
The prototype of the PKG_UTIL.FILE_WRITE function is as follows:
1 2 3 4 5
PKG_UTIL.FILE_WRITE( file in integer, buffer in text ) RETURN BOOL
Table 21 PKG_UTIL.FILE_WRITE API parameters Parameter
Description
file
Opened file handle.
buffer
Text data to be written to a file. The maximum buffer size is 32767 bytes. If no value is specified, the default value is 1024 bytes. Before the writing is performed, the buffer occupied by PUT operations cannot exceed 32767 bytes.
NOTE:For the write operation, the system checks the file type. If the ELF file is written, an error is reported and the system exits.
- PKG_UTIL.FILE_NEWLINE
Writes a line terminator to an open file. The line terminator is related to the platform.
The prototype of the PKG_UTIL.FILE_NEWLINE function is as follows:
1 2 3 4
PKG_UTIL.FILE_NEWLINE( file in integer ) RETURN BOOL
Table 22 PKG_UTIL.FILE_NEWLINE API parameters Parameter
Description
file
Opened file handle.
- PKG_UTIL.FILE_WRITELINE
The prototype of the PKG_UTIL.FILE_WRITELINE function is as follows:
1 2 3 4 5
PKG_UTIL.FILE_WRITELINE( file in integer, buffer in text ) RETURN BOOL
Table 23 PKG_UTIL.FILE_WRITELINE API parameters Parameter
Description
file
Opened file handle.
buffer
Content to be written.
- PKG_UTIL.FILE_READ_RAW
Reads binary data of a specified length from an open file handle and returns the read binary data. The return type is RAW.
The prototype of the PKG_UTIL.FILE_READ_RAW function is as follows:
1 2 3 4 5
PKG_UTIL.FILE_READ_RAW( file in integer, length in integer default NULL ) RETURN raw
Table 24 PKG_UTIL.FILE_READ_RAW API parameters Parameter
Description
file
Opened file handle.
length
Length of the data to be read. The default value is NULL. By default, all data in the file is read. The maximum size is 1 GB.
- PKG_UTIL.FILE_WRITE_RAW
Writes the input binary object of the RAW type to an open file. If the insertion is successful, true is returned.
The prototype of the PKG_UTIL.FILE_WRITE_RAW function is as follows:
1 2 3 4 5
PKG_UTIL.FILE_WRITE_RAW( file in integer, r in raw ) RETURN BOOL
Table 25 PKG_UTIL.FILE_WRITE_RAW API parameters Parameter
Description
file
Opened file handle.
r
Data to be written to the file.
NOTE:For the write operation, the system checks the file type. If the ELF file is written, an error is reported and the system exits.
- PKG_UTIL.FILE_FLUSH
Data in a file handle must be written into a physical file. Data in the buffer must have a line terminator. Refresh is important if a file must be read when it is opened. For example, debugging information can be refreshed to a file so that it can be read immediately.
The prototype of the PKG_UTIL.FILE_FLUSH function is as follows:
1 2 3 4
PKG_UTIL.FILE_FLUSH ( file in integer ) RETURN VOID
Table 26 PKG_UTIL.FILE_FLUSH API parameters Parameter
Description
file
Opened file handle.
- PKG_UTIL.FILE_CLOSE
The prototype of the PKG_UTIL.FILE_CLOSE function is as follows:
1 2 3 4
PKG_UTIL.FILE_CLOSE ( file in integer ) RETURN BOOL
Table 27 PKG_UTIL.FILE_CLOSE API parameters Parameter
Description
file
Opened file handle.
- PKG_UTIL.FILE_REMOVE
Deletes a disk file. To perform this operation, you must have required permissions.
The prototype of the PKG_UTIL.FILE_REMOVE function is as follows:
1 2 3 4
PKG_UTIL.FILE_REMOVE( file_name in text ) RETURN VOID
Table 28 PKG_UTIL.FILE_REMOVE API parameters Parameter
Description
filen_ame
Name of the file to be deleted
- PKG_UTIL.FILE_RENAME
The function renames files on the disk, similar to mv in Unix.
The prototype of the PKG_UTIL.FILE_RENAME function is as follows:
1 2 3 4 5 6
PKG_UTIL.FILE_RENAME( src_dir in text, src_file_name in text, dest_dir in text, dest_file_name in text, overwrite boolean default false)
Table 29 PKG_UTIL.FILE_RENAME API parameters Parameter
Description
src_dir
Source file directory (case-sensitive)
NOTE:- File directories need to be added to the system catalog PG_DIRECTORY. If the input path does not match the path in PG_DIRECTORY, an error indicating that the path does not exist will be reported. Functions that involve location as parameters also comply with this rule.
- When the GUC parameter safe_data_path is enabled, you can only use an advanced package to read and write files in the file path specified by safe_data_path.
src_file_name
Source file name
dest_dir
Target file directory (case-sensitive)
NOTE:- File directories need to be added to the system catalog PG_DIRECTORY. If the input path does not match the path in PG_DIRECTORY, an error indicating that the path does not exist will be reported. Functions that involve location as parameters also comply with this rule.
- When the GUC parameter safe_data_path is enabled, you can only use an advanced package to read and write files in the file path specified by safe_data_path.
dest_file_name
Target file name
overwrite
The default value is false. If a file with the same name exists in the destination directory, the file will not be rewritten.
- PKG_UTIL.FILE_SIZE
Returns the size of a specified file.
The prototype of the PKG_UTIL.FILE_SIZE function is as follows:
1 2 3
bigint PKG_UTIL.FILE_SIZE( file_name in text )return bigint
Table 30 PKG_UTIL.FILE_SIZE API parameters Parameter
Description
file_name
File name
- PKG_UTIL.FILE_BLOCK_SIZE
Returns the number of blocks contained in a specified file.
The prototype of the PKG_UTIL.FILE_BLOCK_SIZE function is as follows:
1 2 3
bigint PKG_UTIL.FILE_BLOCK_SIZE( file_name in text )return bigint
Table 31 PKG_UTIL.FILE_BLOCK_SIZE API parameters Parameter
Description
file_name
File name
- PKG_UTIL.FILE_EXISTS
The prototype of the PKG_UTIL.FILE_EXISTS function is as follows:
1 2 3 4
PKG_UTIL.FILE_EXISTS( file_name in text ) RETURN BOOL
Table 32 PKG_UTIL.FILE_EXISTS API parameters Parameter
Description
file_name
File name
- PKG_UTIL.FILE_GETPOS
Specifies the offset of a returned file, in bytes.
The prototype of the PKG_UTIL.FILE_GETPOS function is as follows:
1 2 3 4
PKG_UTIL.FILE_GETPOS( file in integer ) RETURN BIGINT
Table 33 PKG_UTIL.FILE_GETPOS API parameters Parameter
Description
file
Opened file handle.
- PKG_UTIL.FILE_SEEK
Adjusts the position of a file pointer forward or backward based on the specified number of bytes.
The prototype of the PKG_UTIL.FILE_SEEK function is as follows:
1 2 3 4 5
void PKG_UTIL.FILE_SEEK( file in integer, start in bigint ) RETURN VOID
Table 34 PKG_UTIL.FILE_SEEK API parameters Parameter
Description
file
Opened file handle.
start
File offset, in bytes.
- PKG_UTIL.FILE_CLOSE_ALL
Closes all file handles opened in a session.
The prototype of the PKG_UTIL.FILE_CLOSE_ALL function is as follows:
PKG_UTIL.FILE_CLOSE_ALL( ) RETURN VOID
Table 35 PKG_UTIL.FILE_CLOSE_ALL API parameters Parameter
Description
None
None
- PKG_UTIL.EXCEPTION_REPORT_ERROR
The prototype of the PKG_UTIL.EXCEPTION_REPORT_ERROR function is as follows:
1 2 3 4 5 6
PKG_UTIL.EXCEPTION_REPORT_ERROR( code integer, log text, flag boolean DEFAULT false ) RETURN INTEGER
Table 36 PKG_UTIL.EXCEPTION_REPORT_ERROR API parameters Parameter
Description
code
Error code displayed when an exception occurs.
log
Logs displayed when an exception occurs.
flag
Reserved. The default value is false.
- PKG_UTIL.app_read_client_info
The prototype of the PKG_UTIL.app_read_client_info function is as follows:
1 2 3
PKG_UTIL.app_read_client_info( OUT buffer text )return text
Table 37 PKG_UTIL.app_read_client_info API parameters Parameter
Description
buffer
Client information returned.
- PKG_UTIL.app_set_client_info
The prototype of the PKG_UTIL.app_set_client_info function is as follows:
1 2 3
PKG_UTIL.app_set_client_info( str text )
Table 38 PKG_UTIL.app_set_client_info API parameters Parameter
Description
str
Client information to be set.
- PKG_UTIL.lob_converttoblob
Converts a CLOB to a BLOB. amount indicates the conversion length.
The prototype of the PKG_UTIL.lob_converttoblob function is as follows:
1 2 3 4 5 6 7
PKG_UTIL.lob_converttoblob( dest_lob blob, src_clob clob, amount integer, dest_offset integer, src_offset integer )return raw
Table 39 PKG_UTIL.lob_converttoblob API parameters Parameter
Description
dest_lob
Target LOB.
src_clob
CLOB to be converted.
amount
Conversion length.
dest_offset
Start position of the target LOB.
src_offset
Start position of the source CLOB.
- PKG_UTIL.lob_converttoclob
Converts a BLOB to a CLOB. amount indicates the conversion length.
The prototype of the PKG_UTIL.lob_converttoclob function is as follows:
1 2 3 4 5 6 7
PKG_UTIL.lob_converttoclob( dest_lob clob, src_blob blob, amount integer, dest_offset integer, src_offset integer )return text
Table 40 PKG_UTIL.lob_converttoclob API parameters Parameter
Description
dest_lob
Target LOB.
src_blob
BLOB to be converted.
amount
Conversion length.
dest_offset
Start position of the target LOB.
src_offset
Start position of the source CLOB.
- PKG_UTIL.lob_texttoraw
Converts the text type to the raw type.
The prototype of the PKG_UTIL.lob_texttoraw function is as follows:
1 2 3 4
PKG_UTIL.lob_texttoraw( src_lob clob ) RETURN raw
Table 41 PKG_UTIL.lob_texttoraw API parameters Parameter
Description
src_lob
LOB to be converted.
- PKG_UTIL.match_edit_distance_similarity
Calculates the difference between two character strings.
The prototype of the PKG_UTIL.match_edit_distance_similarity function is as follows:
1 2 3 4 5
PKG_UTIL.match_edit_distance_similarity( str1 text, str2 text ) RETURN INTEGER
Table 42 PKG_UTIL.match_edit_distance_similarity API parameters Parameter
Description
str1
First character string.
str2
Second character string.
- PKG_UTIL.raw_cast_to_varchar2
Converts the raw type to the varchar2 type.
The prototype of the PKG_UTIL.raw_cast_to_varchar2 function is as follows:
1 2 3 4
PKG_UTIL.raw_cast_to_varchar2( str raw ) RETURN varchar2
Table 43 PKG_UTIL.raw_cast_to_varchar2 API parameters Parameter
Description
str
Hexadecimal string.
- PKG_UTIL.session_clear_context
The prototype of the PKG_UTIL.session_clear_context function is as follows:
1 2 3 4 5 6
PKG_UTIL.session_clear_context( namespace text, client_identifier text, attribute text ) RETURN INTEGER
Table 44 PKG_UTIL.session_clear_context API parameters Parameter
Description
namespace
Namespace of an attribute.
client_identifier
Usually the value of client_identifier is the same as that of namespace. If this parameter is set to null, all namespaces are modified by default.
attribute
Attribute value to be cleared.
- PKG_UTIL.session_search_context
Searches for an attribute value.
The prototype of the PKG_UTIL.session_clear_context function is as follows:
1 2 3 4 5
PKG_UTIL.session_clear_context( namespace text, attribute text ) RETURN INTEGER
Table 45 PKG_UTIL.session_clear_context API parameters Parameter
Description
namespace
Namespace of an attribute.
attribute
Attribute value to be cleared.
- PKG_UTIL.session_set_context
The prototype of the PKG_UTIL.session_set_context function is as follows:
1 2 3 4 5 6
PKG_UTIL.session_set_context( namespace text, attribute text, value text ) RETURN INTEGER
Table 46 PKG_UTIL.session_set_context API parameters Parameter
Description
namespace
Namespace of an attribute.
attribute
Attribute to be set.
value
Attribute value.
- PKG_UTIL.utility_get_time
This function prints the Unix timestamp.
The prototype of the PKG_UTIL.utility_get_time function is as follows:
1 2
PKG_UTIL.utility_get_time() RETURN bigint
- PKG_UTIL.utility_format_error_backtrace
Displays the error stack of a stored procedure.
The prototype of the PKG_UTIL.utility_format_error_backtrace function is as follows:
1 2
PKG_UTIL.utility_format_error_backtrace() RETURN text
- PKG_UTIL.utility_format_error_stack
Displays the error information about a stored procedure.
The prototype of the PKG_UTIL.utility_format_error_stack function is as follows:
1 2
PKG_UTIL.utility_format_error_stack() RETURN text
- PKG_UTIL.utility_format_call_stack
Displays the call stack of a stored procedure.
The prototype of the PKG_UTIL.utility_format_call_stack function is as follows:
1 2
PKG_UTIL.utility_format_call_stack() RETURN text
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot