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 regexp_substr(%v,
'[^,]+', 1, level) from dual connect by regexp_substr(%v,
'[^,]+', 1, level) is not null)
", "1,2,3,4
", "1,2,3,4
");
93 @subsection ora_partitioning_select Partition Support in Selects
95 It's possible to select from a particular partition of a table with %OracleSqlUtil;
96 @ref OracleSqlUtil::OracleTable::OracleSelectOptions "OracleSelectOptions
" defines the \c "partition
" key which can be added to a
97 @ref select_option_hash "select option
hash" to specify the partition to select from as in the following example:
99 my *list $rows = $table.selectRows(("created
": op_gt(2012-05-01), "partition
": "p1
"));
101 Which generates an SQL command like the following:
103 my *list $rows = $ds.vselectRows("select * from schema.table partition(p1) where created > %v", (2012-05-01));
106 @subsection ora_partitioning_join Partition Support in Joins
108 It's possible to perform a
join on a particular partition of a table with %OracleSqlUtil; the
join option \c "partition" is
109 supported to specify the partition to
join on as in the following example:
113 Which generates an SQL command like the following:
115 my *
list $rows = $ds.vselectRows("select * from schema.table inner
join schema.table2 partition(p2) t2 on (schema.table.
id = t2.altid)");
118 @section ora_schema_management Schema Management on Oracle
120 Note that when getting an
object description from an Oracle database, if the
object cannot be found in the connection schema, then
121 if a synonym of the same
type exists and the target
object is accessible, then the target
object is read automatically and the owning
122 schema name is also set to the actual owner of the
object.
124 @subsection ora_type_mapping Type Mapping
126 Column types are mapped from %Qore types as follows:
128 <b>Oracle Column Type Mappings</b>
129 @htmlonly <style><!-- td.qore { background-color: #5b9409; color: white; } --></style>
@endhtmlonly
132 <td
class=
"qore"><b>Generic Type Name</b></td>
133 <td
class=
"qore"><b>Oracle Type Used</b></td>
153 <td>\c timestamp(6)</td>
182 native Oracle
type name instead (under the \c
"driver" and \c
"oracle" keys
for schemas supporting multiple databases).
184 @subsection ora_other_objects Additional
Object Types Supported
186 The following additional schema objects can be managed with %OracleSqlUtil:
187 - @ref ora_materialized_views
"materialized views"
188 - @ref ora_packages
"packages"
189 - @ref ora_types
"types"
191 @subsection ora_materialized_views Materialized Views
193 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.
195 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
197 - \c
"logging": (@ref bool_type
"bool")
if the materialized view should be logged
198 - \c
"use_index": (@ref bool_type
"bool")
if the materialized view should be indexed
199 - \c
"src": (@ref bool_type
"bool") the source of the materialized view
201 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:
207 "materialized_views": (
211 "src":
"select type, count(1) total_count from table group by type",
219 @subsection ora_packages Packages
221 The @ref schema_desc_hash takes an optional key, \c
"packages" that allows packages in Oracle schemas to be managed along with other objects.
223 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
225 - \c
"src": (@ref bool_type
"bool") the source of the package
227 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:
236 type cursorType is ref cursor;
237 MYSTATCOMPLETE constant order_status.orderstatus%type := 'C';
238 MYSTATERROR constant order_status.orderstatus%type := 'E';
247 @subsection ora_types Types
249 The @ref schema_desc_hash takes an optional key, \c
"types" that allows types in Oracle schemas to be managed along with other objects.
251 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.
253 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:
260 "num_array":
"table of number",
261 "str_array":
"table of varchar2(240)",
270 @section ora_relnotes Release Notes
272 @subsection v10 OracleSqlUtil v1.0
277 namespace OracleSqlUtil {
298 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm,
bool is_char =
False,
bool cu =
False,
int bs);
353 constructor(
string n,
string nt, *
string qt,
int sz,
bool nul, *
string dv, *
string cm,
int bs,
int n_scale = 0);
356 string getNativeTypeString();
374 constructor(
string n,
bool u, hash c,
string nt, *
string t);
386 string getRenameSql(
string table_name,
string new_name);
400 constructor(
string n, Columns c, ForeignConstraintTarget t,
bool e);
403 string getCreateSql(
string table_name, *hash opt);
406 softlist getRenameSql(
string table_name,
string new_name);
428 constructor(
string n,
string n_src,
bool e =
True);
431 string getCreateSql(
string table_name, *hash opt);
434 softlist getRenameSql(
string table_name,
string new_name);
459 constructor(
string n, hash n_cols,
bool e =
True, *
string ts);
481 bool setIndexBase(
string ix);
488 string getCreateSql(
string table_name, *hash opts);
491 softlist getRenameSql(
string table_name,
string new_name);
516 constructor(
string n, *hash c, *
string ts);
538 bool setIndexBase(
string ix);
545 string getCreateSql(
string table_name, *hash opts);
548 softlist getRenameSql(
string table_name,
string new_name);
605 constructor(
string n_name,
string n_src, *
string n_schema, *
string n_type_text,
606 *
string n_oid_text, *
string n_view_type_owner,
607 *
string n_view_type, *
string n_superview_name,
608 bool n_updatable,
bool n_container_data)
631 constructor(
string n,
string n_src,
bool en =
True);
634 softlist getCreateSql(
string table_name, *hash opt);
642 softlist
getRenameSql(
string table_name,
string new_name);
659 constructor(
string n,
string n_type,
string n_src);
679 constructor(
string n_name,
string n_src);
722 constructor(
string n,
string n_src, *
string n_body_src);
755 constructor(
string n,
string n_src,
bool n_logging =
True,
bool n_use_index =
True, *
string n_tablespace);
762 bool equalImpl(AbstractFunctionBase t);
779 + OracleTable::OracleAlignTableOptions
821 constructor(AbstractDatasource nds, *hash opts);
824 private list featuresImpl();
830 private getSchemaName(reference name, reference schema);
833 private *AbstractSequence getSequenceImpl(
string name);
836 private *AbstractView getViewImpl(
string name);
839 private OracleFunction makeFunctionImpl(
string name,
string src, *hash opts);
842 private OracleProcedure makeProcedureImpl(
string name,
string src, *hash opts);
845 OraclePackage makePackage(
string name,
string src,
string body, *hash opts);
848 OraclePackage makePackageFromDescription(
string name, hash ph, *hash opts);
851 OracleType makeType(
string name,
string src, *hash opts);
860 private list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
863 private list getAlignSqlImpl(hash schema_hash, *hash opt);
881 private *
string getSource(
string type,
string name);
884 private checkSource(
string type,
string name, reference src);
919 private list listTablesImpl();
922 private list listFunctionsImpl();
925 private list listProceduresImpl();
928 private list listSequencesImpl();
931 private list listViewsImpl();
934 private list getListIntern(
string type);
940 private string getCreateSqlImpl(
list l);
943 static string getCreateSql(
list l);
983 "number": (
"qore":
Type::Number,
"size":
SZ_NUM,
"size_range": (1, 38),
"scale_range": (-84, 127)),
988 "timestamp with time zone": (
"qore":
Type::Date,
"size":
SZ_OPT,
"size_range": (0, 9)),
989 "timestamp with local time zone": (
"qore":
Type::Date,
"size":
SZ_OPT,
"size_range": (0, 9)),
1000 "timestamp(0) with time zone": (
"qore":
Type::Date,),
1001 "timestamp(1) with time zone": (
"qore":
Type::Date,),
1002 "timestamp(2) with time zone": (
"qore":
Type::Date,),
1003 "timestamp(3) with time zone": (
"qore":
Type::Date,),
1004 "timestamp(4) with time zone": (
"qore":
Type::Date,),
1005 "timestamp(5) with time zone": (
"qore":
Type::Date,),
1006 "timestamp(6) with time zone": (
"qore":
Type::Date,),
1007 "timestamp(7) with time zone": (
"qore":
Type::Date,),
1008 "timestamp(8) with time zone": (
"qore":
Type::Date,),
1009 "timestamp(9) with time zone": (
"qore":
Type::Date,),
1010 "timestamp(0) with local time zone": (
"qore":
Type::Date,),
1011 "timestamp(1) with local time zone": (
"qore":
Type::Date,),
1012 "timestamp(2) with local time zone": (
"qore":
Type::Date,),
1013 "timestamp(3) with local time zone": (
"qore":
Type::Date,),
1014 "timestamp(4) with local time zone": (
"qore":
Type::Date,),
1015 "timestamp(5) with local time zone": (
"qore":
Type::Date,),
1016 "timestamp(6) with local time zone": (
"qore":
Type::Date,),
1017 "timestamp(7) with local time zone": (
"qore":
Type::Date,),
1018 "timestamp(8) with local time zone": (
"qore":
Type::Date,),
1019 "timestamp(9) with local time zone": (
"qore":
Type::Date,),
1020 "interval year(0) to month": (
"qore":
Type::Date,),
1021 "interval year(1) to month": (
"qore":
Type::Date,),
1022 "interval year(2) to month": (
"qore":
Type::Date,),
1023 "interval year(3) to month": (
"qore":
Type::Date,),
1024 "interval year(4) to month": (
"qore":
Type::Date,),
1025 "interval year(5) to month": (
"qore":
Type::Date,),
1026 "interval year(6) to month": (
"qore":
Type::Date,),
1027 "interval year(7) to month": (
"qore":
Type::Date,),
1028 "interval year(8) to month": (
"qore":
Type::Date,),
1029 "interval year(9) to month": (
"qore":
Type::Date,),
1030 "interval day(0) to second(0)": (
"qore":
Type::Date,),
1031 "interval day(0) to second(1)": (
"qore":
Type::Date,),
1032 "interval day(0) to second(2)": (
"qore":
Type::Date,),
1033 "interval day(0) to second(3)": (
"qore":
Type::Date,),
1034 "interval day(0) to second(4)": (
"qore":
Type::Date,),
1035 "interval day(0) to second(5)": (
"qore":
Type::Date,),
1036 "interval day(0) to second(6)": (
"qore":
Type::Date,),
1037 "interval day(0) to second(7)": (
"qore":
Type::Date,),
1038 "interval day(0) to second(8)": (
"qore":
Type::Date,),
1039 "interval day(0) to second(9)": (
"qore":
Type::Date,),
1040 "interval day(1) to second(0)": (
"qore":
Type::Date,),
1041 "interval day(1) to second(1)": (
"qore":
Type::Date,),
1042 "interval day(1) to second(2)": (
"qore":
Type::Date,),
1043 "interval day(1) to second(3)": (
"qore":
Type::Date,),
1044 "interval day(1) to second(4)": (
"qore":
Type::Date,),
1045 "interval day(1) to second(5)": (
"qore":
Type::Date,),
1046 "interval day(1) to second(6)": (
"qore":
Type::Date,),
1047 "interval day(1) to second(7)": (
"qore":
Type::Date,),
1048 "interval day(1) to second(8)": (
"qore":
Type::Date,),
1049 "interval day(1) to second(9)": (
"qore":
Type::Date,),
1050 "interval day(2) to second(0)": (
"qore":
Type::Date,),
1051 "interval day(2) to second(1)": (
"qore":
Type::Date,),
1052 "interval day(2) to second(2)": (
"qore":
Type::Date,),
1053 "interval day(2) to second(3)": (
"qore":
Type::Date,),
1054 "interval day(2) to second(4)": (
"qore":
Type::Date,),
1055 "interval day(2) to second(5)": (
"qore":
Type::Date,),
1056 "interval day(2) to second(6)": (
"qore":
Type::Date,),
1057 "interval day(2) to second(7)": (
"qore":
Type::Date,),
1058 "interval day(2) to second(8)": (
"qore":
Type::Date,),
1059 "interval day(2) to second(9)": (
"qore":
Type::Date,),
1073 "integer":
"number",
1076 "string":
"varchar2",
1077 "date":
"timestamp(6)",
1084 const OraColumnOpts = (
1136 "code":
string (
object t,
string cn, any arg, reference args) {
1137 *
string argstr = (foldl $1 +
"," + $2, (map $1.toString(), arg));
1146 return cn +
" in (select regexp_substr(%v,'[^,]+', 1, level) from dual connect by regexp_substr(%v, '[^,]+', 1, level) is not null)";
1155 "argoptional":
True,
1156 "code":
string (*
string cve, *
string arg) {
1157 string sql = cve +
" over (";
1159 sql +=
sprintf(
"partition by %s", arg);
1165 "code":
string (
string arg1, any arg) {
1166 return sprintf(
"to_char(%s, 'YYYY')", arg1);
1170 "code":
string (
string arg1, any arg) {
1171 return sprintf(
"to_char(%s, 'YYYY-MM')", arg1);
1175 "code":
string (
string arg1, any arg) {
1176 return sprintf(
"to_char(%s, 'YYYY-MM-DD')", arg1);
1180 "code":
string (
string arg1, any arg) {
1181 return sprintf(
"to_char(%s, 'YYYY-MM-DD HH24')", arg1);
1209 constructor(AbstractDatasource nds,
string nname, *hash opts);
1212 private bool checkExistenceImpl();
1215 private setTableInfoIntern();
1222 private hash setSchemaTable();
1225 private setDblinkSchema();
1228 private hash setTable();
1231 private string getUserSchema();
1234 private string getDBString();
1252 private hash getColumnOptions();
1255 private hash getColumnDescOptions();
1262 private getSelectWhereSqlUnlocked(reference sql, reference args, *hash qh, *hash jch,
bool join =
False, *hash ch);
1265 private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch);
1272 private Columns describeImpl();
1275 private OraclePrimaryKey getPrimaryKeyImpl();
1278 private Indexes getIndexesImpl();
1281 private ForeignConstraints getForeignConstraintsImpl(*hash opts);
1284 private Constraints getConstraintsImpl();
1287 private string getSelectSqlName(*hash qh);
1290 private Triggers getTriggersImpl();
1293 string getCreateTableSqlImpl(*hash opt);
1296 private *
list getCreateMiscSqlImpl(*hash opt,
bool cache);
1299 private string getCreateSqlImpl(
list l);
1302 private string getRenameSqlImpl(
string new_name);
1305 private AbstractColumn addColumnImpl(
string cname, hash opt,
bool nullable =
True);
1308 private AbstractPrimaryKey addPrimaryKeyImpl(
string cname, hash ch, *hash opt);
1311 private AbstractIndex addIndexImpl(
string iname,
bool enabled, hash ch, *hash opt);
1314 private AbstractForeignConstraint addForeignConstraintImpl(
string cname, hash ch,
string table, hash tch, *hash opt);
1317 private AbstractCheckConstraint addCheckConstraintImpl(
string cname,
string src, *hash opt);
1320 private AbstractUniqueConstraint addUniqueConstraintImpl(
string cname, hash ch, *hash opt);
1323 private AbstractTrigger addTriggerImpl(
string tname,
string src, *hash opt);
1326 private bool tryInsertImpl(
string sql, hash row);
1329 private *
list getAlignSqlImpl(AbstractTable t, *hash opt);
1332 private hash getQoreTypeMapImpl();
1335 private hash getTypeMapImpl();
1338 private hash getIndexOptions();
1341 private hash getConstraintOptions();
1344 private hash getTableCreationOptions();
1347 private hash getAlignTableOptions();
1362 private bool emptyImpl();
1365 private setupTableImpl(hash desc, *hash opt);
1381 private copyImpl(AbstractTable old);
represents an Oracle unique constraint
Definition: OracleSqlUtil.qm.dox.h:447
private hash getSelectOptions()
override in subclasses to return driver-specific options
represents an Oracle materialized view
Definition: OracleSqlUtil.qm.dox.h:735
const OracleCreationOptions
oracle-specific generic creation options
Definition: OracleSqlUtil.qm.dox.h:772
list listSynonyms()
returns a list of string synonym names in the database
private hash getAlignSchemaOptions()
returns driver-specific options to the base abstract class
string sprintf(string fmt,...)
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
ListIterator packageIterator()
returns an iterator listing the string package names in the database
*string tablespace
the tablespace name of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:369
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database ...
string getDropSql(string table_name)
returns a string that can be used to drop the constraint from the database
bool logging
Flag if is loggign mode used.
Definition: OracleSqlUtil.qm.dox.h:740
*string view_type_owner
Owner of the type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:594
represents an Oracle table
Definition: OracleSqlUtil.qm.dox.h:977
private bool supportsSequencesImpl()
returns True if the database supports sequences
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database ...
ListIterator synonymIterator()
returns an iterator listing the string synonym names in the database
list getCreateSql(*hash opt)
returns a string that can be used to create the package in the database
*string tablespace
Name of the potential tablespace.
Definition: OracleSqlUtil.qm.dox.h:744
constructor(string n, string n_type, string n_src)
creates the object from the arguments passed
private bool supportsPackagesImpl()
returns True if the database supports packages
const OracleMaterializedViewDescriptionOptions
oracle-specific materialized view description options
Definition: OracleSqlUtil.qm.dox.h:812
ListIterator materializedViewIterator()
returns an iterator listing the string materialized view names in the database
private bool supportsTypesImpl()
returns True if the database supports named types
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database ...
list getRenameSql(string new_name)
returns a string that can be used to rename the object in the database
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
*string superview_name
Name of the superview.
Definition: OracleSqlUtil.qm.dox.h:598
bool enabled
True if the trigger is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:627
const OracleIndexOptions
Oracle-specific index options.
Definition: OracleSqlUtil.qm.dox.h:1104
private hash getCreationOptions()
returns driver-specific options to the base abstract class
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:396
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:424
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
represents an Oracle procedure
Definition: OracleSqlUtil.qm.dox.h:696
number number(softnumber n)
OracleColumn memberGate(string k)
returns the OracleColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception ...
const OracleOpMap
where operator specializations for Oracle
Definition: OracleSqlUtil.qm.dox.h:1134
private bool supportsTablespacesImpl()
returns True if the database support tablespaces
constructor(string n, string n_src)
creates the object from the arguments passed
const OracleTableCreationOptions
Oracle table creation options.
Definition: OracleSqlUtil.qm.dox.h:1117
bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
list listTypes()
returns a list of string type names in the database
*string tablespace
any tablespace for the unique key index
Definition: OracleSqlUtil.qm.dox.h:455
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:452
represents an Oracle view
Definition: OracleSqlUtil.qm.dox.h:584
constructor(string n, string n_src, *string n_body_src)
creates the object from the arguments passed
list listMaterializedViews()
returns a list of string materialized view names in the database
private hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
softlist getRenameSql(string new_name)
returns a string that can be used to rename the view in the database
ListIterator typeIterator()
returns an iterator listing the string type names in the database
*string oid_text
WITH OID clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:592
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
const OraColumnDescOptions
Oracle-specific column options.
Definition: OracleSqlUtil.qm.dox.h:1098
private bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
bool use_index
Flag if is index used.
Definition: OracleSqlUtil.qm.dox.h:742
private hash getWhereOperatorMap()
returns the "where" operator map for this object
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
constructor(string n, bool u, hash c, string nt, *string t)
creates the object from the arguments
the Oracle specialization for SqlUtil::AbstractDatabase
Definition: OracleSqlUtil.qm.dox.h:767
int byte_size
byte size of the column
Definition: OracleSqlUtil.qm.dox.h:294
string getNativeTypeString()
returns the string describing the native type that can be used in SQL (for example to add the colunn ...
bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
const OraclePackageDescriptionOptions
oracle-specific package description options
Definition: OracleSqlUtil.qm.dox.h:806
string getRenameSql(string new_name)
returns a string that can be used to rename the sequence in the database
const OraTypeMap
maps oracle type names to type descriptions
Definition: OracleSqlUtil.qm.dox.h:982
string string(softstring str)
const OracleAlignSchemaOptions
oracle-specific schema description / alignment options
Definition: OracleSqlUtil.qm.dox.h:777
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
const OracleConstraintOptions
Oracle-specific constraint options.
Definition: OracleSqlUtil.qm.dox.h:1112
OracleColumn memberGate(string k)
returns the OracleColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception ...
softlist getCreateSql(*hash opt)
returns a string that can be used to create the object in the database
*string getComment()
returns any table comment or NOTHING if none is known
string getSchemaName()
returns the schema name
represents an Oracle check constraint
Definition: OracleSqlUtil.qm.dox.h:419
string getSqlName()
returns the schema and table naem in dot notation
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
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
represents an Oracle number column
Definition: OracleSqlUtil.qm.dox.h:350
clearIndex()
clears any index base for the constraint
represents an Oracle package
Definition: OracleSqlUtil.qm.dox.h:708
list 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; if the col...
represents an Oracle column
Definition: OracleSqlUtil.qm.dox.h:287
*string type_text
Type clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:590
OracleDatabase get_database(AbstractDatasource nds, *hash opts)
returns an OracleDatabase object corresponding to the arguments
softlist getCreateSql(*hash opt)
returns a string that can be used to create the object in the database
const OracleCopMap
column operator specializations for Oracle
Definition: OracleSqlUtil.qm.dox.h:1152
private hash getColumnOperatorMap()
returns the column operator map for this object
const OracleSelectOptions
Oracle select options.
Definition: OracleSqlUtil.qm.dox.h:1129
const QoreTypeMap
maps qore type names to an oracle type
Definition: OracleSqlUtil.qm.dox.h:1072
hash join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash opt)
*string body_src
package body source
Definition: OracleSqlUtil.qm.dox.h:713
private *string getSqlValueImpl(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
constructor(string n, string n_src)
creates the object from the arguments passed
private bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
*string tablespace
any tablespace for the primary key index
Definition: OracleSqlUtil.qm.dox.h:509
*string view_type
Type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:596
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
private copyImpl(AbstractTable old)
db-specific copy actions
list listPackages()
returns a list of string package names in the database
represents an Oracle sequence
Definition: OracleSqlUtil.qm.dox.h:567
represents an Oracle trigger
Definition: OracleSqlUtil.qm.dox.h:622
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
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:600
const OracleSchemaDescriptionOptions
oracle-specific schema description keys
Definition: OracleSqlUtil.qm.dox.h:791
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
const OraColumnOptions
Oracle-specific column options.
Definition: OracleSqlUtil.qm.dox.h:1092
represents an Oracle foreign constraint
Definition: OracleSqlUtil.qm.dox.h:391
represents an Oracle type
Definition: OracleSqlUtil.qm.dox.h:676
represents an Oracle primary key
Definition: OracleSqlUtil.qm.dox.h:504
clearIndex()
clears any index base for the constraint
*string getTablespaceName()
returns the data tablespace name for the table if any or NOTHING if none is known ...
private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh)
processes a string for use in SQL select statements when there is a "limit" argument, but no "orderby" or "offset" arguments
string native_type
the native type of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:366
string join(string str,...)
private softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
represents an Oracle index
Definition: OracleSqlUtil.qm.dox.h:361
bool char_used
the column uses character semantics
Definition: OracleSqlUtil.qm.dox.h:292
represents an Oracle function
Definition: OracleSqlUtil.qm.dox.h:684
the base class for Oracle code objects
Definition: OracleSqlUtil.qm.dox.h:651
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database ...