42 a.*, rownum rnum from (select * from schema.table where
type = %v order by
type) a where rownum <= %v) where rnum > %v
", ("user
", 300, 200)); 73 note that the following simpler SQL is generated for Oracle 12c+ servers: 75 $ds.vselectRows("select * from schema.table where
type = %v order by
type offset %v rows fetch next %v rows only
", ("user
", 200, 100)); 78 @subsection ora_in_operator IN Operator on Oracle 80 In order to avoid dynamic SQL and better manage the server's shared pool (in particular, the number of parsed statements), the %OracleSqlUtil 81 module uses bind by value with the SQL \c IN operator. 83 For example, the following query: 85 my *hash $q = $table.select(("where
": ("col1
": op_in(1, 2, 3, 4)))); 88 Results in the equivalent of the following SQL: 90 my *hash $q = $ds.select("select * from schema.table where col1 in (select column_value from table(%v))
", bindOracleCollection("SYS.ODCIVARCHAR2LIST
", (1,2,3,4))); 93 @htmlonly <style><!-- td.qore { background-color: #5b9409; color: white; } --></style> @endhtmlonly 96 <td class="qore
"><b>Qore Type</b></td> 97 <td class="qore
"><b>Oracle Collection</b></td> 101 <td>\c SYS.ODCIDATELIST</td> 105 <td>\c SYS.ODCINUMBERLIST</td> 109 <td>\c SYS.ODCINUMBERLIST</td> 113 <td>\c SYS.ODCINUMBERLIST</td> 117 <td>\c SYS.ODCIVARCHAR2LIST</td> 121 There universal collections are limited to 32767 elements. And \c SYS.ODCIVARCHAR2LIST element size is \c VARCHAR2(4000). 123 @subsection ora_partitioning_select Partition Support in Selects 125 It's possible to select from a particular partition of a table with %OracleSqlUtil; 126 @ref OracleSqlUtil::OracleTable::OracleSelectOptions "OracleSelectOptions
" defines the \c "partition
" key which can be added to a 127 @ref select_option_hash "select option
hash" to specify the partition to select from as in the following example: 129 my *list $rows = $table.selectRows(("created
": op_gt(2012-05-01), "partition
": "p1
")); 131 Which generates an SQL command like the following: 133 my *list $rows = $ds.vselectRows("select * from schema.table partition(p1) where created > %v
", (2012-05-01)); 136 @subsection ora_partitioning_join Partition Support in Joins 138 It's possible to perform a join on a particular partition of a table with %OracleSqlUtil; the join option \c "partition
" is 139 supported to specify the partition to join on as in the following example: 141 my *list $rows = $table.selectRows(("join": join_inner($table2, "t2
", ("id": "altid
"), NOTHING, ("partition
": "p2
")))); 143 Which generates an SQL command like the following: 145 my *list $rows = $ds.vselectRows("select * from schema.table inner
join schema.table2 partition(p2) t2 on (schema.table.id = t2.altid)
"); 148 @section ora_schema_management Schema Management on Oracle 150 Note that when getting an object description from an Oracle database, if the object cannot be found in the connection schema, then 151 if a synonym of the same type exists and the target object is accessible, then the target object is read automatically and the owning 152 schema name is also set to the actual owner of the object. 154 @subsection ora_type_mapping Type Mapping 156 Column types are mapped from %Qore types as follows: 158 <b>Oracle Column Type Mappings</b> 161 <td class="qore
"><b>Generic Type Name</b></td> 162 <td class="qore
"><b>Oracle Type Used</b></td> 182 <td>\c timestamp(6)</td> 189 <td>@ref SqlUtil::BLOB</td> 193 <td>@ref SqlUtil::CHAR</td> 197 <td>@ref SqlUtil::CLOB</td> 201 <td>@ref SqlUtil::NUMERIC</td> 205 <td>@ref SqlUtil::VARCHAR</td> 210 To use other types, use the \c "native_type
" @ref SqlUtil::AbstractTable::ColumnDescOptions "column description option
" with the 211 native Oracle type name instead (under the \c "driver
" and \c "oracle
" keys for schemas supporting multiple databases). 213 @subsection ora_other_objects Additional Object Types Supported 215 The following additional schema objects can be managed with %OracleSqlUtil: 216 - @ref ora_materialized_views "materialized views
" 217 - @ref ora_packages "packages
" 218 - @ref ora_types "types
" 220 @subsection ora_materialized_views Materialized Views 222 The @ref schema_desc_hash takes an optional key, \c "materialized_views
" that allows materialized views in Oracle schemas to be managed along with other objects. 224 The \c "materialized_views
" should be assigned to a hash, each key name is the name of the materialized view, and the values are hashes with the 226 - \c "logging
": (@ref bool_type "bool") if the materialized view should be logged 227 - \c "use_index
": (@ref bool_type "bool") if the materialized view should be indexed 228 - \c "src
": (@ref bool_type "bool") the source of the materialized view 230 The \c "materialized_views
" key can go in the top level of the @ref schema_desc_hash for Oracle-only schemas, or, for schemas targeting multiple database types, under the \c "driver
" and \c "oracle
" keys as in the following example: 236 "materialized_views
": ( 240 "src
": "select
type, count(1) total_count from table group by type",
248 @subsection ora_packages Packages
250 The @ref schema_desc_hash takes an optional key, \c "packages" that allows packages in Oracle schemas to be managed along with other objects.
252 The \c "packages" should be assigned to a
hash, each key name is the name of the package, and the values are hashes with the
254 - \c "src": (@ref bool_type "
bool") the source of the package
256 The \c "packages" key can go in the top level of the @ref schema_desc_hash for Oracle-only schemas, or, for schemas targeting multiple database types, under the \c "driver" and \c "oracle" keys as in the following example:
265 type cursorType is ref cursor; 266 MYSTATCOMPLETE constant order_status.orderstatus%type := 'C'; 267 MYSTATERROR constant order_status.orderstatus%type := 'E'; 276 @subsection ora_types Types
278 The @ref schema_desc_hash takes an optional key, \c
"types" that allows types in Oracle schemas to be managed along with other objects.
280 The \c
"types" should be assigned to a
hash, each key name is the name of the
type, and the values are strings giving the type definition.
282 The \c
"types" key can go in the top level of the @ref schema_desc_hash
for Oracle-only schemas, or,
for schemas targeting multiple database types, under the \c
"driver" and \c
"oracle" keys as in the following example:
289 "num_array":
"table of number",
290 "str_array":
"table of varchar2(240)",
299 @section ora_relnotes Release Notes
302 - implemented support
for custom column operators (<a href=
"https://github.com/qorelanguage/qore/issues/2314">issue 2314</a>)
303 - implemented support
for chained synonyms (<a href=
"https://github.com/qorelanguage/qore/issues/2408">issue 2408</a>)
304 - allow to use DBA_* views instead of ALL_*
if possible (<a href=
"https://github.com/qorelanguage/qore/issues/2418">issue 2418</a>)
307 - fixed a bug in \c character_semantics
for standalone column (<a href=
"https://github.com/qorelanguage/qore/issues/1688">issue 1688</a>)
311 - fixed a bug in the \a force option (i.e. cascade) for dropping types (<a href="https:
314 - implemented the \a force option (i.e. cascade) for dropping code objects (<a href="https:
315 - worked around ORA-22165 from
op_in() caused by Oracle's limit on
number of collection elements (<a href="https:
318 - implemented support for the \c "returning" clause as an insert option
319 - implemented support for views for DML in the @ref
OracleSqlUtil::OracleTable class
321 - implemented support for Oracle pseudocolumns in queries
324 - return lists from Oracle's data dictionary ordered
325 - implemented @ref
OracleSqlUtil::OracleTable::bindEmptyStringsAsNull()
326 - implemented high-performance "upsert" (merge) support also supporting bulk DML
331 - fixed selects with "limit" but no "offset"
332 - convert
date/time values to timestamps with
microseconds resolution instead of dates with second resolution when dynamically inserting values as strings in SQL (binding by value not affected)
333 - fixed schema information classes when the "
string-numbers" driver option is enabled
361 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm,
bool is_char =
False,
bool cu =
False, softint bs) ;
365 string getNativeTypeString();
376 list getAddColumnSql(AbstractTable t);
390 list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
404 string getRenameSql(AbstractTable t,
string new_name);
408 bool equalImpl(AbstractColumn c);
416 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm, softint bs, softint n_scale = 0) ;
419 string getNativeTypeString();
437 constructor(
string n,
bool u, hash c,
string nt, *
string t) ;
441 string getCreateSql(
string table_name, *hash opt);
445 bool equalImpl(AbstractIndex ix);
449 string getRenameSql(
string table_name,
string new_name);
463 constructor(
string n, Columns c, ForeignConstraintTarget t,
bool e) ;
466 string getCreateSql(
string table_name, *hash opt);
469 softlist getRenameSql(
string table_name,
string new_name);
473 string getDisableSql(
string table_name);
477 string getEnableSql(
string table_name, *hash opt);
491 constructor(
string n,
string n_src,
bool e =
True) ;
494 string getCreateSql(
string table_name, *hash opt);
497 softlist getRenameSql(
string table_name,
string new_name);
501 string getDisableSql(
string table_name);
505 string getEnableSql(
string table_name, *hash opt);
522 constructor(
string n, hash n_cols,
bool e =
True, *
string ts) ;
544 bool setIndexBase(
string ix);
551 string getCreateSql(
string table_name, *hash opts);
554 softlist getRenameSql(
string table_name,
string new_name);
558 string getDisableSql(
string table_name);
562 string getEnableSql(
string table_name, *hash opt);
570 *
string getTablespace();
587 constructor(
string n, *hash c, *
string ts) ;
609 bool setIndexBase(
string ix);
616 string getCreateSql(
string table_name, *hash opts);
619 softlist getRenameSql(
string table_name,
string new_name);
625 string getDropSql(
string table_name);
629 string getDisableSql(
string table_name);
633 string getEnableSql(
string table_name, *hash opt);
642 constructor(
string n_name,
number n_start = 1,
number n_increment = 1, *softnumber n_end) ;
646 string getCreateSql(*hash opt);
654 softlist getRenameSql(
string new_name, *hash opt);
679 constructor(
string n_name,
string n_src, *
string n_schema, *
string n_type_text,
680 *
string n_oid_text, *
string n_view_type_owner,
681 *
string n_view_type, *
string n_superview_name,
682 bool n_updatable,
bool n_container_data)
687 string getCreateSql(*hash opt);
695 softlist getRenameSql(
string new_name, *hash opt);
709 constructor(
string n,
string n_src,
bool en =
True) ;
712 softlist getCreateSql(
string table_name, *hash opt);
716 bool equalImpl(AbstractFunctionBase t);
720 softlist getRenameSql(
string table_name,
string new_name);
724 softlist getDropSql(
string table_name);
737 constructor(
string n,
string n_type,
string n_src) ;
743 softlist getCreateSql(*hash opt);
747 bool equalImpl(AbstractFunctionBase t);
755 softlist getRenameSql(
string new_name, *hash opt);
768 constructor(
string n,
string n_type,
string n_src) ;
777 softlist getRenameSql(
string new_name, *hash opt);
785 constructor(
string n_name,
string n_src) ;
791 string getDropSql(*hash opt);
803 constructor(
string n,
string n_src) ;
815 constructor(
string n,
string n_src) ;
834 constructor(
string n,
string n_src, *
string n_body_src) ;
838 list getCreateSql(*hash opt);
842 bool equalImpl(AbstractFunctionBase t);
867 constructor(
string n,
string n_src,
bool n_logging =
True,
bool n_use_index =
True, *
string n_tablespace) ;
871 softlist getCreateSql(*hash opt);
874 bool equalImpl(AbstractFunctionBase t);
884 const OracleCreationOptions = AbstractDatabase::CreationOptions + (
889 const OracleAlignSchemaOptions = AbstractDatabase::AlignSchemaOptions
890 + OracleCreationOptions
891 + OracleTable::OracleAlignTableOptions
903 const OracleSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
918 const OraclePackageDescriptionOptions = (
924 const OracleMaterializedViewDescriptionOptions = (
932 const OracleReservedWords = (
1047 const OracleRebuildIndexOptions = (
1058 const OracleComputeStatisticsOptions = ComputeStatisticsOptions + (
1074 constructor(AbstractDatasource nds, *hash opts) ;
1079 list featuresImpl();
1091 getSchemaName(reference<string> name, reference<string> schema);
1097 *AbstractSequence getSequenceImpl(
string name);
1103 *AbstractView getViewImpl(
string name);
1109 OracleFunction makeFunctionImpl(
string name,
string src, *hash opts);
1115 OracleProcedure makeProcedureImpl(
string name,
string src, *hash opts);
1121 OraclePackage makePackage(
string name,
string src,
string body, *hash opts);
1127 OraclePackage makePackageFromDescription(
string name, hash ph, *hash opts);
1133 OracleType makeType(
string name,
string src, *hash opts);
1139 OracleMaterializedView makeMaterializedView(
string name,
string src,
bool logging =
True,
bool use_index =
True, *
string tablespace, *hash opts);
1151 list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
1157 list getAlignSqlImpl(hash schema_hash, *hash opt);
1187 *
string getSource(
string type,
string name);
1193 checkSource(
string type,
string name, reference<string> src);
1198 list listSynonyms();
1202 ListIterator synonymIterator();
1210 ListIterator typeIterator();
1214 list listPackages();
1218 ListIterator packageIterator();
1222 list listMaterializedViews();
1226 ListIterator materializedViewIterator();
1231 list listTablesImpl();
1237 list listFunctionsImpl();
1243 list listProceduresImpl();
1249 list listSequencesImpl();
1255 list listViewsImpl();
1261 list getListIntern(
string type);
1273 string getCreateSqlImpl(
list l);
1277 static string getCreateSql(
list l);
1282 hash getCreationOptions();
1289 hash getAlignSchemaOptions();
1296 hash getSchemaDescriptionOptions();
1303 hash getRebuildIndexOptions();
1310 hash getComputeStatisticsOptions();
1317 softint getNextSequenceValueImpl(
string name);
1324 softint getCurrentSequenceValueImpl(
string name);
1331 bool supportsSequencesImpl();
1338 bool supportsTypesImpl();
1345 bool supportsPackagesImpl();
1362 bool rebuildIndexAnalyze(AbstractIndex
index,
int maxh,
int maxleaf);
1378 bool rebuildIndexAnalyze(
string name,
int maxh,
int maxleaf);
1384 bool rebuildIndexImpl(
string name, *hash options);
1391 computeStatisticsImpl(*hash options);
1398 computeStatisticsSchemaImpl(*hash options);
1405 computeStatisticsTablesImpl(*hash options);
1412 reclaimSpaceImpl(*hash options);
1426 const OraTypeMap = (
1427 "number": (
"qore":
Type::Number,
"size":
SZ_NUM,
"size_range": (1, 38),
"scale_range": (-84, 127)),
1432 "timestamp with time zone": (
"qore":
Type::Date,
"size":
SZ_OPT,
"size_range": (0, 9)),
1433 "timestamp with local time zone": (
"qore":
Type::Date,
"size":
SZ_OPT,
"size_range": (0, 9)),
1434 "interval year to month": (
"qore":
Type::Date,),
1435 "interval day to second": (
"qore":
Type::Date,),
1446 "timestamp(0) with time zone": (
"qore":
Type::Date,),
1447 "timestamp(1) with time zone": (
"qore":
Type::Date,),
1448 "timestamp(2) with time zone": (
"qore":
Type::Date,),
1449 "timestamp(3) with time zone": (
"qore":
Type::Date,),
1450 "timestamp(4) with time zone": (
"qore":
Type::Date,),
1451 "timestamp(5) with time zone": (
"qore":
Type::Date,),
1452 "timestamp(6) with time zone": (
"qore":
Type::Date,),
1453 "timestamp(7) with time zone": (
"qore":
Type::Date,),
1454 "timestamp(8) with time zone": (
"qore":
Type::Date,),
1455 "timestamp(9) with time zone": (
"qore":
Type::Date,),
1456 "timestamp(0) with local time zone": (
"qore":
Type::Date,),
1457 "timestamp(1) with local time zone": (
"qore":
Type::Date,),
1458 "timestamp(2) with local time zone": (
"qore":
Type::Date,),
1459 "timestamp(3) with local time zone": (
"qore":
Type::Date,),
1460 "timestamp(4) with local time zone": (
"qore":
Type::Date,),
1461 "timestamp(5) with local time zone": (
"qore":
Type::Date,),
1462 "timestamp(6) with local time zone": (
"qore":
Type::Date,),
1463 "timestamp(7) with local time zone": (
"qore":
Type::Date,),
1464 "timestamp(8) with local time zone": (
"qore":
Type::Date,),
1465 "timestamp(9) with local time zone": (
"qore":
Type::Date,),
1466 "interval year(0) to month": (
"qore":
Type::Date,),
1467 "interval year(1) to month": (
"qore":
Type::Date,),
1468 "interval year(2) to month": (
"qore":
Type::Date,),
1469 "interval year(3) to month": (
"qore":
Type::Date,),
1470 "interval year(4) to month": (
"qore":
Type::Date,),
1471 "interval year(5) to month": (
"qore":
Type::Date,),
1472 "interval year(6) to month": (
"qore":
Type::Date,),
1473 "interval year(7) to month": (
"qore":
Type::Date,),
1474 "interval year(8) to month": (
"qore":
Type::Date,),
1475 "interval year(9) to month": (
"qore":
Type::Date,),
1476 "interval day(0) to second(0)": (
"qore":
Type::Date,),
1477 "interval day(0) to second(1)": (
"qore":
Type::Date,),
1478 "interval day(0) to second(2)": (
"qore":
Type::Date,),
1479 "interval day(0) to second(3)": (
"qore":
Type::Date,),
1480 "interval day(0) to second(4)": (
"qore":
Type::Date,),
1481 "interval day(0) to second(5)": (
"qore":
Type::Date,),
1482 "interval day(0) to second(6)": (
"qore":
Type::Date,),
1483 "interval day(0) to second(7)": (
"qore":
Type::Date,),
1484 "interval day(0) to second(8)": (
"qore":
Type::Date,),
1485 "interval day(0) to second(9)": (
"qore":
Type::Date,),
1486 "interval day(1) to second(0)": (
"qore":
Type::Date,),
1487 "interval day(1) to second(1)": (
"qore":
Type::Date,),
1488 "interval day(1) to second(2)": (
"qore":
Type::Date,),
1489 "interval day(1) to second(3)": (
"qore":
Type::Date,),
1490 "interval day(1) to second(4)": (
"qore":
Type::Date,),
1491 "interval day(1) to second(5)": (
"qore":
Type::Date,),
1492 "interval day(1) to second(6)": (
"qore":
Type::Date,),
1493 "interval day(1) to second(7)": (
"qore":
Type::Date,),
1494 "interval day(1) to second(8)": (
"qore":
Type::Date,),
1495 "interval day(1) to second(9)": (
"qore":
Type::Date,),
1496 "interval day(2) to second(0)": (
"qore":
Type::Date,),
1497 "interval day(2) to second(1)": (
"qore":
Type::Date,),
1498 "interval day(2) to second(2)": (
"qore":
Type::Date,),
1499 "interval day(2) to second(3)": (
"qore":
Type::Date,),
1500 "interval day(2) to second(4)": (
"qore":
Type::Date,),
1501 "interval day(2) to second(5)": (
"qore":
Type::Date,),
1502 "interval day(2) to second(6)": (
"qore":
Type::Date,),
1503 "interval day(2) to second(7)": (
"qore":
Type::Date,),
1504 "interval day(2) to second(8)": (
"qore":
Type::Date,),
1505 "interval day(2) to second(9)": (
"qore":
Type::Date,),
1518 const QoreTypeMap = (
1519 "integer":
"number",
1522 "string":
"varchar2",
1523 "date":
"timestamp(6)",
1530 const OraColumnOpts = (
1538 const OraColumnOptions = AbstractTable::ColumnOptions + OraColumnOpts;
1544 const OraColumnDescOptions = AbstractTable::ColumnDescOptions + OraColumnOpts;
1550 const OracleIndexOptions = AbstractTable::IndexOptions + (
1558 const OracleConstraintOptions = OracleIndexOptions + (
1563 const OracleTableCreationOptions = AbstractTable::TableCreationOptions
1564 + OracleConstraintOptions
1568 const OracleAlignTableOptions = AbstractTable::AlignTableOptions + OracleTableCreationOptions;
1575 const OracleSelectOptions = AbstractTable::SelectOptions + (
1582 "code":
string (
object t,
string cn, softlist arg, reference<list> args, *hash jch,
bool join =
False, *hash ch, *hash psch) {
1592 ListIterator it(arg);
1604 return cn +
" in (" + (map
"select column_value from table(%v)",
xrange(1,count)).
join(
" union all ") +
")";
1607 throw "MISSING-ORACLE-DRIVER",
"op_in requires oracle driver";
1611 "code":
string (
object t,
string cn,
auto arg, reference<list> args, *hash jch,
bool join =
False, *hash ch, *hash psch) {
1617 return sprintf(
"substr(%s,%v,%v) = %v", cn);
1623 const OracleCopMap = (
1626 string name = QoreTypeMap{args[0]} ?? args[0];
1627 hash desc = OraTypeMap{name};
1628 string sql =
sprintf (
"cast (%s as %s", cve, name);
1636 "code":
string (
string cve,
list args) {
1638 return sprintf(
"substr(%s,%d)", cve, args[0]);
1639 return sprintf(
"substr(%s,%d,%d)", cve, args[0], args[1]);
1643 "code":
string (
string arg1,
auto arg) {
1644 return sprintf(
"to_char(%s, 'YYYY')", arg1);
1648 "code":
string (
string arg1,
auto arg) {
1649 return sprintf(
"to_char(%s, 'YYYY-MM')", arg1);
1653 "code":
string (
string arg1,
auto arg) {
1654 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", arg1);
1658 "code":
string (
string arg1,
auto arg) {
1659 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", arg1);
1665 "code":
string (*
string cve, hash arg, reference<hash> psch) {
1666 string sql =
sprintf(
"%s.nextval", arg.seq);
1675 "code":
string (*
string cve, hash arg, reference<hash> psch) {
1676 string sql =
sprintf(
"%s.currval", arg.seq);
1683 "code":
string sub(
string arg1,
auto arg) {
1684 if (!OracleTruncDate.hasKey(arg));
1687 if (
exists OracleTruncDate{arg});
1690 return sprintf(
"cast (%s as date)", arg1);
1696 const OracleTruncDate = (
1710 "code":
string (
string cve,
string arg) {
1711 return sprintf(
"%s.nextval", arg);
1717 "code":
string (
string cve,
string arg) {
1718 return sprintf(
"%s.currval", arg);
1727 "code":
string (*
string cve,
string arg) {
1728 return sprintf(
"%s.nextval", arg);
1733 "code":
string (*
string cve,
string arg) {
1734 return sprintf(
"%s.currval", arg);
1740 const OraclePseudoColumnHash = (
1744 "object_value":
True,
1770 bool m_isView =
False;
1775 hash m_sys_views = (
1776 "dba_col_comments" :
"all_col_comments",
1777 "dba_cons_columns" :
"all_cons_columns",
1778 "dba_constraints" :
"all_constraints",
1779 "dba_db_links" :
"all_db_links",
1780 "dba_ind_columns" :
"all_ind_columns",
1781 "dba_ind_expressions" :
"all_ind_expressions",
1782 "dba_indexes" :
"all_indexes",
1783 "dba_objects" :
"all_objects",
1784 "dba_sequences" :
"all_sequences",
1785 "dba_synonyms" :
"all_synonyms",
1786 "dba_tab_columns" :
"all_tab_columns",
1787 "dba_tab_comments" :
"all_tab_comments",
1788 "dba_tables" :
"all_tables",
1789 "dba_triggers" :
"all_triggers",
1790 "dba_views" :
"all_views",
1795 constructor(AbstractDatasource nds,
string nname, *hash opts) ;
1802 string systemView(
string name);
1808 bool checkExistenceImpl();
1814 setTableInfoIntern();
1819 string getSqlName();
1828 hash setSchemaTable();
1843 *hash resolveSynonym(
string s_owner,
string s_name);
1855 string getUserSchema();
1861 string getDBString();
1866 string getSchemaName();
1870 *
string getTablespaceName();
1874 *
string getComment();
1882 hash getColumnOptions();
1888 hash getColumnDescOptions();
1895 hash getSelectOptions();
1901 getSelectWhereSqlUnlocked(reference<string> sql, reference<list> args, *hash qh, *hash jch,
bool join =
False, *hash ch, *hash psch);
1907 doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list> args, *hash qh, *hash jch, *hash ch, *hash psch,
list coll);
1914 doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list> args, *hash qh);
1920 Columns describeImpl();
1932 Indexes getIndexesImpl();
1938 ForeignConstraints getForeignConstraintsImpl(*hash opts);
1944 Constraints getConstraintsImpl();
1950 string getSelectSqlName(*hash qh);
1956 Triggers getTriggersImpl();
1960 string getCreateTableSqlImpl(*hash opt);
1965 *
list getCreateMiscSqlImpl(*hash opt,
bool cache);
1971 string getCreateSqlImpl(
list l);
1977 string getRenameSqlImpl(
string new_name);
1983 AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable =
True);
1989 AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
1995 AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
2001 AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash ch,
string table, hash tch, *hash opt);
2007 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
2013 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
2019 AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
2025 bool tryInsertImpl(
string sql, hash row);
2031 *
list getAlignSqlImpl(AbstractTable t, *hash opt);
2037 hash getQoreTypeMapImpl();
2043 hash getTypeMapImpl();
2049 hash getIndexOptions();
2055 hash getConstraintOptions();
2061 hash getTableCreationOptions();
2067 hash getAlignTableOptions();
2074 hash getWhereOperatorMap();
2081 hash getColumnOperatorMapImpl();
2088 hash getInsertOperatorMap();
2095 hash getRawUpdateOperatorMap();
2102 *hash getPseudoColumnHash();
2109 *
string getSqlValueImpl(
auto v);
2114 string getColumnSqlName(
string col);
2118 list getColumnSqlNames(softlist cols);
2125 string getBaseType();
2133 code getUpsertClosure(hash row,
int upsert_strategy =
UpsertAuto, *hash opt);
2139 code getUpsertInsertOnly(Columns cols, hash row, *hash opt);
2146 code getUpsertUpdateOnly(Columns cols, hash row, *hash opt);
2151 bool hasArrayBind();
2157 bool bindEmptyStringsAsNull();
2163 bool asteriskRequiresPrefix();
2169 *hash doReturningImpl(hash opt, reference<string> sql,
list args);
2181 setupTableImpl(hash desc, *hash opt);
2188 bool constraintsLinkedToIndexesImpl();
2195 bool uniqueIndexCreatesConstraintImpl();
2202 bool supportsTablespacesImpl();
2209 copyImpl(AbstractTable old);
represents an Oracle unique constraint
Definition: OracleSqlUtil.qm.dox.h:510
represents an Oracle materialized view
Definition: OracleSqlUtil.qm.dox.h:847
the OracleSqlUtil namespace contains all the objects in the OracleSqlUtil module
Definition: OracleSqlUtil.qm.dox.h:340
string sprintf(string fmt,...)
hash< ColumnOperatorInfo > cop_cast(auto column, string arg, auto arg1, auto arg2)
*string tablespace
the tablespace name of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:432
bool logging
Flag if is loggign mode used.
Definition: OracleSqlUtil.qm.dox.h:852
*string view_type_owner
Owner of the type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:668
represents an Oracle table
Definition: OracleSqlUtil.qm.dox.h:1421
*string tablespace
Name of the potential tablespace.
Definition: OracleSqlUtil.qm.dox.h:856
*string superview_name
Name of the superview.
Definition: OracleSqlUtil.qm.dox.h:672
bool enabled
True if the trigger is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:705
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:459
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:487
represents an Oracle procedure
Definition: OracleSqlUtil.qm.dox.h:808
number number(softnumber n)
hash< UpdateOperatorInfo > uop_substr(int start, *int count, *hash< UpdateOperatorInfo > nest)
*string tablespace
any tablespace for the unique key index
Definition: OracleSqlUtil.qm.dox.h:518
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:515
represents an Oracle view
Definition: OracleSqlUtil.qm.dox.h:659
RangeIterator xrange(int start, int stop, int step=1, auto val)
int index(softstring str, softstring substr, softint pos=0)
date microseconds(softint us)
*string oid_text
WITH OID clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:666
hash< ColumnOperatorInfo > cop_trunc_date(auto column, string mask)
bool use_index
Flag if is index used.
Definition: OracleSqlUtil.qm.dox.h:854
the Oracle specialization for SqlUtil::AbstractDatabase
Definition: OracleSqlUtil.qm.dox.h:879
int byte_size
byte size of the column
Definition: OracleSqlUtil.qm.dox.h:357
the base class for Oracle code objects that cannot be renamed in place
Definition: OracleSqlUtil.qm.dox.h:760
represents an Oracle check constraint
Definition: OracleSqlUtil.qm.dox.h:482
represents an Oracle number column
Definition: OracleSqlUtil.qm.dox.h:413
represents an Oracle package
Definition: OracleSqlUtil.qm.dox.h:820
hash< ColumnOperatorInfo > cop_seq(string seq, *string as)
string string(softstring str, *string enc)
represents an Oracle column
Definition: OracleSqlUtil.qm.dox.h:350
*string type_text
Type clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:664
OracleDatabase get_database(AbstractDatasource nds, *hash opts)
returns an OracleDatabase object corresponding to the arguments
hash< OperatorInfo > op_in()
hash< ColumnOperatorInfo > cop_seq_currval(string seq, *string as)
*string body_src
package body source
Definition: OracleSqlUtil.qm.dox.h:825
*string tablespace
any tablespace for the primary key index
Definition: OracleSqlUtil.qm.dox.h:580
*string view_type
Type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:670
represents an Oracle sequence
Definition: OracleSqlUtil.qm.dox.h:638
represents an Oracle trigger
Definition: OracleSqlUtil.qm.dox.h:700
hash< OperatorInfo > op_substr(int start, *int count, string text)
OracleTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns an OracleTable object corresponding to the arguments
bool container_data
Indicates whether the view contains container-specific data.
Definition: OracleSqlUtil.qm.dox.h:674
const OracleSchemaDescriptionOptions
oracle-specific schema description keys
Definition: OracleSqlUtil.qm.dox.h:903
hash< ColumnOperatorInfo > cop_substr(auto column, int start, *int count)
represents an Oracle foreign constraint
Definition: OracleSqlUtil.qm.dox.h:454
represents an Oracle type
Definition: OracleSqlUtil.qm.dox.h:782
represents an Oracle primary key
Definition: OracleSqlUtil.qm.dox.h:575
string native_type
the native type of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:429
string join(string str,...)
represents an Oracle index
Definition: OracleSqlUtil.qm.dox.h:424
bool char_used
the column uses character semantics
Definition: OracleSqlUtil.qm.dox.h:355
represents an Oracle function
Definition: OracleSqlUtil.qm.dox.h:796
the base class for Oracle code objects
Definition: OracleSqlUtil.qm.dox.h:729