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>
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
301 @subsection v12 OracleSqlUtil v1.2
302 - implemented support
for the \c
"returning" clause as an insert option
305 - implemented support
for Oracle pseudocolumns in queries
308 - return lists from Oracle's data dictionary ordered
309 - implemented @ref OracleSqlUtil::OracleTable::bindEmptyStringsAsNull()
310 - implemented high-performance "upsert" (merge) support also supporting bulk DML
311 - implemented @ref SqlUtil::
cop_substr() and @ref SqlUtil::
uop_substr() operators (<a href="https:
312 - implemented @ref SqlUtil::
op_substr() where operator (<a href="https:
314 @subsection v11 OracleSqlUtil v1.1
315 - fixed selects with "limit" but no "offset"
316 - 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)
317 - fixed schema information classes when the "
string-numbers" driver option is enabled
319 @subsection v10 OracleSqlUtil v1.0
324 namespace OracleSqlUtil {
345 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm,
bool is_char =
False,
bool cu =
False, softint bs) ;
349 string getNativeTypeString();
360 list getAddColumnSql(AbstractTable t);
374 list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
388 string getRenameSql(AbstractTable t,
string new_name);
392 bool equalImpl(AbstractColumn c);
400 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm, softint bs, softint n_scale = 0) ;
403 string getNativeTypeString();
421 constructor(
string n,
bool u, hash c,
string nt, *
string t) ;
425 string getCreateSql(
string table_name, *hash opt);
429 bool equalImpl(AbstractIndex ix);
433 string getRenameSql(
string table_name,
string new_name);
447 constructor(
string n, Columns c, ForeignConstraintTarget t,
bool e) ;
450 string getCreateSql(
string table_name, *hash opt);
453 softlist getRenameSql(
string table_name,
string new_name);
457 string getDisableSql(
string table_name);
461 string getEnableSql(
string table_name, *hash opt);
475 constructor(
string n,
string n_src,
bool e =
True) ;
478 string getCreateSql(
string table_name, *hash opt);
481 softlist getRenameSql(
string table_name,
string new_name);
485 string getDisableSql(
string table_name);
489 string getEnableSql(
string table_name, *hash opt);
506 constructor(
string n, hash n_cols,
bool e =
True, *
string ts) ;
528 bool setIndexBase(
string ix);
535 string getCreateSql(
string table_name, *hash opts);
538 softlist getRenameSql(
string table_name,
string new_name);
542 string getDisableSql(
string table_name);
546 string getEnableSql(
string table_name, *hash opt);
554 *
string getTablespace();
571 constructor(
string n, *hash c, *
string ts) ;
593 bool setIndexBase(
string ix);
600 string getCreateSql(
string table_name, *hash opts);
603 softlist getRenameSql(
string table_name,
string new_name);
609 string getDropSql(
string table_name);
613 string getDisableSql(
string table_name);
617 string getEnableSql(
string table_name, *hash opt);
626 constructor(
string n_name,
number n_start = 1,
number n_increment = 1, *softnumber n_end) ;
630 string getCreateSql(*hash opt);
634 string getRenameSql(
string new_name);
659 constructor(
string n_name,
string n_src, *
string n_schema, *
string n_type_text,
660 *
string n_oid_text, *
string n_view_type_owner,
661 *
string n_view_type, *
string n_superview_name,
662 bool n_updatable,
bool n_container_data)
667 string getCreateSql(*hash opt);
671 softlist getRenameSql(
string new_name);
685 constructor(
string n,
string n_src,
bool en =
True) ;
688 softlist getCreateSql(
string table_name, *hash opt);
692 bool equalImpl(AbstractFunctionBase t);
696 softlist getRenameSql(
string table_name,
string new_name);
700 softlist getDropSql(
string table_name);
713 constructor(
string n,
string n_type,
string n_src) ;
717 softlist getCreateSql(*hash opt);
721 bool equalImpl(AbstractFunctionBase t);
725 list getRenameSql(
string new_name);
733 constructor(
string n_name,
string n_src) ;
744 string getDropSqlForce();
756 constructor(
string n,
string n_src) ;
768 constructor(
string n,
string n_src) ;
787 constructor(
string n,
string n_src, *
string n_body_src) ;
791 list getCreateSql(*hash opt);
795 bool equalImpl(AbstractFunctionBase t);
820 constructor(
string n,
string n_src,
bool n_logging =
True,
bool n_use_index =
True, *
string n_tablespace) ;
824 softlist getCreateSql(*hash opt);
827 bool equalImpl(AbstractFunctionBase t);
837 const OracleCreationOptions = AbstractDatabase::CreationOptions + (
842 const OracleAlignSchemaOptions = AbstractDatabase::CreationOptions
843 + OracleCreationOptions
844 + OracleTable::OracleAlignTableOptions
856 const OracleSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
871 const OraclePackageDescriptionOptions = (
877 const OracleMaterializedViewDescriptionOptions = (
885 const OracleReservedWords = (
1000 const OracleRebuildIndexOptions = (
1011 const OracleComputeStatisticsOptions = ComputeStatisticsOptions + (
1027 constructor(AbstractDatasource nds, *hash opts) ;
1030 private list featuresImpl();
1036 private getSchemaName(reference name, reference schema);
1039 private *AbstractSequence getSequenceImpl(
string name);
1042 private *AbstractView getViewImpl(
string name);
1045 private OracleFunction makeFunctionImpl(
string name,
string src, *hash opts);
1048 private OracleProcedure makeProcedureImpl(
string name,
string src, *hash opts);
1051 private OraclePackage makePackage(
string name,
string src,
string body, *hash opts);
1054 private OraclePackage makePackageFromDescription(
string name, hash ph, *hash opts);
1057 private OracleType makeType(
string name,
string src, *hash opts);
1060 private OracleMaterializedView makeMaterializedView(
string name,
string src,
bool logging =
True,
bool use_index =
True, *
string tablespace, *hash opts);
1066 private list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
1069 private list getAlignSqlImpl(hash schema_hash, *hash opt);
1090 private *
string getSource(
string type,
string name);
1093 private checkSource(
string type,
string name, reference src);
1097 list listSynonyms();
1101 ListIterator synonymIterator();
1109 ListIterator typeIterator();
1113 list listPackages();
1117 ListIterator packageIterator();
1121 list listMaterializedViews();
1125 ListIterator materializedViewIterator();
1128 private list listTablesImpl();
1131 private list listFunctionsImpl();
1134 private list listProceduresImpl();
1137 private list listSequencesImpl();
1140 private list listViewsImpl();
1143 private list getListIntern(
string type);
1146 private list getListIntern(
list l);
1149 private string getCreateSqlImpl(
list l);
1152 static string getCreateSql(
list l);
1155 private hash getCreationOptions();
1159 private hash getAlignSchemaOptions();
1163 private hash getSchemaDescriptionOptions();
1167 private hash getRebuildIndexOptions();
1171 private hash getComputeStatisticsOptions();
1175 private softint getNextSequenceValueImpl(
string name);
1179 private softint getCurrentSequenceValueImpl(
string name);
1183 private bool supportsSequencesImpl();
1187 private bool supportsTypesImpl();
1191 private bool supportsPackagesImpl();
1207 bool rebuildIndexAnalyze(AbstractIndex
index,
int maxh,
int maxleaf);
1223 bool rebuildIndexAnalyze(
string name,
int maxh,
int maxleaf);
1227 private bool rebuildIndexImpl(
string name, *hash options);
1231 private computeStatisticsImpl(*hash options);
1235 private computeStatisticsSchemaImpl(*hash options);
1239 private computeStatisticsTablesImpl(*hash options);
1243 private reclaimSpaceImpl(*hash options);
1256 const OraTypeMap = (
1257 "number": (
"qore":
Type::Number,
"size":
SZ_NUM,
"size_range": (1, 38),
"scale_range": (-84, 127)),
1262 "timestamp with time zone": (
"qore":
Type::Date,
"size":
SZ_OPT,
"size_range": (0, 9)),
1263 "timestamp with local time zone": (
"qore":
Type::Date,
"size":
SZ_OPT,
"size_range": (0, 9)),
1264 "interval year to month": (
"qore":
Type::Date,),
1265 "interval day to second": (
"qore":
Type::Date,),
1276 "timestamp(0) with time zone": (
"qore":
Type::Date,),
1277 "timestamp(1) with time zone": (
"qore":
Type::Date,),
1278 "timestamp(2) with time zone": (
"qore":
Type::Date,),
1279 "timestamp(3) with time zone": (
"qore":
Type::Date,),
1280 "timestamp(4) with time zone": (
"qore":
Type::Date,),
1281 "timestamp(5) with time zone": (
"qore":
Type::Date,),
1282 "timestamp(6) with time zone": (
"qore":
Type::Date,),
1283 "timestamp(7) with time zone": (
"qore":
Type::Date,),
1284 "timestamp(8) with time zone": (
"qore":
Type::Date,),
1285 "timestamp(9) with time zone": (
"qore":
Type::Date,),
1286 "timestamp(0) with local time zone": (
"qore":
Type::Date,),
1287 "timestamp(1) with local time zone": (
"qore":
Type::Date,),
1288 "timestamp(2) with local time zone": (
"qore":
Type::Date,),
1289 "timestamp(3) with local time zone": (
"qore":
Type::Date,),
1290 "timestamp(4) with local time zone": (
"qore":
Type::Date,),
1291 "timestamp(5) with local time zone": (
"qore":
Type::Date,),
1292 "timestamp(6) with local time zone": (
"qore":
Type::Date,),
1293 "timestamp(7) with local time zone": (
"qore":
Type::Date,),
1294 "timestamp(8) with local time zone": (
"qore":
Type::Date,),
1295 "timestamp(9) with local time zone": (
"qore":
Type::Date,),
1296 "interval year(0) to month": (
"qore":
Type::Date,),
1297 "interval year(1) to month": (
"qore":
Type::Date,),
1298 "interval year(2) to month": (
"qore":
Type::Date,),
1299 "interval year(3) to month": (
"qore":
Type::Date,),
1300 "interval year(4) to month": (
"qore":
Type::Date,),
1301 "interval year(5) to month": (
"qore":
Type::Date,),
1302 "interval year(6) to month": (
"qore":
Type::Date,),
1303 "interval year(7) to month": (
"qore":
Type::Date,),
1304 "interval year(8) to month": (
"qore":
Type::Date,),
1305 "interval year(9) to month": (
"qore":
Type::Date,),
1306 "interval day(0) to second(0)": (
"qore":
Type::Date,),
1307 "interval day(0) to second(1)": (
"qore":
Type::Date,),
1308 "interval day(0) to second(2)": (
"qore":
Type::Date,),
1309 "interval day(0) to second(3)": (
"qore":
Type::Date,),
1310 "interval day(0) to second(4)": (
"qore":
Type::Date,),
1311 "interval day(0) to second(5)": (
"qore":
Type::Date,),
1312 "interval day(0) to second(6)": (
"qore":
Type::Date,),
1313 "interval day(0) to second(7)": (
"qore":
Type::Date,),
1314 "interval day(0) to second(8)": (
"qore":
Type::Date,),
1315 "interval day(0) to second(9)": (
"qore":
Type::Date,),
1316 "interval day(1) to second(0)": (
"qore":
Type::Date,),
1317 "interval day(1) to second(1)": (
"qore":
Type::Date,),
1318 "interval day(1) to second(2)": (
"qore":
Type::Date,),
1319 "interval day(1) to second(3)": (
"qore":
Type::Date,),
1320 "interval day(1) to second(4)": (
"qore":
Type::Date,),
1321 "interval day(1) to second(5)": (
"qore":
Type::Date,),
1322 "interval day(1) to second(6)": (
"qore":
Type::Date,),
1323 "interval day(1) to second(7)": (
"qore":
Type::Date,),
1324 "interval day(1) to second(8)": (
"qore":
Type::Date,),
1325 "interval day(1) to second(9)": (
"qore":
Type::Date,),
1326 "interval day(2) to second(0)": (
"qore":
Type::Date,),
1327 "interval day(2) to second(1)": (
"qore":
Type::Date,),
1328 "interval day(2) to second(2)": (
"qore":
Type::Date,),
1329 "interval day(2) to second(3)": (
"qore":
Type::Date,),
1330 "interval day(2) to second(4)": (
"qore":
Type::Date,),
1331 "interval day(2) to second(5)": (
"qore":
Type::Date,),
1332 "interval day(2) to second(6)": (
"qore":
Type::Date,),
1333 "interval day(2) to second(7)": (
"qore":
Type::Date,),
1334 "interval day(2) to second(8)": (
"qore":
Type::Date,),
1335 "interval day(2) to second(9)": (
"qore":
Type::Date,),
1348 const QoreTypeMap = (
1349 "integer":
"number",
1352 "string":
"varchar2",
1353 "date":
"timestamp(6)",
1360 const OraColumnOpts = (
1368 const OraColumnOptions = AbstractTable::ColumnOptions + OraColumnOpts;
1374 const OraColumnDescOptions = AbstractTable::ColumnDescOptions + OraColumnOpts;
1380 const OracleIndexOptions = AbstractTable::IndexOptions + (
1388 const OracleConstraintOptions = OracleIndexOptions + (
1393 const OracleTableCreationOptions = AbstractTable::TableCreationOptions
1394 + OracleConstraintOptions
1398 const OracleAlignTableOptions = AbstractTable::AlignTableOptions + OracleTableCreationOptions;
1405 const OracleSelectOptions = AbstractTable::SelectOptions + (
1412 "code":
string (
object t,
string cn, softlist arg, reference args, *hash jch,
bool join =
False, *hash ch, *hash psch) {
1422 ListIterator it(arg);
1431 return cn +
" in (select column_value from table(%v))";
1432 throw "MISSING-ORACLE-DRIVER",
"op_in requires oracle driver";
1436 "code":
string (
object t,
string cn, any arg, reference args, *hash jch,
bool join =
False, *hash ch, *hash psch) {
1442 return sprintf(
"substr(%s,%v,%v) = %v", cn);
1451 string name = QoreTypeMap{args[0]} ?? args[0];
1452 hash desc = OraTypeMap{name};
1453 string sql =
sprintf (
"cast (%s as %s", cve, name);
1461 "code":
string (
string cve,
list args) {
1463 return sprintf(
"substr(%s,%d)", cve, args[0]);
1464 return sprintf(
"substr(%s,%d,%d)", cve, args[0], args[1]);
1469 "argoptional":
True,
1470 "code":
string (*
string cve, *
string arg) {
1471 string sql = cve +
" over (";
1473 sql +=
sprintf(
"partition by %s", arg);
1479 "code":
string (
string arg1, any arg) {
1480 return sprintf(
"to_char(%s, 'YYYY')", arg1);
1484 "code":
string (
string arg1, any arg) {
1485 return sprintf(
"to_char(%s, 'YYYY-MM')", arg1);
1489 "code":
string (
string arg1, any arg) {
1490 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", arg1);
1494 "code":
string (
string arg1, any arg) {
1495 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", arg1);
1501 "code":
string (*
string cve, hash arg, reference psch) {
1502 string sql =
sprintf(
"%s.nextval", arg.seq);
1511 "code":
string (*
string cve, hash arg, reference psch) {
1512 string sql =
sprintf(
"%s.currval", arg.seq);
1525 "code":
string (
string cve,
string arg) {
1526 return sprintf(
"%s.nextval", arg);
1532 "code":
string (
string cve,
string arg) {
1533 return sprintf(
"%s.currval", arg);
1542 "code":
string (*
string cve,
string arg) {
1543 return sprintf(
"%s.nextval", arg);
1548 "code":
string (*
string cve,
string arg) {
1549 return sprintf(
"%s.currval", arg);
1555 const OraclePseudoColumnHash = (
1559 "object_value":
True,
1585 bool m_isView =
False;
1589 constructor(AbstractDatasource nds,
string nname, *hash opts) ;
1592 private bool checkExistenceImpl();
1595 private setTableInfoIntern();
1599 string getSqlName();
1606 private hash setSchemaTable();
1609 private setDblinkSchema();
1612 private hash setTable();
1615 private string getUserSchema();
1618 private string getDBString();
1622 string getSchemaName();
1626 *
string getTablespaceName();
1630 *
string getComment();
1636 private hash getColumnOptions();
1639 private hash getColumnDescOptions();
1643 private hash getSelectOptions();
1646 private getSelectWhereSqlUnlocked(reference sql, reference args, *hash qh, *hash jch,
bool join =
False, *hash ch, *hash psch);
1649 private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch, *hash psch,
list coll);
1653 private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh);
1656 private Columns describeImpl();
1662 private Indexes getIndexesImpl();
1665 private ForeignConstraints getForeignConstraintsImpl(*hash opts);
1668 private Constraints getConstraintsImpl();
1671 private string getSelectSqlName(*hash qh);
1674 private Triggers getTriggersImpl();
1677 string getCreateTableSqlImpl(*hash opt);
1680 private *
list getCreateMiscSqlImpl(*hash opt,
bool cache);
1683 private string getCreateSqlImpl(
list l);
1686 private string getRenameSqlImpl(
string new_name);
1689 private AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable =
True);
1692 private AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
1695 private AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
1698 private AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash ch,
string table, hash tch, *hash opt);
1701 private AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
1704 private AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
1707 private AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
1710 private bool tryInsertImpl(
string sql, hash row);
1713 private *
list getAlignSqlImpl(AbstractTable t, *hash opt);
1716 private hash getQoreTypeMapImpl();
1719 private hash getTypeMapImpl();
1722 private hash getIndexOptions();
1725 private hash getConstraintOptions();
1728 private hash getTableCreationOptions();
1731 private hash getAlignTableOptions();
1735 private hash getWhereOperatorMap();
1739 private hash getColumnOperatorMap();
1743 private hash getInsertOperatorMap();
1747 private hash getRawUpdateOperatorMap();
1751 private *hash getPseudoColumnHash();
1755 private *
string getSqlValueImpl(any v);
1759 string getColumnSqlName(
string col);
1763 list getColumnSqlNames(softlist cols);
1770 string getBaseType();
1778 code getUpsertClosure(hash row,
int upsert_strategy =
UpsertAuto, *hash opt);
1782 private code getUpsertInsertOnly(Columns cols, hash row, *hash opt);
1786 private code getUpsertUpdateOnly(Columns cols, hash row, *hash opt);
1790 bool hasArrayBind();
1796 bool bindEmptyStringsAsNull();
1800 private bool asteriskRequiresPrefix();
1803 private *hash doReturningImpl(hash opt, reference sql,
list args);
1806 private bool emptyImpl();
1809 private setupTableImpl(hash desc, *hash opt);
1813 private bool constraintsLinkedToIndexesImpl();
1817 private bool uniqueIndexCreatesConstraintImpl();
1821 private bool supportsTablespacesImpl();
1825 private copyImpl(AbstractTable old);
represents an Oracle unique constraint
Definition: OracleSqlUtil.qm.dox.h:494
represents an Oracle materialized view
Definition: OracleSqlUtil.qm.dox.h:800
string sprintf(string fmt,...)
*string tablespace
the tablespace name of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:416
bool logging
Flag if is loggign mode used.
Definition: OracleSqlUtil.qm.dox.h:805
*string view_type_owner
Owner of the type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:648
represents an Oracle table
Definition: OracleSqlUtil.qm.dox.h:1251
*string tablespace
Name of the potential tablespace.
Definition: OracleSqlUtil.qm.dox.h:809
*string superview_name
Name of the superview.
Definition: OracleSqlUtil.qm.dox.h:652
bool enabled
True if the trigger is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:681
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:443
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:471
represents an Oracle procedure
Definition: OracleSqlUtil.qm.dox.h:761
number number(softnumber n)
hash uop_substr(int start, *int count, *hash nest)
*string tablespace
any tablespace for the unique key index
Definition: OracleSqlUtil.qm.dox.h:502
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:499
represents an Oracle view
Definition: OracleSqlUtil.qm.dox.h:639
hash op_substr(int start, *int count, string text)
int index(softstring str, softstring substr, softint pos=0)
hash cop_cast(any column, string arg, *any arg1, *any arg2)
hash cop_substr(any column, int start, *int count)
date microseconds(softint us)
*string oid_text
WITH OID clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:646
bool use_index
Flag if is index used.
Definition: OracleSqlUtil.qm.dox.h:807
the Oracle specialization for SqlUtil::AbstractDatabase
Definition: OracleSqlUtil.qm.dox.h:832
int byte_size
byte size of the column
Definition: OracleSqlUtil.qm.dox.h:341
represents an Oracle check constraint
Definition: OracleSqlUtil.qm.dox.h:466
represents an Oracle number column
Definition: OracleSqlUtil.qm.dox.h:397
represents an Oracle package
Definition: OracleSqlUtil.qm.dox.h:773
string string(softstring str, *string enc)
represents an Oracle column
Definition: OracleSqlUtil.qm.dox.h:334
*string type_text
Type clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:644
OracleDatabase get_database(AbstractDatasource nds, *hash opts)
returns an OracleDatabase object corresponding to the arguments
hash join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash opt)
*string body_src
package body source
Definition: OracleSqlUtil.qm.dox.h:778
hash cop_seq(string seq, *string as)
string getBaseType()
returns the base type of the underlying object (either "table" or "view")
*string tablespace
any tablespace for the primary key index
Definition: OracleSqlUtil.qm.dox.h:564
*string view_type
Type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:650
represents an Oracle sequence
Definition: OracleSqlUtil.qm.dox.h:622
represents an Oracle trigger
Definition: OracleSqlUtil.qm.dox.h:676
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:654
const OracleSchemaDescriptionOptions
oracle-specific schema description keys
Definition: OracleSqlUtil.qm.dox.h:856
represents an Oracle foreign constraint
Definition: OracleSqlUtil.qm.dox.h:438
hash cop_seq_currval(string seq, *string as)
represents an Oracle type
Definition: OracleSqlUtil.qm.dox.h:730
represents an Oracle primary key
Definition: OracleSqlUtil.qm.dox.h:559
string native_type
the native type of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:413
string join(string str,...)
represents an Oracle index
Definition: OracleSqlUtil.qm.dox.h:408
bool char_used
the column uses character semantics
Definition: OracleSqlUtil.qm.dox.h:339
represents an Oracle function
Definition: OracleSqlUtil.qm.dox.h:749
the base class for Oracle code objects
Definition: OracleSqlUtil.qm.dox.h:705