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 - worked around an Oracle bug in materialized view creation where when the schema user is missing the <tt>CREATE MATERIALIZED VIEW</tt> grant the table backing the view is created but the materialized view itself is not created causing future creation actions to fail (<a href=
"https://github.com/qorelanguage/qore/issues/2643">issue 2643</a>)
305 - implemented support
for custom column operators (<a href=
"https://github.com/qorelanguage/qore/issues/2314">issue 2314</a>)
306 - implemented support
for chained synonyms (<a href=
"https://github.com/qorelanguage/qore/issues/2408">issue 2408</a>)
307 - allow to use DBA_* views instead of ALL_*
if possible (<a href=
"https://github.com/qorelanguage/qore/issues/2418">issue 2418</a>)
310 - fixed a bug in \c character_semantics
for standalone column (<a href=
"https://github.com/qorelanguage/qore/issues/1688">issue 1688</a>)
314 - fixed a bug in the \a force option (i.e. cascade) for dropping types (<a href="https:
317 - implemented the \a force option (i.e. cascade) for dropping code objects (<a href="https:
318 - worked around ORA-22165 from
op_in() caused by Oracle's limit on
number of collection elements (<a href="https:
321 - implemented support for the \c "returning" clause as an insert option
322 - implemented support for views for DML in the @ref
OracleSqlUtil::OracleTable class
324 - implemented support for Oracle pseudocolumns in queries
327 - return lists from Oracle's data dictionary ordered
328 - implemented @ref
OracleSqlUtil::OracleTable::bindEmptyStringsAsNull()
329 - implemented high-performance "upsert" (merge) support also supporting bulk DML
334 - fixed selects with "limit" but no "offset"
335 - 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)
336 - fixed schema information classes when the "
string-numbers" driver option is enabled
364 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm,
bool is_char =
False,
bool cu =
False, softint bs) ;
368 string getNativeTypeString();
379 list getAddColumnSql(AbstractTable t);
393 list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
407 string getRenameSql(AbstractTable t,
string new_name);
411 bool equalImpl(AbstractColumn c);
419 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm, softint bs, softint n_scale = 0) ;
422 string getNativeTypeString();
440 constructor(
string n,
bool u, hash c,
string nt, *
string t) ;
444 string getCreateSql(
string table_name, *hash opt);
448 bool equalImpl(AbstractIndex ix);
452 string getRenameSql(
string table_name,
string new_name);
466 constructor(
string n, Columns c, ForeignConstraintTarget t,
bool e) ;
469 string getCreateSql(
string table_name, *hash opt);
472 softlist getRenameSql(
string table_name,
string new_name);
476 string getDisableSql(
string table_name);
480 string getEnableSql(
string table_name, *hash opt);
494 constructor(
string n,
string n_src,
bool e =
True) ;
497 string getCreateSql(
string table_name, *hash opt);
500 softlist getRenameSql(
string table_name,
string new_name);
504 string getDisableSql(
string table_name);
508 string getEnableSql(
string table_name, *hash opt);
525 constructor(
string n, hash n_cols,
bool e =
True, *
string ts) ;
547 bool setIndexBase(
string ix);
554 string getCreateSql(
string table_name, *hash opts);
557 softlist getRenameSql(
string table_name,
string new_name);
561 string getDisableSql(
string table_name);
565 string getEnableSql(
string table_name, *hash opt);
573 *
string getTablespace();
590 constructor(
string n, *hash c, *
string ts) ;
612 bool setIndexBase(
string ix);
619 string getCreateSql(
string table_name, *hash opts);
622 softlist getRenameSql(
string table_name,
string new_name);
628 string getDropSql(
string table_name);
632 string getDisableSql(
string table_name);
636 string getEnableSql(
string table_name, *hash opt);
645 constructor(
string n_name,
number n_start = 1,
number n_increment = 1, *softnumber n_end) ;
649 string getCreateSql(*hash opt);
657 softlist getRenameSql(
string new_name, *hash opt);
682 constructor(
string n_name,
string n_src, *
string n_schema, *
string n_type_text,
683 *
string n_oid_text, *
string n_view_type_owner,
684 *
string n_view_type, *
string n_superview_name,
685 bool n_updatable,
bool n_container_data)
690 string getCreateSql(*hash opt);
698 softlist getRenameSql(
string new_name, *hash opt);
712 constructor(
string n,
string n_src,
bool en =
True) ;
715 softlist getCreateSql(
string table_name, *hash opt);
719 bool equalImpl(AbstractFunctionBase t);
723 softlist getRenameSql(
string table_name,
string new_name);
727 softlist getDropSql(
string table_name);
740 constructor(
string n,
string n_type,
string n_src) ;
746 softlist getCreateSql(*hash opt);
750 bool equalImpl(AbstractFunctionBase t);
758 softlist getRenameSql(
string new_name, *hash opt);
771 constructor(
string n,
string n_type,
string n_src) ;
780 softlist getRenameSql(
string new_name, *hash opt);
788 constructor(
string n_name,
string n_src) ;
794 string getDropSql(*hash opt);
806 constructor(
string n,
string n_src) ;
818 constructor(
string n,
string n_src) ;
837 constructor(
string n,
string n_src, *
string n_body_src) ;
841 list getCreateSql(*hash opt);
845 bool equalImpl(AbstractFunctionBase t);
870 constructor(
string n,
string n_src,
bool n_logging =
True,
bool n_use_index =
True, *
string n_tablespace) ;
874 softlist getCreateSql(*hash opt);
877 bool equalImpl(AbstractFunctionBase t);
887 const OracleCreationOptions = AbstractDatabase::CreationOptions + (
892 const OracleAlignSchemaOptions = AbstractDatabase::AlignSchemaOptions
893 + OracleCreationOptions
894 + OracleTable::OracleAlignTableOptions
906 const OracleSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
921 const OraclePackageDescriptionOptions = (
927 const OracleMaterializedViewDescriptionOptions = (
935 const OracleReservedWords = (
1050 const OracleRebuildIndexOptions = (
1061 const OracleComputeStatisticsOptions = ComputeStatisticsOptions + (
1077 constructor(AbstractDatasource nds, *hash opts) ;
1082 list featuresImpl();
1094 getSchemaName(reference<string> name, reference<string> schema);
1100 *AbstractSequence getSequenceImpl(
string name);
1106 *AbstractView getViewImpl(
string name);
1112 OracleFunction makeFunctionImpl(
string name,
string src, *hash opts);
1118 OracleProcedure makeProcedureImpl(
string name,
string src, *hash opts);
1124 OraclePackage makePackage(
string name,
string src,
string body, *hash opts);
1130 OraclePackage makePackageFromDescription(
string name, hash ph, *hash opts);
1136 OracleType makeType(
string name,
string src, *hash opts);
1142 OracleMaterializedView makeMaterializedView(
string name,
string src,
bool logging =
True,
bool use_index =
True, *
string tablespace, *hash opts);
1154 list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
1160 list getAlignSqlImpl(hash schema_hash, *hash opt);
1190 *
string getSource(
string type,
string name);
1196 checkSource(
string type,
string name, reference<string> src);
1201 list listSynonyms();
1205 ListIterator synonymIterator();
1213 ListIterator typeIterator();
1217 list listPackages();
1221 ListIterator packageIterator();
1225 list listMaterializedViews();
1229 ListIterator materializedViewIterator();
1234 list listTablesImpl();
1240 list listFunctionsImpl();
1246 list listProceduresImpl();
1252 list listSequencesImpl();
1258 list listViewsImpl();
1264 list getListIntern(
string type);
1276 string getCreateSqlImpl(
list l);
1280 static string getCreateSql(
list l);
1285 hash getCreationOptions();
1292 hash getAlignSchemaOptions();
1299 hash getSchemaDescriptionOptions();
1306 hash getRebuildIndexOptions();
1313 hash getComputeStatisticsOptions();
1320 softint getNextSequenceValueImpl(
string name);
1327 softint getCurrentSequenceValueImpl(
string name);
1334 bool supportsSequencesImpl();
1341 bool supportsTypesImpl();
1348 bool supportsPackagesImpl();
1365 bool rebuildIndexAnalyze(AbstractIndex
index,
int maxh,
int maxleaf);
1381 bool rebuildIndexAnalyze(
string name,
int maxh,
int maxleaf);
1387 bool rebuildIndexImpl(
string name, *hash options);
1394 computeStatisticsImpl(*hash options);
1401 computeStatisticsSchemaImpl(*hash options);
1408 computeStatisticsTablesImpl(*hash options);
1415 reclaimSpaceImpl(*hash options);
1421 oracleErrorCallback(
int ac,
string type,
string name, *
string table, *
string new_name, *
string info,
string sql, hash<ExceptionInfo> ex);
1434 const OraTypeMap = (
1435 "number": (
"qore":
Type::Number,
"size":
SZ_NUM,
"size_range": (1, 38),
"scale_range": (-84, 127)),
1440 "timestamp with time zone": (
"qore":
Type::Date,
"size":
SZ_OPT,
"size_range": (0, 9)),
1441 "timestamp with local time zone": (
"qore":
Type::Date,
"size":
SZ_OPT,
"size_range": (0, 9)),
1442 "interval year to month": (
"qore":
Type::Date,),
1443 "interval day to second": (
"qore":
Type::Date,),
1454 "timestamp(0) with time zone": (
"qore":
Type::Date,),
1455 "timestamp(1) with time zone": (
"qore":
Type::Date,),
1456 "timestamp(2) with time zone": (
"qore":
Type::Date,),
1457 "timestamp(3) with time zone": (
"qore":
Type::Date,),
1458 "timestamp(4) with time zone": (
"qore":
Type::Date,),
1459 "timestamp(5) with time zone": (
"qore":
Type::Date,),
1460 "timestamp(6) with time zone": (
"qore":
Type::Date,),
1461 "timestamp(7) with time zone": (
"qore":
Type::Date,),
1462 "timestamp(8) with time zone": (
"qore":
Type::Date,),
1463 "timestamp(9) with time zone": (
"qore":
Type::Date,),
1464 "timestamp(0) with local time zone": (
"qore":
Type::Date,),
1465 "timestamp(1) with local time zone": (
"qore":
Type::Date,),
1466 "timestamp(2) with local time zone": (
"qore":
Type::Date,),
1467 "timestamp(3) with local time zone": (
"qore":
Type::Date,),
1468 "timestamp(4) with local time zone": (
"qore":
Type::Date,),
1469 "timestamp(5) with local time zone": (
"qore":
Type::Date,),
1470 "timestamp(6) with local time zone": (
"qore":
Type::Date,),
1471 "timestamp(7) with local time zone": (
"qore":
Type::Date,),
1472 "timestamp(8) with local time zone": (
"qore":
Type::Date,),
1473 "timestamp(9) with local time zone": (
"qore":
Type::Date,),
1474 "interval year(0) to month": (
"qore":
Type::Date,),
1475 "interval year(1) to month": (
"qore":
Type::Date,),
1476 "interval year(2) to month": (
"qore":
Type::Date,),
1477 "interval year(3) to month": (
"qore":
Type::Date,),
1478 "interval year(4) to month": (
"qore":
Type::Date,),
1479 "interval year(5) to month": (
"qore":
Type::Date,),
1480 "interval year(6) to month": (
"qore":
Type::Date,),
1481 "interval year(7) to month": (
"qore":
Type::Date,),
1482 "interval year(8) to month": (
"qore":
Type::Date,),
1483 "interval year(9) to month": (
"qore":
Type::Date,),
1484 "interval day(0) to second(0)": (
"qore":
Type::Date,),
1485 "interval day(0) to second(1)": (
"qore":
Type::Date,),
1486 "interval day(0) to second(2)": (
"qore":
Type::Date,),
1487 "interval day(0) to second(3)": (
"qore":
Type::Date,),
1488 "interval day(0) to second(4)": (
"qore":
Type::Date,),
1489 "interval day(0) to second(5)": (
"qore":
Type::Date,),
1490 "interval day(0) to second(6)": (
"qore":
Type::Date,),
1491 "interval day(0) to second(7)": (
"qore":
Type::Date,),
1492 "interval day(0) to second(8)": (
"qore":
Type::Date,),
1493 "interval day(0) to second(9)": (
"qore":
Type::Date,),
1494 "interval day(1) to second(0)": (
"qore":
Type::Date,),
1495 "interval day(1) to second(1)": (
"qore":
Type::Date,),
1496 "interval day(1) to second(2)": (
"qore":
Type::Date,),
1497 "interval day(1) to second(3)": (
"qore":
Type::Date,),
1498 "interval day(1) to second(4)": (
"qore":
Type::Date,),
1499 "interval day(1) to second(5)": (
"qore":
Type::Date,),
1500 "interval day(1) to second(6)": (
"qore":
Type::Date,),
1501 "interval day(1) to second(7)": (
"qore":
Type::Date,),
1502 "interval day(1) to second(8)": (
"qore":
Type::Date,),
1503 "interval day(1) to second(9)": (
"qore":
Type::Date,),
1504 "interval day(2) to second(0)": (
"qore":
Type::Date,),
1505 "interval day(2) to second(1)": (
"qore":
Type::Date,),
1506 "interval day(2) to second(2)": (
"qore":
Type::Date,),
1507 "interval day(2) to second(3)": (
"qore":
Type::Date,),
1508 "interval day(2) to second(4)": (
"qore":
Type::Date,),
1509 "interval day(2) to second(5)": (
"qore":
Type::Date,),
1510 "interval day(2) to second(6)": (
"qore":
Type::Date,),
1511 "interval day(2) to second(7)": (
"qore":
Type::Date,),
1512 "interval day(2) to second(8)": (
"qore":
Type::Date,),
1513 "interval day(2) to second(9)": (
"qore":
Type::Date,),
1526 const QoreTypeMap = (
1527 "integer":
"number",
1530 "string":
"varchar2",
1531 "date":
"timestamp(6)",
1538 const OraColumnOpts = (
1546 const OraColumnOptions = AbstractTable::ColumnOptions + OraColumnOpts;
1552 const OraColumnDescOptions = AbstractTable::ColumnDescOptions + OraColumnOpts;
1558 const OracleIndexOptions = AbstractTable::IndexOptions + (
1566 const OracleConstraintOptions = OracleIndexOptions + (
1571 const OracleTableCreationOptions = AbstractTable::TableCreationOptions
1572 + OracleConstraintOptions
1576 const OracleAlignTableOptions = AbstractTable::AlignTableOptions + OracleTableCreationOptions;
1583 const OracleSelectOptions = AbstractTable::SelectOptions + (
1590 "code":
string (
object t,
string cn, softlist arg, reference<list> args, *hash jch,
bool join =
False, *hash ch, *hash psch) {
1600 ListIterator it(arg);
1612 return cn +
" in (" + (map
"select column_value from table(%v)",
xrange(1,count)).
join(
" union all ") +
")";
1615 throw "MISSING-ORACLE-DRIVER",
"op_in requires oracle driver";
1619 "code":
string (
object t,
string cn,
auto arg, reference<list> args, *hash jch,
bool join =
False, *hash ch, *hash psch) {
1625 return sprintf(
"substr(%s,%v,%v) = %v", cn);
1631 const OracleCopMap = (
1634 string name = QoreTypeMap{args[0]} ?? args[0];
1635 hash desc = OraTypeMap{name};
1636 string sql =
sprintf (
"cast (%s as %s", cve, name);
1644 "code":
string (
string cve,
list args) {
1646 return sprintf(
"substr(%s,%d)", cve, args[0]);
1647 return sprintf(
"substr(%s,%d,%d)", cve, args[0], args[1]);
1651 "code":
string (
string arg1,
auto arg) {
1652 return sprintf(
"to_char(%s, 'YYYY')", arg1);
1656 "code":
string (
string arg1,
auto arg) {
1657 return sprintf(
"to_char(%s, 'YYYY-MM')", arg1);
1661 "code":
string (
string arg1,
auto arg) {
1662 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", arg1);
1666 "code":
string (
string arg1,
auto arg) {
1667 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", arg1);
1673 "code":
string (*
string cve, hash arg, reference<hash> psch) {
1674 string sql =
sprintf(
"%s.nextval", arg.seq);
1683 "code":
string (*
string cve, hash arg, reference<hash> psch) {
1684 string sql =
sprintf(
"%s.currval", arg.seq);
1691 "code":
string sub(
string arg1,
auto arg) {
1692 if (!OracleTruncDate.hasKey(arg));
1695 if (
exists OracleTruncDate{arg});
1698 return sprintf(
"cast (%s as date)", arg1);
1704 const OracleTruncDate = (
1718 "code":
string (
string cve,
string arg) {
1719 return sprintf(
"%s.nextval", arg);
1725 "code":
string (
string cve,
string arg) {
1726 return sprintf(
"%s.currval", arg);
1735 "code":
string (*
string cve,
string arg) {
1736 return sprintf(
"%s.nextval", arg);
1741 "code":
string (*
string cve,
string arg) {
1742 return sprintf(
"%s.currval", arg);
1748 const OraclePseudoColumnHash = (
1752 "object_value":
True,
1778 bool m_isView =
False;
1783 hash m_sys_views = (
1784 "dba_col_comments" :
"all_col_comments",
1785 "dba_cons_columns" :
"all_cons_columns",
1786 "dba_constraints" :
"all_constraints",
1787 "dba_db_links" :
"all_db_links",
1788 "dba_ind_columns" :
"all_ind_columns",
1789 "dba_ind_expressions" :
"all_ind_expressions",
1790 "dba_indexes" :
"all_indexes",
1791 "dba_objects" :
"all_objects",
1792 "dba_sequences" :
"all_sequences",
1793 "dba_synonyms" :
"all_synonyms",
1794 "dba_tab_columns" :
"all_tab_columns",
1795 "dba_tab_comments" :
"all_tab_comments",
1796 "dba_tables" :
"all_tables",
1797 "dba_triggers" :
"all_triggers",
1798 "dba_views" :
"all_views",
1803 constructor(AbstractDatasource nds,
string nname, *hash opts) ;
1810 string systemView(
string name);
1816 bool checkExistenceImpl();
1822 setTableInfoIntern();
1827 string getSqlName();
1836 hash setSchemaTable();
1851 *hash resolveSynonym(
string s_owner,
string s_name);
1863 string getUserSchema();
1869 string getDBString();
1874 string getSchemaName();
1878 *
string getTablespaceName();
1882 *
string getComment();
1890 hash getColumnOptions();
1896 hash getColumnDescOptions();
1903 hash getSelectOptions();
1909 getSelectWhereSqlUnlocked(reference<string> sql, reference<list> args, *hash qh, *hash jch,
bool join =
False, *hash ch, *hash psch);
1915 doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list> args, *hash qh, *hash jch, *hash ch, *hash psch,
list coll);
1922 doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list> args, *hash qh);
1928 Columns describeImpl();
1940 Indexes getIndexesImpl();
1946 ForeignConstraints getForeignConstraintsImpl(*hash opts);
1952 Constraints getConstraintsImpl();
1958 string getSelectSqlName(*hash qh);
1964 Triggers getTriggersImpl();
1968 string getCreateTableSqlImpl(*hash opt);
1973 *
list getCreateMiscSqlImpl(*hash opt,
bool cache);
1979 string getCreateSqlImpl(
list l);
1985 string getRenameSqlImpl(
string new_name);
1991 AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable =
True);
1997 AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
2003 AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
2009 AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash ch,
string table, hash tch, *hash opt);
2015 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
2021 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
2027 AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
2033 bool tryInsertImpl(
string sql, hash row);
2039 *
list getAlignSqlImpl(AbstractTable t, *hash opt);
2045 hash getQoreTypeMapImpl();
2051 hash getTypeMapImpl();
2057 hash getIndexOptions();
2063 hash getConstraintOptions();
2069 hash getTableCreationOptions();
2075 hash getAlignTableOptions();
2082 hash getWhereOperatorMap();
2089 hash getColumnOperatorMapImpl();
2096 hash getInsertOperatorMap();
2103 hash getRawUpdateOperatorMap();
2110 *hash getPseudoColumnHash();
2117 *
string getSqlValueImpl(
auto v);
2122 string getColumnSqlName(
string col);
2126 list getColumnSqlNames(softlist cols);
2133 string getBaseType();
2141 code getUpsertClosure(hash row,
int upsert_strategy =
UpsertAuto, *hash opt);
2147 code getUpsertInsertOnly(Columns cols, hash row, *hash opt);
2154 code getUpsertUpdateOnly(Columns cols, hash row, *hash opt);
2159 bool hasArrayBind();
2165 bool bindEmptyStringsAsNull();
2171 bool asteriskRequiresPrefix();
2177 *hash doReturningImpl(hash opt, reference<string> sql,
list args);
2189 setupTableImpl(hash desc, *hash opt);
2196 bool constraintsLinkedToIndexesImpl();
2203 bool uniqueIndexCreatesConstraintImpl();
2210 bool supportsTablespacesImpl();
2217 copyImpl(AbstractTable old);
represents an Oracle unique constraint
Definition: OracleSqlUtil.qm.dox.h:513
represents an Oracle materialized view
Definition: OracleSqlUtil.qm.dox.h:850
the OracleSqlUtil namespace contains all the objects in the OracleSqlUtil module
Definition: OracleSqlUtil.qm.dox.h:343
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:435
bool logging
Flag if is loggign mode used.
Definition: OracleSqlUtil.qm.dox.h:855
*string view_type_owner
Owner of the type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:671
represents an Oracle table
Definition: OracleSqlUtil.qm.dox.h:1429
*string tablespace
Name of the potential tablespace.
Definition: OracleSqlUtil.qm.dox.h:859
*string superview_name
Name of the superview.
Definition: OracleSqlUtil.qm.dox.h:675
bool enabled
True if the trigger is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:708
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:462
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:490
represents an Oracle procedure
Definition: OracleSqlUtil.qm.dox.h:811
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:521
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:518
represents an Oracle view
Definition: OracleSqlUtil.qm.dox.h:662
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:669
hash< ColumnOperatorInfo > cop_trunc_date(auto column, string mask)
bool use_index
Flag if is index used.
Definition: OracleSqlUtil.qm.dox.h:857
the Oracle specialization for SqlUtil::AbstractDatabase
Definition: OracleSqlUtil.qm.dox.h:882
int byte_size
byte size of the column
Definition: OracleSqlUtil.qm.dox.h:360
the base class for Oracle code objects that cannot be renamed in place
Definition: OracleSqlUtil.qm.dox.h:763
represents an Oracle check constraint
Definition: OracleSqlUtil.qm.dox.h:485
represents an Oracle number column
Definition: OracleSqlUtil.qm.dox.h:416
represents an Oracle package
Definition: OracleSqlUtil.qm.dox.h:823
hash< ColumnOperatorInfo > cop_seq(string seq, *string as)
string string(softstring str, *string enc)
represents an Oracle column
Definition: OracleSqlUtil.qm.dox.h:353
*string type_text
Type clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:667
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:828
*string tablespace
any tablespace for the primary key index
Definition: OracleSqlUtil.qm.dox.h:583
*string view_type
Type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:673
represents an Oracle sequence
Definition: OracleSqlUtil.qm.dox.h:641
represents an Oracle trigger
Definition: OracleSqlUtil.qm.dox.h:703
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:677
const OracleSchemaDescriptionOptions
oracle-specific schema description keys
Definition: OracleSqlUtil.qm.dox.h:906
hash< ColumnOperatorInfo > cop_substr(auto column, int start, *int count)
represents an Oracle foreign constraint
Definition: OracleSqlUtil.qm.dox.h:457
represents an Oracle type
Definition: OracleSqlUtil.qm.dox.h:785
represents an Oracle primary key
Definition: OracleSqlUtil.qm.dox.h:578
string native_type
the native type of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:432
string join(string str,...)
represents an Oracle index
Definition: OracleSqlUtil.qm.dox.h:427
bool char_used
the column uses character semantics
Definition: OracleSqlUtil.qm.dox.h:358
represents an Oracle function
Definition: OracleSqlUtil.qm.dox.h:799
the base class for Oracle code objects
Definition: OracleSqlUtil.qm.dox.h:732