178 constructor(AbstractDatasource ds, *
string savepoint =
'x' + get_random_string(29)) ;
224 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm,
bool is_char = False,
bool cu = False, softint bs, *
int scale)
293 constructor(
string n,
string nt, *
string qt, softint sz,
bool nul, *
string dv, *
string cm, softint bs, softint
scale = 0) ;
331 constructor(
string n, Columns c, ForeignConstraintTarget t,
bool e) ;
334 string getCreateSql(
string table_name, *hash opt);
337 softlist getRenameSql(
string table_name,
string new_name);
356 constructor(
string n,
string n_src,
bool e = True) ;
359 string getCreateSql(
string table_name, *hash opt);
362 softlist getRenameSql(
string table_name,
string new_name);
387 constructor(
string n, hash n_cols,
bool e = True, *
string ts) ;
410 bool setIndexBase(
string ix);
417 string getCreateSql(
string table_name, *hash opts);
420 softlist getRenameSql(
string table_name,
string new_name);
453 constructor(
string n, *hash c, *
string ts) ;
476 bool setIndexBase(
string ix);
483 string getCreateSql(
string table_name, *hash opts);
486 softlist getRenameSql(
string table_name,
string new_name);
509 constructor(
string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
543 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)
567 constructor(
string n,
string n_src,
bool en = True) ;
570 softlist getCreateSql(
string table_name, *hash opt);
719 constructor(
string n,
string n_src,
bool n_logging = True,
bool n_use_index = True, *
string n_tablespace) ;
726 bool equalImpl(AbstractFunctionBase t);
790 list<string> featuresImpl();
795 OracleSequence makeSequenceImpl(
string name, number start = 1, number increment = 1, *softnumber end, *hash
opts);
800 getSchemaName(reference<string> name, reference<string> schema);
805 *AbstractSequence getSequenceImpl(
string name);
810 *AbstractView getViewImpl(
string name);
840 OracleMaterializedView makeMaterializedView(
string name,
string src,
bool logging = True,
bool use_index = True, *
string tablespace, *hash
opts);
850 list<auto> getDropSchemaSqlImpl(hash<auto> schema_hash, *hash<auto> opt);
855 list getAlignSqlImpl(hash schema_hash, *hash opt);
882 *
string getSource(
string type,
string name);
887 checkSource(
string type,
string name, reference<string> src);
924 list<string> listTablesImpl();
929 list<string> listFunctionsImpl();
934 list<string> listProceduresImpl();
939 list<string> listSequencesImpl();
944 list<string> listViewsImpl();
949 list<string> getListIntern(
string type);
954 list<string> getListIntern(list<auto>
l);
959 string getCreateSqlImpl(list
l);
963 static string getCreateSql(list
l);
1094 oracleErrorCallback(
int ac,
string type,
string name, *
string table, *
string new_name, *
string info,
string sql, hash<ExceptionInfo> ex);
1107 "number": (
"qore": Type::Number,
"size": SZ_NUM,
"size_range": (1, 38),
"scale_range": (-84, 127)),
1109 "qore": Type::String,
1111 "size_range": (1, 4000),
1113 "default_size": AbstractColumn::DefaultVarcharSize,
1116 "qore": Type::String,
1118 "size_range": (1, 4000),
1120 "default_size": AbstractColumn::DefaultVarcharSize,
1122 "date": (
"qore": Type::Date,),
1123 "timestamp": (
"qore": Type::Date,
"size": SZ_OPT,
"size_range": (0, 9)),
1124 "timestamp with time zone": (
"qore": Type::Date,
"size": SZ_OPT,
"size_range": (0, 9)),
1125 "timestamp with local time zone": (
"qore": Type::Date,
"size": SZ_OPT,
"size_range": (0, 9)),
1126 "interval year to month": (
"qore": Type::Date,),
1127 "interval day to second": (
"qore": Type::Date,),
1128 "timestamp(0)": (
"qore": Type::Date,),
1129 "timestamp(1)": (
"qore": Type::Date,),
1130 "timestamp(2)": (
"qore": Type::Date,),
1131 "timestamp(3)": (
"qore": Type::Date,),
1132 "timestamp(4)": (
"qore": Type::Date,),
1133 "timestamp(5)": (
"qore": Type::Date,),
1134 "timestamp(6)": (
"qore": Type::Date,),
1135 "timestamp(7)": (
"qore": Type::Date,),
1136 "timestamp(8)": (
"qore": Type::Date,),
1137 "timestamp(9)": (
"qore": Type::Date,),
1138 "timestamp(0) with time zone": (
"qore": Type::Date,),
1139 "timestamp(1) with time zone": (
"qore": Type::Date,),
1140 "timestamp(2) with time zone": (
"qore": Type::Date,),
1141 "timestamp(3) with time zone": (
"qore": Type::Date,),
1142 "timestamp(4) with time zone": (
"qore": Type::Date,),
1143 "timestamp(5) with time zone": (
"qore": Type::Date,),
1144 "timestamp(6) with time zone": (
"qore": Type::Date,),
1145 "timestamp(7) with time zone": (
"qore": Type::Date,),
1146 "timestamp(8) with time zone": (
"qore": Type::Date,),
1147 "timestamp(9) with time zone": (
"qore": Type::Date,),
1148 "timestamp(0) with local time zone": (
"qore": Type::Date,),
1149 "timestamp(1) with local time zone": (
"qore": Type::Date,),
1150 "timestamp(2) with local time zone": (
"qore": Type::Date,),
1151 "timestamp(3) with local time zone": (
"qore": Type::Date,),
1152 "timestamp(4) with local time zone": (
"qore": Type::Date,),
1153 "timestamp(5) with local time zone": (
"qore": Type::Date,),
1154 "timestamp(6) with local time zone": (
"qore": Type::Date,),
1155 "timestamp(7) with local time zone": (
"qore": Type::Date,),
1156 "timestamp(8) with local time zone": (
"qore": Type::Date,),
1157 "timestamp(9) with local time zone": (
"qore": Type::Date,),
1158 "interval year(0) to month": (
"qore": Type::Date,),
1159 "interval year(1) to month": (
"qore": Type::Date,),
1160 "interval year(2) to month": (
"qore": Type::Date,),
1161 "interval year(3) to month": (
"qore": Type::Date,),
1162 "interval year(4) to month": (
"qore": Type::Date,),
1163 "interval year(5) to month": (
"qore": Type::Date,),
1164 "interval year(6) to month": (
"qore": Type::Date,),
1165 "interval year(7) to month": (
"qore": Type::Date,),
1166 "interval year(8) to month": (
"qore": Type::Date,),
1167 "interval year(9) to month": (
"qore": Type::Date,),
1168 "interval day(0) to second(0)": (
"qore": Type::Date,),
1169 "interval day(0) to second(1)": (
"qore": Type::Date,),
1170 "interval day(0) to second(2)": (
"qore": Type::Date,),
1171 "interval day(0) to second(3)": (
"qore": Type::Date,),
1172 "interval day(0) to second(4)": (
"qore": Type::Date,),
1173 "interval day(0) to second(5)": (
"qore": Type::Date,),
1174 "interval day(0) to second(6)": (
"qore": Type::Date,),
1175 "interval day(0) to second(7)": (
"qore": Type::Date,),
1176 "interval day(0) to second(8)": (
"qore": Type::Date,),
1177 "interval day(0) to second(9)": (
"qore": Type::Date,),
1178 "interval day(1) to second(0)": (
"qore": Type::Date,),
1179 "interval day(1) to second(1)": (
"qore": Type::Date,),
1180 "interval day(1) to second(2)": (
"qore": Type::Date,),
1181 "interval day(1) to second(3)": (
"qore": Type::Date,),
1182 "interval day(1) to second(4)": (
"qore": Type::Date,),
1183 "interval day(1) to second(5)": (
"qore": Type::Date,),
1184 "interval day(1) to second(6)": (
"qore": Type::Date,),
1185 "interval day(1) to second(7)": (
"qore": Type::Date,),
1186 "interval day(1) to second(8)": (
"qore": Type::Date,),
1187 "interval day(1) to second(9)": (
"qore": Type::Date,),
1188 "interval day(2) to second(0)": (
"qore": Type::Date,),
1189 "interval day(2) to second(1)": (
"qore": Type::Date,),
1190 "interval day(2) to second(2)": (
"qore": Type::Date,),
1191 "interval day(2) to second(3)": (
"qore": Type::Date,),
1192 "interval day(2) to second(4)": (
"qore": Type::Date,),
1193 "interval day(2) to second(5)": (
"qore": Type::Date,),
1194 "interval day(2) to second(6)": (
"qore": Type::Date,),
1195 "interval day(2) to second(7)": (
"qore": Type::Date,),
1196 "interval day(2) to second(8)": (
"qore": Type::Date,),
1197 "interval day(2) to second(9)": (
"qore": Type::Date,),
1198 "clob": (
"qore": Type::String,),
1199 "blob": (
"qore": Type::Binary,),
1200 "long": (
"qore": Type::Binary,),
1201 "raw": (
"qore": Type::Binary,
"size": SZ_MAND,
"size_range": (1, 2000)),
1202 "bfile": (
"qore": Type::Binary,),
1203 "binary_float": (
"qore": Type::Float,),
1204 "binary_double": (
"qore": Type::Float,),
1205 "rowid": (
"qore": Type::String,),
1206 "urowid": (
"qore": Type::String,
"size": SZ_OPT,
"size_range": (1, 4000)),
1211 "integer":
"number",
1214 "string":
"varchar2",
1215 "date":
"timestamp(6)",
1222 const OraColumnOpts = {
1223 "character_semantics": Type::Boolean,
1243 "compute_statistics": Type::Boolean,
1251 "index": Type::String,
1266 "partition": Type::String,
1271 OP_SUBSTR: DefaultExpressionMap{OP_SUBSTR} + {
1272 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1273 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1274 AbstractDataProviderTypeMap.
"string");
1275 string exp1 = info.table.getExpressionArg(\info, role, args[1],
1276 AbstractDataProviderTypeMap.
"int");
1277 if (!exists args[2]) {
1278 return sprintf(
"substr(%s,%s)", exp0, exp1);
1280 return sprintf(
"substr(%s,%s,%s)", exp0, exp1,
1281 info.table.getExpressionArg(\info, role, args[2], AbstractDataProviderTypeMap.
"int"));
1285 "exp": <DataProviderExpressionInfo>{
1286 "type": DET_Operator,
1289 "desc":
"cast operator",
1292 DataProviderSignatureAnyType,
1293 DataProviderSignatureStringValueType,
1294 DataProviderSignatureOptionalIntValueType,
1295 DataProviderSignatureOptionalIntValueType,
1297 "return_type": AbstractDataProviderTypeMap.
"any",
1299 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1300 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1301 AbstractDataProviderTypeMap.
"any");
1304 string sql = sprintf (
"cast (%s as %s", exp0,
name);
1305 if (desc.size == SZ_MAND) {
1306 if (!exists args[1] && !exists desc.size_range)
1307 throw "OPERATOR-ERROR", sprintf (
"cast operator missing size for type %s",
1309 sql += sprintf(
"(%d)", args[1] ?? desc.size_range[1]);
1310 }
else if (desc.size == SZ_NUM && exists args[1]) {
1311 sql += sprintf(
"(%d", args[1]);
1312 sql += exists args[2] ? sprintf(
",%d)", args[2]) :
")";
1313 }
else if (desc.size == SZ_OPT && exists args[1]) {
1314 sql += sprintf(
"(%d)", args[1]);
1321 "exp": <DataProviderExpressionInfo>{
1322 "type": DET_Operator,
1325 "desc":
"returns the year component of a date as a string (ex: `2022`)",
1328 DataProviderSignatureDateType,
1330 "return_type": AbstractDataProviderTypeMap.
"string",
1332 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1333 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1334 AbstractDataProviderTypeMap.
"date");
1335 return sprintf(
"to_char(%s, 'YYYY')", exp0);
1339 "exp": <DataProviderExpressionInfo>{
1340 "type": DET_Operator,
1341 "label": COP_YEAR_MONTH,
1342 "name": COP_YEAR_MONTH,
1343 "desc":
"returns the year and month components of a date as a string (ex: `2022-06`)",
1344 "symbol": COP_YEAR_MONTH,
1346 DataProviderSignatureDateType,
1348 "return_type": AbstractDataProviderTypeMap.
"string",
1350 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1351 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1352 AbstractDataProviderTypeMap.
"date");
1353 return sprintf(
"to_char(%s, 'YYYY-MM')", exp0);
1357 "exp": <DataProviderExpressionInfo>{
1358 "type": DET_Operator,
1359 "label": COP_YEAR_DAY,
1360 "name": COP_YEAR_DAY,
1361 "desc":
"returns the year, month, and day components of a date as a string (ex: `2022-06-29`)",
1362 "symbol": COP_YEAR_DAY,
1364 DataProviderSignatureDateType,
1366 "return_type": AbstractDataProviderTypeMap.
"string",
1368 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1369 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1370 AbstractDataProviderTypeMap.
"date");
1371 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", exp0);
1375 "exp": <DataProviderExpressionInfo>{
1376 "type": DET_Operator,
1377 "label": COP_YEAR_HOUR,
1378 "name": COP_YEAR_HOUR,
1379 "desc":
"returns the year, month, day, and hour components of a date as a string "
1380 "(ex: `2022-06-29 15`)",
1381 "symbol": COP_YEAR_HOUR,
1383 DataProviderSignatureDateType,
1385 "return_type": AbstractDataProviderTypeMap.
"string",
1387 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1388 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1389 AbstractDataProviderTypeMap.
"date");
1390 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", exp0);
1394 "exp": <DataProviderExpressionInfo>{
1395 "type": DET_Operator,
1396 "label": COP_TRUNC_DATE,
1397 "name": COP_TRUNC_DATE,
1398 "desc":
"truncates the given date to the given resolution; args: date, string code: Y: year, "
1399 "M: month, D: day, H: hour, m: minute, S: second",
1400 "symbol": COP_TRUNC_DATE,
1402 DataProviderSignatureDateType,
1403 DataProviderSignatureStringValueType,
1405 "return_type": AbstractDataProviderTypeMap.
"date",
1407 "code":
string sub(reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1410 throw "TRUNC-DATE-ERROR", sprintf(
"unknown date truncation format argument %y; "
1411 "supported date format arguments: %y", args[1], keys
OracleTruncDate);
1413 string exp0 = info.table.getExpressionArg(\info, role, args[0],
1414 AbstractDataProviderTypeMap.
"date");
1416 return sprintf(
"trunc(%s, %s)", exp0, str);
1419 return sprintf(
"cast (%s as date)", exp0);
1423 "exp": <DataProviderExpressionInfo>{
1424 "type": DET_Operator,
1427 "desc":
"returns True if the first value is in the list of following values",
1430 DataProviderSignatureAnyType,
1431 DataProviderSignatureAnyType,
1434 "return_type": AbstractDataProviderTypeMap.
"bool",
1436 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1438 auto val = shift args;
1439 # Qorus bug #989 SqlUtil: oracle op_in can fail in large amount of input elements
1440 # There is no support for CLOBs in WHERE clause in Oracle at all.
1441 # Binding large strings (over 4000 chars is performed by a CLOB in Qore driver.
1442 # Result of op_in operator can be "ORA-00932: inconsistent datatypes" if is
1443 # the list longer or if it contains large items with:
1444 # return cn + " in (select regexp_substr(%v,'[^,]+', 1, level) from dual connect by
1445 # regexp_substr(%v, '[^,]+', 1, level) is not null)";
1447 # determine list members type. Let's assume the 1st non NULL/NOTHING
1448 # element gives the type code for all elements.
1449 ListIterator it(args);
1450 # get list type code
1453 switch (it.getValue().typeCode()) {
1462 ltype = it.getValue().typeCode();
1465 throw "ORACLE-IN-OPERATOR-ERROR", sprintf(
"the \"in\" operator unexpected list "
1466 "element type: %s; only simple types are supported", it.getValue().type());
1473 # Split long array to chunks of no more than 32767 elements due to Oracle limitation
1474 # "ORA-22165: OCI-22165: given index [32767] must be in the range of [0] to [32766]"
1478 list<auto> chunk = extract args, 0, 32767;
1480 # Bind to Oracle by expected type
1483 info.args += bindOracleCollection(
"SYS.ODCIDATELIST", chunk);
1488 info.args += bindOracleCollection(
"SYS.ODCINUMBERLIST", chunk);
1491 info.args += bindOracleCollection(
"SYS.ODCIVARCHAR2LIST", chunk);
1496 string exp0 = info.table.getExpressionArg(\info, role, val,
1497 AbstractDataProviderTypeMap.
"date");
1498 return exp0 +
" in (" + (map
"select column_value from table(%v)",
1499 xrange(count)).join(
" union all ") +
")";
1504 throw "MISSING-ORACLE-DRIVER",
"requires the oracle driver";
1509 "exp": <DataProviderExpressionInfo>{
1510 "type": DET_Operator,
1513 "desc":
"returns the next value in the given sequence; args: sequence name",
1516 DataProviderSignatureStringValueType,
1518 "return_type": AbstractDataProviderTypeMap.
"int",
1520 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1521 return sprintf(
"%s.nextval", args[0]);
1525 "exp": <DataProviderExpressionInfo>{
1526 "type": DET_Operator,
1527 "label": COP_SEQ_CURRVAL,
1528 "name": COP_SEQ_CURRVAL,
1529 "desc":
"returns the current value in the given sequence; args: sequence name",
1530 "symbol": COP_SEQ_CURRVAL,
1532 DataProviderSignatureStringValueType,
1534 "return_type": AbstractDataProviderTypeMap.
"int",
1536 "code":
string sub (reference<hash<QueryInfo>> info,
int role, list<auto> args) {
1537 return sprintf(
"%s.currval", args[0]);
1567 "object_value": True,
1591 bool m_isView = False;
1596 hash<string, string> m_sys_views = {
1597 "dba_col_comments" :
"all_col_comments",
1598 "dba_cons_columns" :
"all_cons_columns",
1599 "dba_constraints" :
"all_constraints",
1600 "dba_db_links" :
"all_db_links",
1601 "dba_ind_columns" :
"all_ind_columns",
1602 "dba_ind_expressions" :
"all_ind_expressions",
1603 "dba_indexes" :
"all_indexes",
1604 "dba_objects" :
"all_objects",
1605 "dba_sequences" :
"all_sequences",
1606 "dba_synonyms" :
"all_synonyms",
1607 "dba_tab_columns" :
"all_tab_columns",
1608 "dba_tab_comments" :
"all_tab_comments",
1609 "dba_tables" :
"all_tables",
1610 "dba_triggers" :
"all_triggers",
1611 "dba_views" :
"all_views",
1622 string systemView(
string name);
1627 bool checkExistenceImpl();
1632 setTableInfoIntern();
1645 hash<auto> setSchemaTable();
1658 *hash resolveSynonym(
string s_owner,
string s_name);
1663 hash<auto> setTable();
1668 string getUserSchema();
1673 string getDBString();
1693 hash<auto> getColumnOptions();
1698 hash<auto> getColumnDescOptions();
1717 insertLimitOptimizerHint(hash<auto> qh, reference<string> sql);
1722 doSelectOrderByWithOffsetSqlUnlockedImpl(reference<hash<QueryInfo>> info, reference<string> sql, list<auto> coll);
1733 Columns describeImpl();
1743 Indexes getIndexesImpl();
1748 ForeignConstraints getForeignConstraintsImpl(*hash
opts);
1753 Constraints getConstraintsImpl();
1758 string getSelectSqlName(*hash qh);
1763 Triggers getTriggersImpl();
1767 string getCreateTableSqlImpl(*hash opt);
1779 *list getCreateMiscSqlImpl(*hash opt,
bool cache);
1784 string getCreateSqlImpl(list
l);
1789 string getRenameSqlImpl(
string new_name);
1794 AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable = True);
1799 AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
1804 AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
1809 AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash ch,
string table, hash tch, *hash opt);
1814 AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
1819 AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
1824 AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
1829 bool tryInsertImpl(
string sql, hash<auto> row);
1842 *list getAlignSqlImpl(AbstractTable t, *hash opt);
1847 hash<auto> getQoreTypeMapImpl();
1852 hash<auto> getTypeMapImpl();
1857 hash<auto> getIndexOptions();
1862 hash<auto> getConstraintOptions();
1867 hash<auto> getTableCreationOptions();
1872 hash<auto> getAlignTableOptions();
1958 *hash doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
1968 setupTableImpl(hash<auto> desc, *hash<auto> opt);
represents an Oracle check constraint
Definition: OracleSqlUtil.qm.dox.h:350
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:354
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
the base class for Oracle code objects
Definition: OracleSqlUtil.qm.dox.h:587
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
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
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: OracleSqlUtil.qm.dox.h:618
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: OracleSqlUtil.qm.dox.h:210
bool char_used
the column uses character semantics
Definition: OracleSqlUtil.qm.dox.h:214
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
constructor()
empty constructor for subclasses
list< string > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
int byte_size
byte size of the column
Definition: OracleSqlUtil.qm.dox.h:216
string getDdlName(string name)
returns the column name with quoting in case the column name is a reserved word
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
string getNativeTypeString()
returns the string describing the native type that can be used in SQL
the Oracle specialization for SqlUtil::AbstractDatabase
Definition: OracleSqlUtil.qm.dox.h:731
bool supportsSequencesImpl()
returns True if the database supports sequences
int getPhysicalSizeImpl()
SqlUtil::AbstractDatabase::getPhysicalSize()
softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
const OracleMaxPrecision
MAximum precision for Oracle NUMBER columns.
Definition: OracleSqlUtil.qm.dox.h:775
const OracleSchemaDescriptionOptions
oracle-specific schema description keys
Definition: OracleSqlUtil.qm.dox.h:751
const OracleAlignSchemaOptions
oracle-specific schema description / alignment options
Definition: OracleSqlUtil.qm.dox.h:739
reclaimSpaceImpl(*hash options)
reclaim space implementation. See SqlUtil::AbstractDatabase::reclaimSpace()
constructor(AbstractDatasource nds, *hash opts)
creates the object from the arguments given
hash< auto > getRebuildIndexOptions()
returns driver-specific options to the base abstract class
computeStatisticsTablesImpl(*hash options)
compute statistics for table(s) - a helper method
list< string > listTypes()
returns a list of string type names in the database
hash< auto > getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
ListIterator materializedViewIterator()
returns an iterator listing the string materialized view names in the database
const OracleComputeStatisticsOptions
Options for computeStatistics()
Definition: OracleSqlUtil.qm.dox.h:771
ListIterator synonymIterator()
returns an iterator listing the string synonym names in the database
const OracleMaterializedViewDescriptionOptions
oracle-specific materialized view description options
Definition: OracleSqlUtil.qm.dox.h:759
bool supportsPackagesImpl()
returns True if the database supports packages
const OraclePackageDescriptionOptions
oracle-specific package description options
Definition: OracleSqlUtil.qm.dox.h:755
*OracleType getType(string name)
returns an OracleType object for the package name given or NOTHING if the object does not exist or is...
bool rebuildIndexAnalyze(string name, int maxh, int maxleaf)
analyze index with ALTER INDEX ANAYZE. Then it checks INDEX_STATS for advices to rebuild.
int getMaximumPrecision()
Returns the maximum precision for numeric or decimal columns.
computeStatisticsSchemaImpl(*hash options)
compute statistics for schema - a helper method
bool rebuildIndexImpl(string name, *hash options)
rebuild index implementation. See SqlUtil::AbstractDatabase::rebuildIndex()
bool supportsTypesImpl()
returns True if the database supports named types
bool rebuildIndexAnalyze(AbstractIndex index, int maxh, int maxleaf)
analyze index with ALTER INDEX ANAYZE. Then it checks INDEX_STATS for advices to rebuild.
computeStatisticsImpl(*hash options)
compute statistics implementation. See SqlUtil::AbstractDatabase::computeStatistics()
list< string > listMaterializedViews()
returns a list of string materialized view names in the database
softint getCurrentSequenceValueImpl(string name)
returns the last value issued for the given sequence in the current session
const OracleRebuildIndexOptions
Options for rebuildIndex()
Definition: OracleSqlUtil.qm.dox.h:767
list< string > listSynonyms()
returns a list of string synonym names in the database
ListIterator typeIterator()
returns an iterator listing the string type names in the database
list< string > listPackages()
returns a list of string package names in the database
const OracleReservedWords
hash of reserved words
Definition: OracleSqlUtil.qm.dox.h:763
hash< auto > getCreationOptions()
returns driver-specific options to the base abstract class
*OraclePackage getPackage(string name)
returns an OraclePackage object for the package name given or NOTHING if the object does not exist or...
hash< auto > getComputeStatisticsOptions()
returns driver-specific options to the base abstract class
const OracleCreationOptions
oracle-specific generic creation options
Definition: OracleSqlUtil.qm.dox.h:735
ListIterator packageIterator()
returns an iterator listing the string package names in the database
*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
represents an Oracle foreign constraint
Definition: OracleSqlUtil.qm.dox.h:325
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: OracleSqlUtil.qm.dox.h:329
represents an Oracle function
Definition: OracleSqlUtil.qm.dox.h:654
constructor(string n, string n_src)
creates the object from the arguments passed
represents an Oracle index
Definition: OracleSqlUtil.qm.dox.h:298
string native_type
the native type of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:302
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
constructor(string n, bool u, hash c, string nt, *string t)
creates the object from the arguments
*string tablespace
the tablespace name of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:305
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
represents an Oracle materialized view
Definition: OracleSqlUtil.qm.dox.h:702
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
bool use_index
Flag if is index used.
Definition: OracleSqlUtil.qm.dox.h:708
*string tablespace
Name of the potential tablespace.
Definition: OracleSqlUtil.qm.dox.h:710
bool logging
Flag if is loggign mode used.
Definition: OracleSqlUtil.qm.dox.h:706
softlist getCreateSql(*hash opt)
returns a string that can be used to create the object in the database
represents an Oracle number column
Definition: OracleSqlUtil.qm.dox.h:290
the data type for Oracle NUMBER columns
Definition: OracleSqlUtil.qm.dox.h:201
constructor(string native_type, bool nullable, *hash< auto > options)
creates the object
represents an Oracle package
Definition: OracleSqlUtil.qm.dox.h:678
list getCreateSql(*hash opt)
returns a string that can be used to create the package in the database
*string body_src
package body source
Definition: OracleSqlUtil.qm.dox.h:682
constructor(string n, string n_src, *string n_body_src)
creates the object from the arguments passed
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
represents an Oracle primary key
Definition: OracleSqlUtil.qm.dox.h:441
*string tablespace
any tablespace for the primary key index
Definition: OracleSqlUtil.qm.dox.h:446
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
OracleColumn memberGate(string k)
returns the OracleColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
clearIndex()
clears any index base for the constraint
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database
represents an Oracle procedure
Definition: OracleSqlUtil.qm.dox.h:666
constructor(string n, string n_src)
creates the object from the arguments passed
Oracle savepoint helper.
Definition: OracleSqlUtil.qm.dox.h:170
createSavepointImpl()
Creates the savepoint.
deleteSavepointImpl()
Deletes 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: OracleSqlUtil.qm.dox.h:505
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
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
represents an Oracle table
Definition: OracleSqlUtil.qm.dox.h:1102
const OracleUopMap
a hash of default update operator definitions for Oracle
Definition: OracleSqlUtil.qm.dox.h:1559
hash< auto > getSelectOptions()
override in subclasses to return driver-specific options
bool hasArrayBind()
returns True because the oracle driver supports array binds / bulk DML operations
const OracleExpressionMap
Oracle Expression map.
Definition: OracleSqlUtil.qm.dox.h:1270
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
code getUpsertInsertOnly(Columns cols, hash< auto > row, *hash opt)
high-performance "insert only" upsert supporting bulk DML
const OraColumnOptions
Oracle-specific column options.
Definition: OracleSqlUtil.qm.dox.h:1230
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
copyImpl(AbstractTable old)
db-specific copy actions
const OraTypeMap
maps oracle type names to type descriptions
Definition: OracleSqlUtil.qm.dox.h:1106
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...
*string getComment()
returns any table comment or NOTHING if none is known
const OracleTableCreationOptions
Oracle table creation options.
Definition: OracleSqlUtil.qm.dox.h:1255
const OracleOpMap
where operator specializations for Oracle
Definition: OracleSqlUtil.qm.dox.h:1543
code getBulkUpsertClosure(hash example_row, int upsert_strategy=AbstractTable::UpsertAuto, *hash opt)
Oracle always supports bulk merging.
string getSchemaName()
returns the schema name
*string getTablespaceName()
returns the data tablespace name for the table if any or NOTHING if none is known
const OraColumnDescOptions
Oracle-specific column options.
Definition: OracleSqlUtil.qm.dox.h:1236
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
bool optimizedLimit(*hash< auto > qh)
Returns True if the current connection supports optimized limit option handling.
const QoreTypeMap
maps qore type names to an oracle type
Definition: OracleSqlUtil.qm.dox.h:1210
hash< auto > getExpressionMap()
Returns the expression map for Oracle.
const OracleIndexOptions
Oracle-specific index options.
Definition: OracleSqlUtil.qm.dox.h:1242
bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
const OracleConstraintOptions
Oracle-specific constraint options.
Definition: OracleSqlUtil.qm.dox.h:1250
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
hash< auto > getInsertOperatorMap()
returns the insert operator map for this object
bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
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...
bool supportsTablespacesImpl()
returns True if the database support tablespaces
string getSqlName()
returns the schema and table name in dot notation
const OracleSelectOptions
Oracle select options.
Definition: OracleSqlUtil.qm.dox.h:1265
const OracleCopMap
column operator specializations for Oracle
Definition: OracleSqlUtil.qm.dox.h:1547
const OraclePseudoColumnHash
a hash of valid pseudocolumns
Definition: OracleSqlUtil.qm.dox.h:1563
doSelectLimitOnlyUnlockedImpl(reference< hash< QueryInfo > > info, reference< string > sql)
processes a string for use in SQL select statements when there is a "limit" argument,...
list getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
hash< auto > getWhereOperatorMap()
returns the "where" operator map for Oracle
*string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
string getBaseType()
returns the base type of the underlying object (either "table" or "view")
bool isView()
This method can change itself or disappear in the near future. Do not use it.
const OracleTruncDate
Map SqlUtil::cop_trunc_date() constants to Oracle internal masks.
Definition: OracleSqlUtil.qm.dox.h:1551
bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
bool bindEmptyStringsAsNull()
returns True because Oracle treats empty strings like NULL on insert
code getUpsertUpdateOnly(Columns cols, hash< auto > row, *hash opt)
high-performance "update only" upsert supporting bulk DML
const OracleIopMap
a hash of default value operator descriptions for Oracle
Definition: OracleSqlUtil.qm.dox.h:1555
hash< auto > getColumnOperatorMapImpl()
returns the column operator map for this object
represents an Oracle trigger
Definition: OracleSqlUtil.qm.dox.h:561
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
bool enabled
True if the trigger is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:565
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
represents an Oracle type
Definition: OracleSqlUtil.qm.dox.h:640
string getDropSql(*hash opt)
returns a string that can be used to drop the type from the database
represents an Oracle unique constraint
Definition: OracleSqlUtil.qm.dox.h:375
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: OracleSqlUtil.qm.dox.h:380
*string tablespace
any tablespace for the unique key index
Definition: OracleSqlUtil.qm.dox.h:383
clearIndex()
clears any index base for the constraint
*string getTablespace()
returns the tablespace name used for this constraint, if known
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
bool isEnabled()
returns True if the constraint is enabled, False if not
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: OracleSqlUtil.qm.dox.h:526
*string view_type_owner
Owner of the type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:534
*string view_type
Type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:536
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
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: OracleSqlUtil.qm.dox.h:532
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
bool container_data
Indicates whether the view contains container-specific data.
Definition: OracleSqlUtil.qm.dox.h:540
*string superview_name
Name of the superview.
Definition: OracleSqlUtil.qm.dox.h:538
*string type_text
Type clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:530
cache(*hash< auto > opts)
the OracleSqlUtil namespace contains all the objects in the OracleSqlUtil module
Definition: OracleSqlUtil.qm.dox.h:160
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