Oracle DM_QGEN
Version 12.2.0.1

General Information
Library Note Morgan's Library Page Header
Coming to OpenWorld 2018? Be sure to visit the TidalScale booth in Moscone South and learn how to solve performance problems and lower costs with Software Defined Servers. Before you visit the booth, or if you can't make it this year, check out TidalScale at www.tidalscale.com. Be sure to click on the Solutions link and look through the Oracle resources.
Purpose Undocumented support for Data Mining
AUTHID CURRENT_USER
Dependencies
DBMS_ASSERT DBMS_PREDICTIVE_ANALYTICS DM_XFORM
DBMS_DATA_MINING DBMS_STANDARD DMP_SEC
DBMS_DATA_MINING_TRANSFORM DBMS_UTILITY DMP_SYS
DBMS_DM_MODEL_EXP DM$RQMOD_DETAILIMPL ODM_UTIL
DBMS_DM_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 (new 12.2)
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 (new 12.2)
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 (new 12.2)
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 (new 12.2)
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 (new 12.2)
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 12cR1
What's New In 12cR2

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-2017 Daniel A. Morgan All Rights Reserved