436 constructor(AbstractDatasource ds, *
string savepoint =
'x' + get_random_string(29))
484 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm,
485 bool is_char = False,
bool cu = False, softint bs, *
int scale)
554 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm, softint bs,
593 constructor(
string n, Columns c, ForeignConstraintTarget t,
bool e) ;
596 string getCreateSql(
string table_name, *hash opt);
599 softlist getRenameSql(
string table_name,
string new_name);
618 constructor(
string n,
string n_src,
bool e = True) ;
621 string getCreateSql(
string table_name, *hash opt);
624 softlist getRenameSql(
string table_name,
string new_name);
649 constructor(
string n, hash n_cols,
bool e = True, *
string ts) ;
672 bool setIndexBase(
string ix);
679 string getCreateSql(
string table_name, *hash opts);
682 softlist getRenameSql(
string table_name,
string new_name);
715 constructor(
string n, *hash c, *
string ts) ;
738 bool setIndexBase(
string ix);
745 string getCreateSql(
string table_name, *hash opts);
748 softlist getRenameSql(
string table_name,
string new_name);
771 constructor(
string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end)
806 constructor(
string n_name,
string n_src, *
string n_schema, *
string n_type_text,
807 *
string n_oid_text, *
string n_view_type_owner,
808 *
string n_view_type, *
string n_superview_name,
809 bool n_updatable,
bool n_container_data)
833 constructor(
string n,
string n_src,
bool en = True) ;
836 softlist getCreateSql(
string table_name, *hash opt);
985 constructor(
string n,
string n_src,
bool n_logging = True,
bool n_use_index = True, *
string n_tablespace) ;
992 bool equalImpl(AbstractFunctionBase t);
1056 list<string> featuresImpl();
1061 OracleSequence makeSequenceImpl(
string name, number start = 1, number increment = 1, *softnumber end, *hash
opts);
1066 getSchemaName(reference<string> name, reference<string> schema);
1071 *AbstractSequence getSequenceImpl(
string name);
1076 *AbstractView getViewImpl(
string name);
1106 OracleMaterializedView makeMaterializedView(
string name,
string src,
bool logging = True,
bool use_index = True, *
string tablespace, *hash
opts);
1116 list<auto> getDropSchemaSqlImpl(hash<auto> schema_hash, *hash<auto> opt);
1121 list getAlignSqlImpl(hash schema_hash, *hash opt);
1148 *
string getSource(
string type,
string name);
1153 checkSource(
string type,
string name, reference<string> src);
1190 list<string> listTablesImpl();
1195 list<string> listFunctionsImpl();
1200 list<string> listProceduresImpl();
1205 list<string> listSequencesImpl();
1210 list<string> listViewsImpl();
1215 list<string> getListIntern(
string type);
1220 list<string> getListIntern(list<auto>
l);
1225 string getCreateSqlImpl(list
l);
1229 static string getCreateSql(list
l);
1360 oracleErrorCallback(
int ac,
string type,
string name, *
string table, *
string new_name, *
string info,
string sql, hash<ExceptionInfo> ex);
1373 "number": (
"qore": Type::Number,
"size": SZ_NUM,
"size_range": (1, 38),
"scale_range": (-84, 127)),
1375 "qore": Type::String,
1377 "size_range": (1, 4000),
1379 "default_size": AbstractColumn::DefaultVarcharSize,
1382 "qore": Type::String,
1384 "size_range": (1, 4000),
1386 "default_size": AbstractColumn::DefaultVarcharSize,
1388 "date": (
"qore": Type::Date,),
1389 "timestamp": (
"qore": Type::Date,
"size": SZ_OPT,
"size_range": (0, 9)),
1390 "timestamp with time zone": (
"qore": Type::Date,
"size": SZ_OPT,
"size_range": (0, 9)),
1391 "timestamp with local time zone": (
"qore": Type::Date,
"size": SZ_OPT,
"size_range": (0, 9)),
1392 "interval year to month": (
"qore": Type::Date,),
1393 "interval day to second": (
"qore": Type::Date,),
1394 "timestamp(0)": (
"qore": Type::Date,),
1395 "timestamp(1)": (
"qore": Type::Date,),
1396 "timestamp(2)": (
"qore": Type::Date,),
1397 "timestamp(3)": (
"qore": Type::Date,),
1398 "timestamp(4)": (
"qore": Type::Date,),
1399 "timestamp(5)": (
"qore": Type::Date,),
1400 "timestamp(6)": (
"qore": Type::Date,),
1401 "timestamp(7)": (
"qore": Type::Date,),
1402 "timestamp(8)": (
"qore": Type::Date,),
1403 "timestamp(9)": (
"qore": Type::Date,),
1404 "timestamp(0) with time zone": (
"qore": Type::Date,),
1405 "timestamp(1) with time zone": (
"qore": Type::Date,),
1406 "timestamp(2) with time zone": (
"qore": Type::Date,),
1407 "timestamp(3) with time zone": (
"qore": Type::Date,),
1408 "timestamp(4) with time zone": (
"qore": Type::Date,),
1409 "timestamp(5) with time zone": (
"qore": Type::Date,),
1410 "timestamp(6) with time zone": (
"qore": Type::Date,),
1411 "timestamp(7) with time zone": (
"qore": Type::Date,),
1412 "timestamp(8) with time zone": (
"qore": Type::Date,),
1413 "timestamp(9) with time zone": (
"qore": Type::Date,),
1414 "timestamp(0) with local time zone": (
"qore": Type::Date,),
1415 "timestamp(1) with local time zone": (
"qore": Type::Date,),
1416 "timestamp(2) with local time zone": (
"qore": Type::Date,),
1417 "timestamp(3) with local time zone": (
"qore": Type::Date,),
1418 "timestamp(4) with local time zone": (
"qore": Type::Date,),
1419 "timestamp(5) with local time zone": (
"qore": Type::Date,),
1420 "timestamp(6) with local time zone": (
"qore": Type::Date,),
1421 "timestamp(7) with local time zone": (
"qore": Type::Date,),
1422 "timestamp(8) with local time zone": (
"qore": Type::Date,),
1423 "timestamp(9) with local time zone": (
"qore": Type::Date,),
1424 "interval year(0) to month": (
"qore": Type::Date,),
1425 "interval year(1) to month": (
"qore": Type::Date,),
1426 "interval year(2) to month": (
"qore": Type::Date,),
1427 "interval year(3) to month": (
"qore": Type::Date,),
1428 "interval year(4) to month": (
"qore": Type::Date,),
1429 "interval year(5) to month": (
"qore": Type::Date,),
1430 "interval year(6) to month": (
"qore": Type::Date,),
1431 "interval year(7) to month": (
"qore": Type::Date,),
1432 "interval year(8) to month": (
"qore": Type::Date,),
1433 "interval year(9) to month": (
"qore": Type::Date,),
1434 "interval day(0) to second(0)": (
"qore": Type::Date,),
1435 "interval day(0) to second(1)": (
"qore": Type::Date,),
1436 "interval day(0) to second(2)": (
"qore": Type::Date,),
1437 "interval day(0) to second(3)": (
"qore": Type::Date,),
1438 "interval day(0) to second(4)": (
"qore": Type::Date,),
1439 "interval day(0) to second(5)": (
"qore": Type::Date,),
1440 "interval day(0) to second(6)": (
"qore": Type::Date,),
1441 "interval day(0) to second(7)": (
"qore": Type::Date,),
1442 "interval day(0) to second(8)": (
"qore": Type::Date,),
1443 "interval day(0) to second(9)": (
"qore": Type::Date,),
1444 "interval day(1) to second(0)": (
"qore": Type::Date,),
1445 "interval day(1) to second(1)": (
"qore": Type::Date,),
1446 "interval day(1) to second(2)": (
"qore": Type::Date,),
1447 "interval day(1) to second(3)": (
"qore": Type::Date,),
1448 "interval day(1) to second(4)": (
"qore": Type::Date,),
1449 "interval day(1) to second(5)": (
"qore": Type::Date,),
1450 "interval day(1) to second(6)": (
"qore": Type::Date,),
1451 "interval day(1) to second(7)": (
"qore": Type::Date,),
1452 "interval day(1) to second(8)": (
"qore": Type::Date,),
1453 "interval day(1) to second(9)": (
"qore": Type::Date,),
1454 "interval day(2) to second(0)": (
"qore": Type::Date,),
1455 "interval day(2) to second(1)": (
"qore": Type::Date,),
1456 "interval day(2) to second(2)": (
"qore": Type::Date,),
1457 "interval day(2) to second(3)": (
"qore": Type::Date,),
1458 "interval day(2) to second(4)": (
"qore": Type::Date,),
1459 "interval day(2) to second(5)": (
"qore": Type::Date,),
1460 "interval day(2) to second(6)": (
"qore": Type::Date,),
1461 "interval day(2) to second(7)": (
"qore": Type::Date,),
1462 "interval day(2) to second(8)": (
"qore": Type::Date,),
1463 "interval day(2) to second(9)": (
"qore": Type::Date,),
1464 "clob": (
"qore": Type::String,),
1465 "blob": (
"qore": Type::Binary,),
1466 "long": (
"qore": Type::Binary,),
1467 "raw": (
"qore": Type::Binary,
"size": SZ_MAND,
"size_range": (1, 2000)),
1468 "bfile": (
"qore": Type::Binary,),
1469 "binary_float": (
"qore": Type::Float,),
1470 "binary_double": (
"qore": Type::Float,),
1471 "rowid": (
"qore": Type::String,),
1472 "urowid": (
"qore": Type::String,
"size": SZ_OPT,
"size_range": (1, 4000)),
1477 "integer":
"number",
1480 "string":
"varchar2",
1481 "date":
"timestamp(6)",
1488 const OraColumnOpts = {
1489 "character_semantics": Type::Boolean,
1509 "compute_statistics": Type::Boolean,
1517 "index": Type::String,
1532 "partition": Type::String,
1537 OP_SUBSTR: DefaultExpressionMap{OP_SUBSTR} + {
1538 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1539 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1540 AbstractDataProviderTypeMap.
"string");
1541 string exp1 = info.table.getExpressionArg(\info, role, args[1],
1542 AbstractDataProviderTypeMap.
"int");
1543 if (!exists args[2]) {
1544 return sprintf(
"substr(%s,%s)", exp0, exp1);
1546 return sprintf(
"substr(%s,%s,%s)", exp0, exp1,
1547 info.table.getExpressionArg(\info, role, args[2], AbstractDataProviderTypeMap.
"int"));
1551 "exp": <DataProviderExpressionInfo>{
1552 "type": DET_Operator,
1555 "desc":
"cast operator",
1558 DataProviderSignatureAnyType,
1559 DataProviderSignatureStringValueType,
1560 DataProviderSignatureOptionalIntValueType,
1561 DataProviderSignatureOptionalIntValueType,
1563 "return_type": AbstractDataProviderTypeMap.
"any",
1565 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1566 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1567 AbstractDataProviderTypeMap.
"any");
1570 string sql = sprintf (
"cast (%s as %s", exp0,
name);
1571 if (desc.size == SZ_MAND) {
1572 if (!exists args[1] && !exists desc.size_range)
1573 throw "OPERATOR-ERROR", sprintf (
"cast operator missing size for type %s",
1575 sql += sprintf(
"(%d)", args[1] ?? desc.size_range[1]);
1576 }
else if (desc.size == SZ_NUM && exists args[1]) {
1577 sql += sprintf(
"(%d", args[1]);
1578 sql += exists args[2] ? sprintf(
",%d)", args[2]) :
")";
1579 }
else if (desc.size == SZ_OPT && exists args[1]) {
1580 sql += sprintf(
"(%d)", args[1]);
1587 "exp": <DataProviderExpressionInfo>{
1588 "type": DET_Operator,
1591 "desc":
"returns the year component of a date as a string (ex: `2022`)",
1594 DataProviderSignatureDateType,
1596 "return_type": AbstractDataProviderTypeMap.
"string",
1598 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1599 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1600 AbstractDataProviderTypeMap.
"date");
1601 return sprintf(
"to_char(%s, 'YYYY')", exp0);
1605 "exp": <DataProviderExpressionInfo>{
1606 "type": DET_Operator,
1607 "label": COP_YEAR_MONTH,
1608 "name": COP_YEAR_MONTH,
1609 "desc":
"returns the year and month components of a date as a string (ex: `2022-06`)",
1610 "symbol": COP_YEAR_MONTH,
1612 DataProviderSignatureDateType,
1614 "return_type": AbstractDataProviderTypeMap.
"string",
1616 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1617 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1618 AbstractDataProviderTypeMap.
"date");
1619 return sprintf(
"to_char(%s, 'YYYY-MM')", exp0);
1623 "exp": <DataProviderExpressionInfo>{
1624 "type": DET_Operator,
1625 "label": COP_YEAR_DAY,
1626 "name": COP_YEAR_DAY,
1627 "desc":
"returns the year, month, and day components of a date as a string (ex: `2022-06-29`)",
1628 "symbol": COP_YEAR_DAY,
1630 DataProviderSignatureDateType,
1632 "return_type": AbstractDataProviderTypeMap.
"string",
1634 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1635 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1636 AbstractDataProviderTypeMap.
"date");
1637 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", exp0);
1641 "exp": <DataProviderExpressionInfo>{
1642 "type": DET_Operator,
1643 "label": COP_YEAR_HOUR,
1644 "name": COP_YEAR_HOUR,
1645 "desc":
"returns the year, month, day, and hour components of a date as a string "
1646 "(ex: `2022-06-29 15`)",
1647 "symbol": COP_YEAR_HOUR,
1649 DataProviderSignatureDateType,
1651 "return_type": AbstractDataProviderTypeMap.
"string",
1653 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1654 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1655 AbstractDataProviderTypeMap.
"date");
1656 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", exp0);
1660 "exp": <DataProviderExpressionInfo>{
1661 "type": DET_Operator,
1662 "label": COP_TRUNC_DATE,
1663 "name": COP_TRUNC_DATE,
1664 "desc":
"truncates the given date to the given resolution; args: date, string code: Y: year, "
1665 "M: month, D: day, H: hour, m: minute, S: second",
1666 "symbol": COP_TRUNC_DATE,
1668 DataProviderSignatureDateType,
1669 DataProviderSignatureStringValueType,
1671 "return_type": AbstractDataProviderTypeMap.
"date",
1673 "code":
string sub(reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1676 throw "TRUNC-DATE-ERROR", sprintf(
"unknown date truncation format argument %y; "
1677 "supported date format arguments: %y", args[1], keys
OracleTruncDate);
1679 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1680 AbstractDataProviderTypeMap.
"date");
1682 return sprintf(
"trunc(%s, %s)", exp0, str);
1685 return sprintf(
"cast (%s as date)", exp0);
1689 "exp": <DataProviderExpressionInfo>{
1690 "type": DET_Operator,
1693 "desc":
"returns True if the first value is in the list of following values",
1696 DataProviderSignatureAnyType,
1697 DataProviderSignatureAnyType,
1700 "return_type": AbstractDataProviderTypeMap.
"bool",
1702 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1704 auto val = shift args;
1705 # Qorus bug #989 SqlUtil: oracle op_in can fail in large amount of input elements
1706 # There is no support for CLOBs in WHERE clause in Oracle at all.
1707 # Binding large strings (over 4000 chars is performed by a CLOB in Qore driver.
1708 # Result of op_in operator can be "ORA-00932: inconsistent datatypes" if is
1709 # the list longer or if it contains large items with:
1710 # return cn + " in (select regexp_substr(%v,'[^,]+', 1, level) from dual connect by
1711 # regexp_substr(%v, '[^,]+', 1, level) is not null)";
1713 # determine list members type. Let's assume the 1st non NULL/NOTHING
1714 # element gives the type code for all elements.
1715 ListIterator it(args);
1716 # get list type code
1719 switch (it.getValue().typeCode()) {
1728 ltype = it.getValue().typeCode();
1731 throw "ORACLE-IN-OPERATOR-ERROR", sprintf(
"the \"in\" operator unexpected list "
1732 "element type: %s; only simple types are supported", it.getValue().type());
1739 # Split long array to chunks of no more than 32767 elements due to Oracle limitation
1740 # "ORA-22165: OCI-22165: given index [32767] must be in the range of [0] to [32766]"
1744 list<auto> chunk = extract args, 0, 32767;
1746 # Bind to Oracle by expected type
1749 info.args += bindOracleCollection(
"SYS.ODCIDATELIST", chunk);
1754 info.args += bindOracleCollection(
"SYS.ODCINUMBERLIST", chunk);
1757 info.args += bindOracleCollection(
"SYS.ODCIVARCHAR2LIST", chunk);
1762 string exp0 = info.table.getExpressionArg(\info, role, val,
1763 AbstractDataProviderTypeMap.
"date");
1764 return exp0 +
" in (" + (map
"select column_value from table(%v)",
1765 xrange(count)).join(
" union all ") +
")";
1770 throw "MISSING-ORACLE-DRIVER",
"requires the oracle driver";
1775 "exp": <DataProviderExpressionInfo>{
1776 "type": DET_Operator,
1779 "desc":
"returns the next value in the given sequence; args: sequence name",
1782 DataProviderSignatureStringValueType,
1784 "return_type": AbstractDataProviderTypeMap.
"int",
1786 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1787 return sprintf(
"%s.nextval", args[0]);
1791 "exp": <DataProviderExpressionInfo>{
1792 "type": DET_Operator,
1793 "label": COP_SEQ_CURRVAL,
1794 "name": COP_SEQ_CURRVAL,
1795 "desc":
"returns the current value in the given sequence; args: sequence name",
1796 "symbol": COP_SEQ_CURRVAL,
1798 DataProviderSignatureStringValueType,
1800 "return_type": AbstractDataProviderTypeMap.
"int",
1802 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1803 return sprintf(
"%s.currval", args[0]);
1833 "object_value": True,
1857 bool m_isView = False;
1862 hash<string, string> m_sys_views = {
1863 "dba_col_comments" :
"all_col_comments",
1864 "dba_cons_columns" :
"all_cons_columns",
1865 "dba_constraints" :
"all_constraints",
1866 "dba_db_links" :
"all_db_links",
1867 "dba_ind_columns" :
"all_ind_columns",
1868 "dba_ind_expressions" :
"all_ind_expressions",
1869 "dba_indexes" :
"all_indexes",
1870 "dba_objects" :
"all_objects",
1871 "dba_sequences" :
"all_sequences",
1872 "dba_synonyms" :
"all_synonyms",
1873 "dba_tab_columns" :
"all_tab_columns",
1874 "dba_tab_comments" :
"all_tab_comments",
1875 "dba_tables" :
"all_tables",
1876 "dba_triggers" :
"all_triggers",
1877 "dba_views" :
"all_views",
1886 introspectSystemViews();
1893 string systemView(
string name);
1898 bool checkExistenceImpl();
1903 setTableInfoIntern();
1916 hash<auto> setSchemaTable();
1929 *hash resolveSynonym(
string s_owner,
string s_name);
1934 hash<auto> setTable();
1939 string getUserSchema();
1944 string getDBString();
1964 hash<auto> getColumnOptions();
1969 hash<auto> getColumnDescOptions();
1988 insertLimitOptimizerHint(hash<auto> qh, reference<string> sql);
1992 private doSelectOrderByWithOffsetSqlUnlockedImpl(reference<hash<QueryInfo>> info, reference<string> sql,
1995 softint limit = info.query_hash.limit ?? 0;
1996 softint offset = info.query_hash.offset ?? 0;
2000 list<auto> ce = getOrderByListUnlocked(info, coll);
2001 string sort = foldl $1 +
", " + $2, ce;
2008 sql = sprintf(
"select * from (select /*+ first_rows(%d) */ a.*, rownum rnum from (%s order by %s%s) a "
2009 "where rownum <= %v%s) where rnum > %v", limit, sql, sort, info.query_hash.desc ?
" desc" :
"");
2013 info.args += offset;
2023 Columns describeImpl();
2033 Indexes getIndexesImpl();
2038 ForeignConstraints getForeignConstraintsImpl(*hash
opts);
2043 Constraints getConstraintsImpl();
2048 string getSelectSqlName(*hash qh);
2053 Triggers getTriggersImpl();
2057 string getCreateTableSqlImpl(*hash opt);
2069 *list getCreateMiscSqlImpl(*hash opt,
bool cache);
2074 string getCreateSqlImpl(list
l);
2079 string getRenameSqlImpl(
string new_name);
2084 AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable = True);
2089 AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
2094 AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
2099 AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash ch,
string table, hash tch, *hash opt);
2104 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
2109 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
2114 AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
2119 bool tryInsertImpl(
string sql, hash<auto> row);
2132 *list getAlignSqlImpl(AbstractTable t, *hash opt);
2137 hash<auto> getQoreTypeMapImpl();
2142 hash<auto> getTypeMapImpl();
2147 hash<auto> getIndexOptions();
2152 hash<auto> getConstraintOptions();
2157 hash<auto> getTableCreationOptions();
2162 hash<auto> getAlignTableOptions();
2248 *hash doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
2258 setupTableImpl(hash<auto> desc, *hash<auto> opt);
represents an Oracle check constraint
Definition: OracleSqlUtilBase.qm.dox.h:612
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtilBase.qm.dox.h:616
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
the base class for Oracle code objects
Definition: OracleSqlUtilBase.qm.dox.h:853
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the object in the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
softlist getCreateSql(*hash opt)
returns a string that can be used to create the object in the database
the base class for Oracle code objects that cannot be renamed in place
Definition: OracleSqlUtilBase.qm.dox.h:884
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the object in the database
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
represents an Oracle column
Definition: OracleSqlUtilBase.qm.dox.h:470
list< string > getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt)
returns a list of sql strings that can be used to modify the column to the new definition
list< string > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
string getNativeTypeString()
returns the string describing the native type that can be used in SQL
string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
int byte_size
byte size of the column
Definition: OracleSqlUtilBase.qm.dox.h:476
constructor()
empty constructor for subclasses
bool char_used
the column uses character semantics
Definition: OracleSqlUtilBase.qm.dox.h:474
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
the Oracle specialization for SqlUtil::AbstractDatabase
Definition: OracleSqlUtilBase.qm.dox.h:997
int getPhysicalSizeImpl()
SqlUtil::AbstractDatabase::getPhysicalSize()
ListIterator packageIterator()
returns an iterator listing the string package names in the database
const OracleMaterializedViewDescriptionOptions
oracle-specific materialized view description options
Definition: OracleSqlUtilBase.qm.dox.h:1025
softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
const OracleReservedWords
hash of reserved words
Definition: OracleSqlUtilBase.qm.dox.h:1029
bool rebuildIndexImpl(string name, *hash options)
rebuild index implementation. See SqlUtil::AbstractDatabase::rebuildIndex()
list< string > listSynonyms()
returns a list of string synonym names in the database
int getMaximumPrecision()
Returns the maximum precision for numeric or decimal columns.
bool supportsPackagesImpl()
returns True if the database supports packages
*OraclePackage getPackage(string name)
returns an OraclePackage object for the package name given or NOTHING if the object does not exist or...
ListIterator synonymIterator()
returns an iterator listing the string synonym names in the database
*OracleType getType(string name)
returns an OracleType object for the package name given or NOTHING if the object does not exist or is...
list< string > listMaterializedViews()
returns a list of string materialized view names in the database
bool supportsSequencesImpl()
returns True if the database supports sequences
const OracleAlignSchemaOptions
oracle-specific schema description / alignment options
Definition: OracleSqlUtilBase.qm.dox.h:1005
bool rebuildIndexAnalyze(string name, int maxh, int maxleaf)
analyze index with ALTER INDEX ANAYZE. Then it checks INDEX_STATS for advices to rebuild.
reclaimSpaceImpl(*hash options)
reclaim space implementation. See SqlUtil::AbstractDatabase::reclaimSpace()
list< string > listTypes()
returns a list of string type names in the database
const OracleSchemaDescriptionOptions
oracle-specific schema description keys
Definition: OracleSqlUtilBase.qm.dox.h:1017
hash< auto > getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
const OracleComputeStatisticsOptions
Options for computeStatistics()
Definition: OracleSqlUtilBase.qm.dox.h:1037
hash< auto > getRebuildIndexOptions()
returns driver-specific options to the base abstract class
computeStatisticsImpl(*hash options)
compute statistics implementation. See SqlUtil::AbstractDatabase::computeStatistics()
constructor(AbstractDatasource nds, *hash opts)
creates the object from the arguments given
const OracleMaxPrecision
MAximum precision for Oracle NUMBER columns.
Definition: OracleSqlUtilBase.qm.dox.h:1041
hash< auto > getCreationOptions()
returns driver-specific options to the base abstract class
bool supportsTypesImpl()
returns True if the database supports named types
ListIterator materializedViewIterator()
returns an iterator listing the string materialized view names in the database
const OraclePackageDescriptionOptions
oracle-specific package description options
Definition: OracleSqlUtilBase.qm.dox.h:1021
*OracleMaterializedView getMaterializedView(string name)
returns an OracleMaterializedView object for the package name given or NOTHING if the object does not...
hash< auto > getAlignSchemaOptions()
returns driver-specific options to the base abstract class
bool rebuildIndexAnalyze(AbstractIndex index, int maxh, int maxleaf)
analyze index with ALTER INDEX ANAYZE. Then it checks INDEX_STATS for advices to rebuild.
const OracleCreationOptions
oracle-specific generic creation options
Definition: OracleSqlUtilBase.qm.dox.h:1001
ListIterator typeIterator()
returns an iterator listing the string type names in the database
softint getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
hash< auto > getComputeStatisticsOptions()
returns driver-specific options to the base abstract class
const OracleRebuildIndexOptions
Options for rebuildIndex()
Definition: OracleSqlUtilBase.qm.dox.h:1033
computeStatisticsTablesImpl(*hash options)
compute statistics for table(s) - a helper method
computeStatisticsSchemaImpl(*hash options)
compute statistics for schema - a helper method
list< string > listPackages()
returns a list of string package names in the database
represents an Oracle foreign constraint
Definition: OracleSqlUtilBase.qm.dox.h:587
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtilBase.qm.dox.h:591
represents an Oracle function
Definition: OracleSqlUtilBase.qm.dox.h:920
constructor(string n, string n_src)
creates the object from the arguments passed
represents an Oracle index
Definition: OracleSqlUtilBase.qm.dox.h:560
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
string native_type
the native type of the index (if supported)
Definition: OracleSqlUtilBase.qm.dox.h:564
constructor(string n, bool u, hash c, string nt, *string t)
creates the object from the arguments
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
*string tablespace
the tablespace name of the index (if supported)
Definition: OracleSqlUtilBase.qm.dox.h:567
represents an Oracle materialized view
Definition: OracleSqlUtilBase.qm.dox.h:968
*string tablespace
Name of the potential tablespace.
Definition: OracleSqlUtilBase.qm.dox.h:976
bool use_index
Flag if is index used.
Definition: OracleSqlUtilBase.qm.dox.h:974
bool logging
Flag if is loggign mode used.
Definition: OracleSqlUtilBase.qm.dox.h:972
constructor(string n, string n_src, bool n_logging=True, bool n_use_index=True, *string n_tablespace)
creates the object from the arguments passed
softlist getCreateSql(*hash opt)
returns a string that can be used to create the object in the database
represents an Oracle number column
Definition: OracleSqlUtilBase.qm.dox.h:551
the data type for Oracle NUMBER columns
Definition: OracleSqlUtilBase.qm.dox.h:460
constructor(string native_type, bool nullable, *hash< auto > options)
creates the object
represents an Oracle package
Definition: OracleSqlUtilBase.qm.dox.h:944
*string body_src
package body source
Definition: OracleSqlUtilBase.qm.dox.h:948
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
constructor(string n, string n_src, *string n_body_src)
creates the object from the arguments passed
list getCreateSql(*hash opt)
returns a string that can be used to create the package in the database
represents an Oracle primary key
Definition: OracleSqlUtilBase.qm.dox.h:703
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
*string tablespace
any tablespace for the primary key index
Definition: OracleSqlUtilBase.qm.dox.h:708
OracleColumn memberGate(string k)
returns the OracleColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database
clearIndex()
clears any index base for the constraint
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
represents an Oracle procedure
Definition: OracleSqlUtilBase.qm.dox.h:932
constructor(string n, string n_src)
creates the object from the arguments passed
Oracle savepoint helper.
Definition: OracleSqlUtilBase.qm.dox.h:428
deleteSavepointImpl()
Deletes the savepoint.
createSavepointImpl()
Creates the savepoint.
rollbackImpl()
Rolls back to the savepoint.
constructor(AbstractDatasource ds, *string savepoint='x'+get_random_string(29))
Creates the object.
represents an Oracle sequence
Definition: OracleSqlUtilBase.qm.dox.h:767
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the sequence in the database
represents an Oracle table
Definition: OracleSqlUtilBase.qm.dox.h:1368
hash< auto > getSelectOptions()
override in subclasses to return driver-specific options
AbstractDataProviderType getNumericTypeImpl(string native_type, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
hash< auto > getColumnOperatorMapImpl()
returns the column operator map for this object
*string getComment()
returns any table comment or NOTHING if none is known
copyImpl(AbstractTable old)
db-specific copy actions
const OracleTruncDate
Map SqlUtil::cop_trunc_date() constants to Oracle internal masks.
Definition: OracleSqlUtilBase.qm.dox.h:1817
const OracleCopMap
column operator specializations for Oracle
Definition: OracleSqlUtilBase.qm.dox.h:1813
string getSchemaName()
returns the schema name
code getUpsertUpdateOnly(Columns cols, hash< auto > row, *hash opt)
high-performance "update only" upsert supporting bulk DML
*string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
const OracleSelectOptions
Oracle select options.
Definition: OracleSqlUtilBase.qm.dox.h:1531
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
const OracleIopMap
a hash of default value operator descriptions for Oracle
Definition: OracleSqlUtilBase.qm.dox.h:1821
const OracleConstraintOptions
Oracle-specific constraint options.
Definition: OracleSqlUtilBase.qm.dox.h:1516
AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
const OraTypeMap
maps oracle type names to type descriptions
Definition: OracleSqlUtilBase.qm.dox.h:1372
const OraColumnDescOptions
Oracle-specific column options.
Definition: OracleSqlUtilBase.qm.dox.h:1502
const OraclePseudoColumnHash
a hash of valid pseudocolumns
Definition: OracleSqlUtilBase.qm.dox.h:1829
const OracleOpMap
where operator specializations for Oracle
Definition: OracleSqlUtilBase.qm.dox.h:1809
string getSqlName()
returns the schema and table name in dot notation
*string getTablespaceName()
returns the data tablespace name for the table if any or NOTHING if none is known
bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
bool bindEmptyStringsAsNull()
returns True because Oracle treats empty strings like NULL on insert
hash< auto > getExpressionMap()
Returns the expression map for Oracle.
const OracleExpressionMap
Oracle Expression map.
Definition: OracleSqlUtilBase.qm.dox.h:1536
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash opt)
returns a closure for performing upserts; if the upsert_strategy argument is UpsertInsertFirst or Ups...
bool optimizedLimit(*hash< auto > qh)
Returns True if the current connection supports optimized limit option handling.
const OraColumnOptions
Oracle-specific column options.
Definition: OracleSqlUtilBase.qm.dox.h:1496
hash< auto > getInsertOperatorMap()
returns the insert operator map for this object
bool isView()
This method can change itself or disappear in the near future. Do not use it.
list getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
const OracleUopMap
a hash of default update operator definitions for Oracle
Definition: OracleSqlUtilBase.qm.dox.h:1825
doSelectLimitOnlyUnlockedImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements when there is a "limit" argument,...
code getUpsertInsertOnly(Columns cols, hash< auto > row, *hash opt)
high-performance "insert only" upsert supporting bulk DML
bool supportsTablespacesImpl()
returns True if the database support tablespaces
const OracleIndexOptions
Oracle-specific index options.
Definition: OracleSqlUtilBase.qm.dox.h:1508
bool hasArrayBind()
returns True because the oracle driver supports array binds / bulk DML operations
const OracleTableCreationOptions
Oracle table creation options.
Definition: OracleSqlUtilBase.qm.dox.h:1521
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
const QoreTypeMap
maps qore type names to an oracle type
Definition: OracleSqlUtilBase.qm.dox.h:1476
hash< auto > getWhereOperatorMap()
returns the "where" operator map for Oracle
string getBaseType()
returns the base type of the underlying object (either "table" or "view")
bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
code getBulkUpsertClosure(hash example_row, int upsert_strategy=AbstractTable::UpsertAuto, *hash opt)
Oracle always supports bulk merging.
represents an Oracle trigger
Definition: OracleSqlUtilBase.qm.dox.h:827
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
bool enabled
True if the trigger is enabled, False if not
Definition: OracleSqlUtilBase.qm.dox.h:831
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
represents an Oracle type
Definition: OracleSqlUtilBase.qm.dox.h:906
string getDropSql(*hash opt)
returns a string that can be used to drop the type from the database
represents an Oracle unique constraint
Definition: OracleSqlUtilBase.qm.dox.h:637
bool isEnabled()
returns True if the constraint is enabled, False if not
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database
clearIndex()
clears any index base for the constraint
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtilBase.qm.dox.h:642
*string getTablespace()
returns the tablespace name used for this constraint, if known
*string tablespace
any tablespace for the unique key index
Definition: OracleSqlUtilBase.qm.dox.h:645
OracleColumn memberGate(string k)
returns the OracleColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
represents an Oracle view
Definition: OracleSqlUtilBase.qm.dox.h:789
*string view_type_owner
Owner of the type of the view if the view is a typed view.
Definition: OracleSqlUtilBase.qm.dox.h:797
constructor(string n_name, string n_src, *string n_schema, *string n_type_text, *string n_oid_text, *string n_view_type_owner, *string n_view_type, *string n_superview_name, bool n_updatable, bool n_container_data)
creates the object from the arguments
*string type_text
Type clause of the typed view.
Definition: OracleSqlUtilBase.qm.dox.h:793
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
softlist getRenameSql(string new_name, *hash opt)
returns a string that can be used to rename the view in the database
*string oid_text
WITH OID clause of the typed view.
Definition: OracleSqlUtilBase.qm.dox.h:795
*string superview_name
Name of the superview.
Definition: OracleSqlUtilBase.qm.dox.h:801
*string view_type
Type of the view if the view is a typed view.
Definition: OracleSqlUtilBase.qm.dox.h:799
bool container_data
Indicates whether the view contains container-specific data.
Definition: OracleSqlUtilBase.qm.dox.h:803
cache(*hash< auto > opts)
the OracleSqlUtilBase namespace contains all the objects in the OracleSqlUtilBase module
Definition: OracleSqlUtilBase.qm.dox.h:418
OracleTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns an OracleTable object corresponding to the arguments
OracleDatabase get_database(AbstractDatasource nds, *hash opts)
returns an OracleDatabase object corresponding to the arguments