Oracle SQLJUTL
Version 21c

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
Purpose Utilities supporting SQLJ and JPublisher as well as generic data type conversion functions
AUTHID CURRENT_USER
Dependencies
ALL_ARGUMENTS TYPE$ URITYPE
DBMS_STANDARD    
Documented No
First Available Not known
Security Model Owned by SYS with EXECUTE granted to PUBLIC
Source {ORACLE_HOME}/rdbms/admin/initsqlj.sql
Subprograms
 
BOOL2INT
SQL to PL/SQL conversion from BOOLEAN to INTEGER sqljutl.bool2int(b IN BOOLEAN)
RETURN INTEGER;
DECLARE
 inVal1 BOOLEAN := FALSE;
 inVal2 BOOLEAN := TRUE;
BEGIN
  dbms_output.put_line(sqljutl.bool2int(inVal1));
  dbms_output.put_line(sqljutl.bool2int(inVal2));
END;
/
0
1
 
CHAR2IDS
SQL to PL/SQL conversion from CHAR to Interval Day Second sqljutl.char2ids(ch IN CHAR)
RETURN DSINTERVAL_UNCONSTRAINED;
TBD
 
CHAR2IYM
SQL to PL/SQL conversion from CHAR to Interval Year Month sqljutl.char2iym(ch IN CHAR)
RETURN YMINTERVAL_UNCONSTRAINED;
TBD
 
GET_TYPECODE
Required at translate-time for JPublisher sqljutl.get_typecode(
tid   IN  RAW,
code  OUT NUMBER,
class OUT VARCHAR2,
typ   OUT NUMBER);
TBD
 
HAS_DEFAULT
Required at translate-time for SQLJ sqljutl.has_default(
l_owner IN VARCHAR2,
proc    IN VARCHAR2,
seq     IN NUMBER,
ovr     IN VARCHAR2 DEFAULT NULL,
pkg_nm  IN VARCHAR2 DEFAULT NULL)
RETURN NUMBER;
TBD
 
IDS2CHAR
SQL to PL/SQL conversion from Interval Day Second to CHAR sqljutl.ids2char(iv IN DSINTERVAL_UNCONSTRAINED)
RETURN CHAR;
SQL> DECLARE
inVal DSINTERVAL_UNCONSTRAINED := NUMTODSINTERVAL(120, 'DAY');
retVal VARCHAR2(256);
BEGIN
retVal := sqljutl.ids2char(inVal);
END;
/
DECLARE
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.SQLJUTL", line 84
ORA-06512: at line 5
 
INT2BOOL
SQL to PL/SQL conversion from INTEGER to BOOLEAN sqljutl.int2bool(i IN INTEGER)
RETURN BOOLEAN;
BEGIN
  IF sqljutl.int2bool(0) THEN
    dbms_output.put_line('T');
  ELSE
    dbms_output.put_line('F');
  END IF;
END;
/
F
 
IYM2CHAR
SQL to PL/SQL conversion from Interval Year Month to CHAR sqljutl.iym2char(iv IN YMINTERVAL_UNCONSTRAINED) RETURN CHAR;
DECLARE
 duration INTERVAL YEAR TO MONTH;
BEGIN
  duration := (SYSDATE+865.765 - SYSDATE) YEAR TO MONTH;
  dbms_output.put_line(sqljutl.iym2char(duration));
END;
/
+02-04

PL/SQL procedure successfully completed.
 
URI2VCHAR
SQL to PL/SQL conversion from URITYPE to VARCHAR2 sqljutl.uri2vchar(uri IN SYS.URITYPE) RETURN VARCHAR2;
DECLARE
 uri_t URITYPE;
BEGIN
  SELECT urifactory.getURI('https://www.dbsecworx.com')
  INTO uri_t
  FROM dual;
  dbms_output.put_line(sqljutl.uri2vchar(uri_t));
END;
/
https://www.dbsecworx.com

PL/SQL procedure successfully completed.

Related Topics
Built-in Functions
Built-in Packages
What's New In 19c
What's New In 20c-21c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2019 Daniel A. Morgan All Rights Reserved
  DBSecWorx