Oracle DM_QGEN
Version 18.3

General Information
Library Note Morgan's Library Page Header
For how many years have you been working with physical servers that are starving your database of the memory necessary to deploy important new performance features such as the Result Cache, Memoptimize Pool, In-Memory Aggregation, In-Memory Column Store, and Full Database Caching? Too long? Contact me to learn how to improve all queries ... not just some queries.
Purpose Undocumented support for Data Mining
AUTHID CURRENT_USER
Dependencies
DBMS_ASSERT DBMS_DM_UTIL DM$RQMOD_DETAILIMPL
DBMS_DATA_MINING DBMS_PREDICTIVE_ANALYTICS DMP_SEC
DBMS_DATA_MINING_TRANSFORM DBMS_STANDARD DMP_SYS
DBMS_DM_MODEL_EXP DBMS_UTILITY ODM_UTIL
Documented No
First Available Not known
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/prvtdmmi.plb
Subprograms
 
CLOB_LITERAL
Enapsulates a string in single quotes and prepends the literal "to_clob(null)||" dm_qgen.clob_literal(p_val IN VARCHAR2) RETURN VARCHAR2;
DECLARE
 pVC VARCHAR2(4000) := 'this is a test string';
 rVC VARCHAR2(4000);
BEGIN
  rVC := dm_qgen.clob_literal(pVC);
  dbms_output.put_line(rVC);
END;
/
to_clob(null)||'this is a test string'

PL/SQL procedure successfully completed.
 
EXT_QUOTE
Seems to act as a NO-OP. Appears to make no changes to any string submitted dm_qgen.ext_quote(p_val IN VARCHAR2) RETURN VARCHAR2;
DECLARE
 retVal VARCHAR2(240);
BEGIN
  retVal := dm_qgen.ext_quote('"TE ST''');
  dbms_output.put_line(retVal);
END;
/
 
SQLN2BND
Upper cases the string and returns it unchanged if the string passes internal tests of which one is that the string does not contain spaces dm_qgen.sqln2bnd(p_val IN VARCHAR2) RETURN VARCHAR2;
DECLARE
 retVal VARCHAR2(240);
BEGIN
  retVal := dm_qgen.sqln2bnd('TExST');
  dbms_output.put_line(retVal);
END;
/
 
SQLN2LIT
Returns the string enclosed in single quotes dm_qgen.sqln2lit(p_val IN VARCHAR2) RETURN VARCHAR2;
DECLARE
 retVal VARCHAR2(240);
BEGIN
  retVal := dm_qgen.sqln2lit('TEST');
  dbms_output.put_line(retVal);
END;
/
 
SQLN2QSQL
Appends dot sname to the value and encloses the combination in double quotes. Identical to DBMS_ASSERT.ENQUOTE_LITERAL. dm_qgen.sqln2lit(
p_val   IN VARCHAR2,
p_sname IN VARCHAR2)
RETURN VARCHAR2;
SQL> DECLARE
  2   retVal VARCHAR2(240);
  3  BEGIN
  4    retVal := dm_qgen.sqln2qsql('TEST', USER);
  5    dbms_output.put_line(retVal);
  6  END;
  7  /
"TEST"."SYS"
 
SQLN2SQL
Returns a string enclosed in double quotes. Identical to DBMS_ASSERT.ENQUOTE_NAME. dm_qgen.sqln2sql(p_val IN VARCHAR2) RETURN VARCHAR2;
DECLARE
 retVal VARCHAR2(240);
BEGIN
  retVal := dm_qgen.sqln2sql('TEST');
  dbms_output.put_line(retVal);
END;
/
 
TO_LITERAL
Undocumented

Overload 1
dm_qgen.to_literal(
p_val        IN NUMBER,
p_paren_flag IN BOOLEAN)
RETURN VARCHAR2;
DECLARE
 bf     BOOLEAN := FALSE;
 bt     BOOLEAN := TRUE;
 retVal VARCHAR2(30);
BEGIN
  retVal := dm_qgen.to_literal(-1, bf);
  dbms_output.put_line(retVal);

  retVal := dm_qgen.to_literal(-1, bt);
  dbms_output.put_line(retVal);
END;
/
Overload 2 dm_qgen.to_literal(
p_val        IN BINARY_DOUBLE,
p_paren_flag IN BOOLEAN)
RETURN VARCHAR2;
DECLARE
 bf     BOOLEAN := FALSE;
 bt     BOOLEAN := TRUE;
 retVal VARCHAR2(30);
BEGIN
  retVal := dm_qgen.to_literal(-1, bf);
  dbms_output.put_line(retVal);

  retVal := dm_qgen.to_literal(-1, bt);
  dbms_output.put_line(retVal);
END;
/
Overload 3 dm_qgen.to_literal(
p_val        IN BINARY_FLOAT,
p_paren_flag IN BOOLEAN)
RETURN VARCHAR2;
DECLARE
 bf     BOOLEAN := FALSE;
 bt     BOOLEAN := TRUE;
 retVal VARCHAR2(30);
BEGIN
  retVal := dm_qgen.to_literal(-1, bf);
  dbms_output.put_line(retVal);

  retVal := dm_qgen.to_literal(-1, bt);
  dbms_output.put_line(retVal);
END;
/
Overload 4 dm_qgen.to_literal(p_val IN VARCHAR2) RETURN VARCHAR2;
DECLARE
 retVal VARCHAR2(30);
BEGIN
  retVal := dm_qgen.to_literal('This is essentially a NOOP');
  dbms_output.put_line(retVal);
END;
/

Related Topics
Built-in Functions
Built-in Packages
DBMS_ASSERT
DBMS_PREDICTIVE_ANALYTICS
What's New In 18cR3
What's New In 19cR3

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