Qore OracleSqlUtil Module Reference  1.1
OracleSqlUtil.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
2 // @file OracleSqlUtil.qm Qore user module for working with Oracle SQL data
3 
4 /* OracleSqlUtil.qm Copyright 2013 - 2014 Qore Technologies, sro
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // this module requires Qore 0.8.11 or better
26 
27 // requires the SqlUtil module
28 
29 // requires the Util module
30 
31 // don't use "$" signs for variables and class members, assume local variable scope
32 
33 // require type definitions everywhere
34 
35 // enable all warnings
36 
37 
38 /* Version History: see docs below
39 */
40  a.*, rownum rnum from (select * from schema.table where type = %v order by type) a where rownum <= %v) where rnum > %v", ("user", 300, 200));
70  @endcode
71  note that the following simpler SQL is generated for Oracle 12c+ servers:
72  @code
73 $ds.vselectRows("select * from schema.table where type = %v order by type offset %v rows fetch next %v rows only", ("user", 200, 100));
74  @endcode
75 
76  @subsection ora_in_operator IN Operator on Oracle
77 
78  In order to avoid dynamic SQL and better manage the server's shared pool (in particular, the number of parsed statements), the %OracleSqlUtil
79  module uses bind by value with the SQL \c IN operator.
80 
81  For example, the following query:
82  @code
83 my *hash $q = $table.select(("where": ("col1": op_in(1, 2, 3, 4))));
84  @endcode
85 
86  Results in the equivalent of the following SQL:
87  @code
88 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");
89  @endcode
90 
91  @subsection ora_partitioning_select Partition Support in Selects
92 
93  It's possible to select from a particular partition of a table with %OracleSqlUtil;
94  @ref OracleSqlUtil::OracleTable::OracleSelectOptions "OracleSelectOptions" defines the \c "partition" key which can be added to a
95  @ref select_option_hash "select option hash" to specify the partition to select from as in the following example:
96  @code
97 my *list $rows = $table.selectRows(("created": op_gt(2012-05-01), "partition": "p1"));
98  @endcode
99  Which generates an SQL command like the following:
100  @code
101 my *list $rows = $ds.vselectRows("select * from schema.table partition(p1) where created > %v", (2012-05-01));
102  @endcode
103 
104  @subsection ora_partitioning_join Partition Support in Joins
105 
106  It's possible to perform a join on a particular partition of a table with %OracleSqlUtil; the join option \c "partition" is
107  supported to specify the partition to join on as in the following example:
108  @code
109 my *list $rows = $table.selectRows(("join": join_inner($table2, "t2", ("id": "altid"), NOTHING, ("partition": "p2"))));
110  @endcode
111  Which generates an SQL command like the following:
112  @code
113 my *list $rows = $ds.vselectRows("select * from schema.table inner join schema.table2 partition(p2) t2 on (schema.table.id = t2.altid)");
114  @endcode
115 
116  @section ora_schema_management Schema Management on Oracle
117 
118  Note that when getting an object description from an Oracle database, if the object cannot be found in the connection schema, then
119  if a synonym of the same type exists and the target object is accessible, then the target object is read automatically and the owning
120  schema name is also set to the actual owner of the object.
121 
122  @subsection ora_type_mapping Type Mapping
123 
124  Column types are mapped from %Qore types as follows:
125 
126  <b>Oracle Column Type Mappings</b>
127  @htmlonly <style><!-- td.qore { background-color: #5b9409; color: white; } --></style> @endhtmlonly
128  <table>
129  <tr>
130  <td class="qore"><b>Generic Type Name</b></td>
131  <td class="qore"><b>Oracle Type Used</b></td>
132  </tr>
133  <tr>
134  <td>\c float</td>
135  <td>\c number</td>
136  </tr>
137  <tr>
138  <td>\c integer</td>
139  <td>\c number</td>
140  </tr>
141  <tr>
142  <td>\c number</td>
143  <td>\c number</td>
144  </tr>
145  <tr>
146  <td>\c string</td>
147  <td>\c varchar2</td>
148  </tr>
149  <tr>
150  <td>\c date</td>
151  <td>\c timestamp(6)</td>
152  </tr>
153  <tr>
154  <td>\c binary</td>
155  <td>\c blob</td>
156  </tr>
157  <tr>
158  <td>@ref SqlUtil::BLOB</td>
159  <td>\c blob</td>
160  </tr>
161  <tr>
162  <td>@ref SqlUtil::CHAR</td>
163  <td>\c char</td>
164  </tr>
165  <tr>
166  <td>@ref SqlUtil::CLOB</td>
167  <td>\c clob</td>
168  </tr>
169  <tr>
170  <td>@ref SqlUtil::NUMERIC</td>
171  <td>\c number</td>
172  </tr>
173  <tr>
174  <td>@ref SqlUtil::VARCHAR</td>
175  <td>\c varchar2</td>
176  </tr>
177  </table>
178 
179  To use other types, use the \c "native_type" @ref SqlUtil::AbstractTable::ColumnDescOptions "column description option" with the
180  native Oracle type name instead (under the \c "driver" and \c "oracle" keys for schemas supporting multiple databases).
181 
182  @subsection ora_other_objects Additional Object Types Supported
183 
184  The following additional schema objects can be managed with %OracleSqlUtil:
185  - @ref ora_materialized_views "materialized views"
186  - @ref ora_packages "packages"
187  - @ref ora_types "types"
188 
189  @subsection ora_materialized_views Materialized Views
190 
191  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.
192 
193  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
194  following keys:
195  - \c "logging": (@ref bool_type "bool") if the materialized view should be logged
196  - \c "use_index": (@ref bool_type "bool") if the materialized view should be indexed
197  - \c "src": (@ref bool_type "bool") the source of the materialized view
198 
199  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:
200 
201  @code
202 my hash $schema = (
203  "driver": (
204  "oracle": (
205  "materialized_views": (
206  "example_mv": (
207  "logging": False,
208  "use_index": False,
209  "src": "select type, count(1) total_count from table group by type",
210  ),
211  ),
212  ),
213  ),
214 );
215  @endcode
216 
217  @subsection ora_packages Packages
218 
219  The @ref schema_desc_hash takes an optional key, \c "packages" that allows packages in Oracle schemas to be managed along with other objects.
220 
221  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
222  following key:
223  - \c "src": (@ref bool_type "bool") the source of the package
224 
225  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:
226 
227  @code
228 my hash $schema = (
229  "driver": (
230  "oracle": (
231  "packages": (
232  "example_pkg": (
233  "src": "types as
234 type cursorType is ref cursor;
235 MYSTATCOMPLETE constant order_status.orderstatus%type := 'C';
236 MYSTATERROR constant order_status.orderstatus%type := 'E';
237 ",
238  ),
239  ),
240  ),
241  ),
242 );
243  @endcode
244 
245  @subsection ora_types Types
246 
247  The @ref schema_desc_hash takes an optional key, \c "types" that allows types in Oracle schemas to be managed along with other objects.
248 
249  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.
250 
251  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:
252 
253  @code
254 my hash $schema = (
255  "driver": (
256  "oracle": (
257  "types": (
258  "num_array": "table of number",
259  "str_array": "table of varchar2(240)",
260  ),
261  ),
262  ),
263 );
264  @endcode
265 
266  @see OracleSqlUtil::OracleDatabase::OracleSchemaDescriptionOptions for a list of Oracle-specific schema description hash keys.
267 
268  @section ora_relnotes Release Notes
269 
270  @subsection v11 OracleSqlUtil v1.1
271  - fixed selects with "limit" but no "offset"
272  - 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)
273  - fixed schema information classes when the "string-numbers" driver option is enabled
274 
275  @subsection v10 OracleSqlUtil v1.0
276  - initial release
277 */
278 
280 namespace OracleSqlUtil {
282  OracleTable get_table(AbstractDatasource nds, string nname, *hash opts);
283 
284 
286  OracleDatabase get_database(AbstractDatasource nds, *hash opts);
287 
288 
291 
292 public:
293  public :
295  bool char_used;
298 
299 public:
300 
301  constructor(string n, string nt, *string qt, softint sz, bool nul, *string dv, *string cm, bool is_char = False, bool cu = False, softint bs);
302 
303 
305  string getNativeTypeString();
306 
307 
309 
316  list getAddColumnSql(AbstractTable t);
317 
318 
320 
330  list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
331 
332 
334 
344  string getRenameSql(AbstractTable t, string new_name);
345 
346 
348  bool equalImpl(AbstractColumn c);
349 
350  };
351 
354 
355 public:
356  constructor(string n, string nt, *string qt, softint sz, bool nul, *string dv, *string cm, softint bs, softint n_scale = 0);
357 
358 
359  string getNativeTypeString();
360 
361  };
362 
365 
366 public:
367  public :
369  string native_type;
370 
372  *string tablespace;
373 
374 public:
375 
377  constructor(string n, bool u, hash c, string nt, *string t);
378 
379 
381  string getCreateSql(string table_name, *hash opt);
382 
383 
385  bool equalImpl(AbstractIndex ix);
386 
387 
389  string getRenameSql(string table_name, string new_name);
390 
391  };
392 
395 
396 public:
397  public :
399  bool enabled;
400 
401 public:
402 
403  constructor(string n, Columns c, ForeignConstraintTarget t, bool e);
404 
405 
406  string getCreateSql(string table_name, *hash opt);
407 
408 
409  softlist getRenameSql(string table_name, string new_name);
410 
411 
413  string getDisableSql(string table_name);
414 
415 
417  string getEnableSql(string table_name, *hash opt);
418 
419  };
420 
423 
424 public:
425  public :
427  bool enabled;
428 
429 public:
430 
431  constructor(string n, string n_src, bool e = True);
432 
433 
434  string getCreateSql(string table_name, *hash opt);
435 
436 
437  softlist getRenameSql(string table_name, string new_name);
438 
439 
441  string getDisableSql(string table_name);
442 
443 
445  string getEnableSql(string table_name, *hash opt);
446 
447  };
448 
451 
452 public:
453  private :
455  bool enabled;
456 
458  *string tablespace;
459 
460 public:
461 
462  constructor(string n, hash n_cols, bool e = True, *string ts);
463 
464 
466 
481  OracleColumn memberGate(string k);
482 
483 
484  bool setIndexBase(string ix);
485 
486 
488  clearIndex();
489 
490 
491  string getCreateSql(string table_name, *hash opts);
492 
493 
494  softlist getRenameSql(string table_name, string new_name);
495 
496 
498  string getDisableSql(string table_name);
499 
500 
502  string getEnableSql(string table_name, *hash opt);
503 
504  };
505 
508 
509 public:
510  private :
512  *string tablespace;
513 
514 public:
515 
516  constructor();
517 
518 
519  constructor(string n, *hash c, *string ts);
520 
521 
523 
538  OracleColumn memberGate(string k);
539 
540 
541  bool setIndexBase(string ix);
542 
543 
545  clearIndex();
546 
547 
548  string getCreateSql(string table_name, *hash opts);
549 
550 
551  softlist getRenameSql(string table_name, string new_name);
552 
553 
555 
557  string getDropSql(string table_name);
558 
559 
561  string getDisableSql(string table_name);
562 
563 
565  string getEnableSql(string table_name, *hash opt);
566 
567  };
568 
571 
572 public:
574  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end);
575 
576 
578  string getCreateSql(*hash opt);
579 
580 
582  string getRenameSql(string new_name);
583 
584  };
585 
588 
589 public:
590 
591  public :
593  *string type_text;
595  *string oid_text;
599  *string view_type;
601  *string superview_name;
604 
605 public:
606 
608  constructor(string n_name, string n_src, *string n_schema, *string n_type_text,
609  *string n_oid_text, *string n_view_type_owner,
610  *string n_view_type, *string n_superview_name,
611  bool n_updatable, bool n_container_data)
612 ;
613 
614 
616  string getCreateSql(*hash opt);
617 
618 
620  softlist getRenameSql(string new_name);
621 
622  };
623 
626 
627 public:
628  public :
630  bool enabled;
631 
632 public:
633 
634  constructor(string n, string n_src, bool en = True);
635 
636 
637  softlist getCreateSql(string table_name, *hash opt);
638 
639 
641  bool equalImpl(AbstractFunctionBase t);
642 
643 
645  softlist getRenameSql(string table_name, string new_name);
646 
647 
649  softlist getDropSql(string table_name);
650 
651  };
652 
655 
656 public:
658 
662  constructor(string n, string n_type, string n_src);
663 
664 
666  softlist getCreateSql(*hash opt);
667 
668 
670  bool equalImpl(AbstractFunctionBase t);
671 
672 
674  list getRenameSql(string new_name);
675 
676  };
677 
679 class OracleType : public OracleCodeBase {
680 
681 public:
682  constructor(string n_name, string n_src);
683 
684  };
685 
688 
689 public:
691 
694  constructor(string n, string n_src);
695 
696  };
697 
700 
701 public:
703 
706  constructor(string n, string n_src);
707 
708  };
709 
712 
713 public:
714  private :
716  *string body_src;
717 
718 public:
719 
721 
725  constructor(string n, string n_src, *string n_body_src);
726 
727 
729  list getCreateSql(*hash opt);
730 
731 
733  bool equalImpl(AbstractFunctionBase t);
734 
735  };
736 
739 
740 public:
741  public :
743  bool logging;
745  bool use_index;
747  *string tablespace;
748 
749 public:
750 
752 
758  constructor(string n, string n_src, bool n_logging = True, bool n_use_index = True, *string n_tablespace);
759 
760 
762  softlist getCreateSql(*hash opt);
763 
764 
765  bool equalImpl(AbstractFunctionBase t);
766 
767  };
768 
771 
772 public:
773  public :
775  const OracleCreationOptions = AbstractDatabase::CreationOptions + (
776  "compute_statistics": Type::Boolean,
777  );
778 
780  const OracleAlignSchemaOptions = AbstractDatabase::CreationOptions
782  + OracleTable::OracleAlignTableOptions
783  ;
784 
786 
794  const OracleSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
795  "types": Type::Hash,
796  "type_map": Type::Hash,
797 
798  "packages": Type::Hash,
799  "package_map": Type::Hash,
800 
801  "materialized_views": Type::Hash,
802  "materialized_view_map": Type::Hash,
803 
804  //"synonyms": Type::Hash,
805  //"synonym_map": Type::Hash,
806  );
807 
810  "src": Type::String,
811  "body": Type::String,
812  );
813 
816  "logging": Type::Boolean,
817  "use_index": Type::Boolean,
818  "tablespace": Type::String,
819  "src": Type::String,
820  );
821 
824  "access": True,
825  "else": True,
826  "modify": True,
827  "start": True,
828  "add": True,
829  "exclusive": True,
830  "noaudit": True,
831  "select": True,
832  "all": True,
833  "exists": True,
834  "nocompress": True,
835  "session": True,
836  "alter": True,
837  "file": True,
838  "not": True,
839  "set": True,
840  "and": True,
841  "float": True,
842  "notfound": True,
843  "share": True,
844  "any": True,
845  "for": True,
846  "nowait": True,
847  "size": True,
848  "arraylen": True,
849  "from": True,
850  "null": True,
851  "smallint": True,
852  "as": True,
853  "grant": True,
854  "number": True,
855  "sqlbuf": True,
856  "asc": True,
857  "group": True,
858  "of": True,
859  "successful": True,
860  "audit": True,
861  "having": True,
862  "offline": True,
863  "synonym": True,
864  "between": True,
865  "identified": True,
866  "on": True,
867  "sysdate": True,
868  "by": True,
869  "immediate": True,
870  "online": True,
871  "table": True,
872  "char": True,
873  "in": True,
874  "option": True,
875  "then": True,
876  "check": True,
877  "increment": True,
878  "or": True,
879  "to": True,
880  "cluster": True,
881  "index": True,
882  "order": True,
883  "trigger": True,
884  "column": True,
885  "initial": True,
886  "pctfree": True,
887  "uid": True,
888  "comment": True,
889  "insert": True,
890  "prior": True,
891  "union": True,
892  "compress": True,
893  "integer": True,
894  "privileges": True,
895  "unique": True,
896  "connect": True,
897  "intersect": True,
898  "public": True,
899  "update": True,
900  "create": True,
901  "into": True,
902  "raw": True,
903  "user": True,
904  "current": True,
905  "is": True,
906  "rename": True,
907  "validate": True,
908  "date": True,
909  "level": True,
910  "resource": True,
911  "values": True,
912  "decimal": True,
913  "like": True,
914  "revoke": True,
915  "varchar": True,
916  "default": True,
917  "lock": True,
918  "row": True,
919  "varchar2": True,
920  "delete": True,
921  "long": True,
922  "rowid": True,
923  "view": True,
924  "desc": True,
925  "maxextents": True,
926  "rowlabel": True,
927  "whenever": True,
928  "distinct": True,
929  "minus": True,
930  "rownum": True,
931  "where": True,
932  "drop": True,
933  "mode": True,
934  "rows": True,
935  "with": True,
936  );
937 
938 public:
939 
941  constructor(AbstractDatasource nds, *hash opts);
942 
943 
944  private list featuresImpl();
945 
946 
947  private OracleSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
948 
949 
950  private getSchemaName(reference name, reference schema);
951 
952 
953  private *AbstractSequence getSequenceImpl(string name);
954 
955 
956  private *AbstractView getViewImpl(string name);
957 
958 
959  private OracleFunction makeFunctionImpl(string name, string src, *hash opts);
960 
961 
962  private OracleProcedure makeProcedureImpl(string name, string src, *hash opts);
963 
964 
965  private OraclePackage makePackage(string name, string src, string body, *hash opts);
966 
967 
968  private OraclePackage makePackageFromDescription(string name, hash ph, *hash opts);
969 
970 
971  private OracleType makeType(string name, string src, *hash opts);
972 
973 
974  private OracleMaterializedView makeMaterializedView(string name, string src, bool logging = True, bool use_index = True, *string tablespace, *hash opts);
975 
976 
977  private OracleMaterializedView makeMaterializedViewFromDescription(string name, hash mvh, *hash opts);
978 
979 
980  private list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
981 
982 
983  private list getAlignSqlImpl(hash schema_hash, *hash opt);
984 
985 
986  private *OracleFunction getFunctionImpl(string name);
987 
988 
989  private *OracleProcedure getProcedureImpl(string name);
990 
991 
993  *OraclePackage getPackage(string name);
994 
995 
997  *OracleType getType(string name);
998 
999 
1002 
1003 
1004  private *string getSource(string type, string name);
1005 
1006 
1007  private checkSource(string type, string name, reference src);
1008 
1009 
1011  list listSynonyms();
1012 
1013 
1015  ListIterator synonymIterator();
1016 
1017 
1019  list listTypes();
1020 
1021 
1023  ListIterator typeIterator();
1024 
1025 
1027  list listPackages();
1028 
1029 
1031  ListIterator packageIterator();
1032 
1033 
1036 
1037 
1039  ListIterator materializedViewIterator();
1040 
1041 
1042  private list listTablesImpl();
1043 
1044 
1045  private list listFunctionsImpl();
1046 
1047 
1048  private list listProceduresImpl();
1049 
1050 
1051  private list listSequencesImpl();
1052 
1053 
1054  private list listViewsImpl();
1055 
1056 
1057  private list getListIntern(string type);
1058 
1059 
1060  private list getListIntern(list l);
1061 
1062 
1063  private string getCreateSqlImpl(list l);
1064 
1065 
1066  static string getCreateSql(list l);
1067 
1069  private hash getCreationOptions();
1070 
1071 
1073  private hash getAlignSchemaOptions();
1074 
1075 
1077  private hash getSchemaDescriptionOptions();
1078 
1079 
1081  private softint getNextSequenceValueImpl(string name);
1082 
1083 
1085  private bool supportsSequencesImpl();
1086 
1087 
1089  private bool supportsTypesImpl();
1090 
1091 
1093  private bool supportsPackagesImpl();
1094 
1095  };
1096 
1098 
1101 
1102 public:
1103  public :
1105  const OraTypeMap = (
1106  "number": ("qore": Type::Number, "size": SZ_NUM, "size_range": (1, 38), "scale_range": (-84, 127)),
1107  "varchar2": ("qore": Type::String, "size": SZ_MAND, "size_range": (1, 4000), "is_char": True),
1108  "char": ("qore": Type::String, "size": SZ_MAND, "size_range": (1, 4000), "is_char": True),
1109  "date": ("qore": Type::Date,),
1110  "timestamp": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 9)),
1111  "timestamp with time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 9)),
1112  "timestamp with local time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 9)),
1113  "timestamp(0)": ("qore": Type::Date,),
1114  "timestamp(1)": ("qore": Type::Date,),
1115  "timestamp(2)": ("qore": Type::Date,),
1116  "timestamp(3)": ("qore": Type::Date,),
1117  "timestamp(4)": ("qore": Type::Date,),
1118  "timestamp(5)": ("qore": Type::Date,),
1119  "timestamp(6)": ("qore": Type::Date,),
1120  "timestamp(7)": ("qore": Type::Date,),
1121  "timestamp(8)": ("qore": Type::Date,),
1122  "timestamp(9)": ("qore": Type::Date,),
1123  "timestamp(0) with time zone": ("qore": Type::Date,),
1124  "timestamp(1) with time zone": ("qore": Type::Date,),
1125  "timestamp(2) with time zone": ("qore": Type::Date,),
1126  "timestamp(3) with time zone": ("qore": Type::Date,),
1127  "timestamp(4) with time zone": ("qore": Type::Date,),
1128  "timestamp(5) with time zone": ("qore": Type::Date,),
1129  "timestamp(6) with time zone": ("qore": Type::Date,),
1130  "timestamp(7) with time zone": ("qore": Type::Date,),
1131  "timestamp(8) with time zone": ("qore": Type::Date,),
1132  "timestamp(9) with time zone": ("qore": Type::Date,),
1133  "timestamp(0) with local time zone": ("qore": Type::Date,),
1134  "timestamp(1) with local time zone": ("qore": Type::Date,),
1135  "timestamp(2) with local time zone": ("qore": Type::Date,),
1136  "timestamp(3) with local time zone": ("qore": Type::Date,),
1137  "timestamp(4) with local time zone": ("qore": Type::Date,),
1138  "timestamp(5) with local time zone": ("qore": Type::Date,),
1139  "timestamp(6) with local time zone": ("qore": Type::Date,),
1140  "timestamp(7) with local time zone": ("qore": Type::Date,),
1141  "timestamp(8) with local time zone": ("qore": Type::Date,),
1142  "timestamp(9) with local time zone": ("qore": Type::Date,),
1143  "interval year(0) to month": ("qore": Type::Date,),
1144  "interval year(1) to month": ("qore": Type::Date,),
1145  "interval year(2) to month": ("qore": Type::Date,),
1146  "interval year(3) to month": ("qore": Type::Date,),
1147  "interval year(4) to month": ("qore": Type::Date,),
1148  "interval year(5) to month": ("qore": Type::Date,),
1149  "interval year(6) to month": ("qore": Type::Date,),
1150  "interval year(7) to month": ("qore": Type::Date,),
1151  "interval year(8) to month": ("qore": Type::Date,),
1152  "interval year(9) to month": ("qore": Type::Date,),
1153  "interval day(0) to second(0)": ("qore": Type::Date,),
1154  "interval day(0) to second(1)": ("qore": Type::Date,),
1155  "interval day(0) to second(2)": ("qore": Type::Date,),
1156  "interval day(0) to second(3)": ("qore": Type::Date,),
1157  "interval day(0) to second(4)": ("qore": Type::Date,),
1158  "interval day(0) to second(5)": ("qore": Type::Date,),
1159  "interval day(0) to second(6)": ("qore": Type::Date,),
1160  "interval day(0) to second(7)": ("qore": Type::Date,),
1161  "interval day(0) to second(8)": ("qore": Type::Date,),
1162  "interval day(0) to second(9)": ("qore": Type::Date,),
1163  "interval day(1) to second(0)": ("qore": Type::Date,),
1164  "interval day(1) to second(1)": ("qore": Type::Date,),
1165  "interval day(1) to second(2)": ("qore": Type::Date,),
1166  "interval day(1) to second(3)": ("qore": Type::Date,),
1167  "interval day(1) to second(4)": ("qore": Type::Date,),
1168  "interval day(1) to second(5)": ("qore": Type::Date,),
1169  "interval day(1) to second(6)": ("qore": Type::Date,),
1170  "interval day(1) to second(7)": ("qore": Type::Date,),
1171  "interval day(1) to second(8)": ("qore": Type::Date,),
1172  "interval day(1) to second(9)": ("qore": Type::Date,),
1173  "interval day(2) to second(0)": ("qore": Type::Date,),
1174  "interval day(2) to second(1)": ("qore": Type::Date,),
1175  "interval day(2) to second(2)": ("qore": Type::Date,),
1176  "interval day(2) to second(3)": ("qore": Type::Date,),
1177  "interval day(2) to second(4)": ("qore": Type::Date,),
1178  "interval day(2) to second(5)": ("qore": Type::Date,),
1179  "interval day(2) to second(6)": ("qore": Type::Date,),
1180  "interval day(2) to second(7)": ("qore": Type::Date,),
1181  "interval day(2) to second(8)": ("qore": Type::Date,),
1182  "interval day(2) to second(9)": ("qore": Type::Date,),
1183  "clob": ("qore": Type::String,),
1184  "blob": ("qore": Type::Binary,),
1185  "long": ("qore": Type::Binary,),
1186  "raw": ("qore": Type::Binary, "size": SZ_MAND, "size_range": (1, 2000)),
1187  "bfile": ("qore": Type::Binary,),
1188  "binary_float": ("qore": Type::Float,),
1189  "binary_double": ("qore": Type::Float,),
1190  "rowid": ("qore": Type::String,),
1191  "urowid": ("qore": Type::String, "size": SZ_OPT, "size_range": (1, 4000)),
1192  );
1193 
1195  const QoreTypeMap = (
1196  "integer": "number",
1197  "float": "number",
1198  "number": "number",
1199  "string": "varchar2",
1200  "date": "timestamp(6)",
1201  "binary": "blob",
1202  SqlUtil::CHAR: "char",
1203  SqlUtil::CLOB: "clob",
1204  SqlUtil::BLOB: "blob",
1205  );
1206 
1207  const OraColumnOpts = (
1208  "character_semantics": Type::Boolean,
1209  );
1210 
1212 
1215  const OraColumnOptions = AbstractTable::ColumnOptions + OraColumnOpts;
1216 
1218 
1221  const OraColumnDescOptions = AbstractTable::ColumnDescOptions + OraColumnOpts;
1222 
1224 
1227  const OracleIndexOptions = AbstractTable::IndexOptions + (
1228  "compute_statistics": Type::Boolean,
1229  );
1230 
1232 
1236  "index": Type::String,
1237  );
1238 
1240  const OracleTableCreationOptions = AbstractTable::TableCreationOptions
1243  ;
1244 
1245  const OracleAlignTableOptions = AbstractTable::AlignTableOptions + OracleTableCreationOptions;
1246 
1248 
1252  const OracleSelectOptions = AbstractTable::SelectOptions + (
1253  "partition": Type::String,
1254  );
1255 
1258  OP_IN: (
1259  "code": string (object t, string cn, any arg, reference args) {
1260  *string argstr = (foldl $1 + "," + $2, (map $1.toString(), arg));
1261 
1262  // in this case this part of the expression will fail
1263  if (!argstr)
1264  return "1 != 1";
1265 
1266  args += argstr;
1267  args += argstr;
1268 
1269  return cn + " in (select regexp_substr(%v,'[^,]+', 1, level) from dual connect by regexp_substr(%v, '[^,]+', 1, level) is not null)";
1270  },
1271  ),
1272  );
1273 
1276  COP_OVER: (
1277  "argcolumn": True,
1278  "argoptional": True,
1279  "code": string (*string cve, *string arg) {
1280  string sql = cve + " over (";
1281  if (arg)
1282  sql += sprintf("partition by %s", arg);
1283  sql += ")";
1284  return sql;
1285  },
1286  ),
1287  COP_YEAR: (
1288  "code": string (string arg1, any arg) {
1289  return sprintf("to_char(%s, 'YYYY')", arg1);
1290  }
1291  ),
1292  COP_YEAR_MONTH: (
1293  "code": string (string arg1, any arg) {
1294  return sprintf("to_char(%s, 'YYYY-MM')", arg1);
1295  }
1296  ),
1297  COP_YEAR_DAY: (
1298  "code": string (string arg1, any arg) {
1299  return sprintf("to_char(%s, 'YYYY-MM-DD')", arg1);
1300  }
1301  ),
1302  COP_YEAR_HOUR: (
1303  "code": string (string arg1, any arg) {
1304  return sprintf("to_char(%s, 'YYYY-MM-DD HH24')", arg1);
1305  }
1306  ),
1307  COP_SEQ: (
1308  "code": string (string arg1, any arg) {
1309  return sprintf("%s.nextval", arg);
1310  }
1311  ),
1312  );
1313 
1316  IOP_SEQ: (
1317  "arg": Type::String,
1318  "immediate": True,
1319  "code": string (string cve, string arg) {
1320  return sprintf("%s.nextval", arg);
1321  },
1322  ),
1323  );
1324 
1325 public:
1326 
1327  private :
1328  // schema name
1329  string schema;
1330 
1331  // tablespace name
1332  *string tablespace;
1333 
1334  // is the table read only?
1335  bool readonly;
1336 
1337  // table comment
1338  *string comment;
1339 
1340  // dblink
1341  *string dblink;
1342 
1343  // Oracle server major version
1344  int ora_major;
1345 
1346 public:
1347 
1348  constructor(AbstractDatasource nds, string nname, *hash opts);
1349 
1350 
1351  private bool checkExistenceImpl();
1352 
1353 
1354  private setTableInfoIntern();
1355 
1356 
1358  string getSqlName();
1359 
1360 
1361  private hash setSchemaTable();
1362 
1363 
1364  private setDblinkSchema();
1365 
1366 
1367  private hash setTable();
1368 
1369 
1370  private string getUserSchema();
1371 
1372 
1373  private string getDBString();
1374 
1375 
1377  string getSchemaName();
1378 
1379 
1381  *string getTablespaceName();
1382 
1383 
1385  *string getComment();
1386 
1387 
1388  bool readOnly();
1389 
1390 
1391  private hash getColumnOptions();
1392 
1393 
1394  private hash getColumnDescOptions();
1395 
1396 
1398  private hash getSelectOptions();
1399 
1400 
1401  private getSelectWhereSqlUnlocked(reference sql, reference args, *hash qh, *hash jch, bool join = False, *hash ch);
1402 
1403 
1404  private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch);
1405 
1406 
1408  private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh);
1409 
1410 
1411  private Columns describeImpl();
1412 
1413 
1414  private OraclePrimaryKey getPrimaryKeyImpl();
1415 
1416 
1417  private Indexes getIndexesImpl();
1418 
1419 
1420  private ForeignConstraints getForeignConstraintsImpl(*hash opts);
1421 
1422 
1423  private Constraints getConstraintsImpl();
1424 
1425 
1426  private string getSelectSqlName(*hash qh);
1427 
1428 
1429  private Triggers getTriggersImpl();
1430 
1431 
1432  string getCreateTableSqlImpl(*hash opt);
1433 
1434 
1435  private *list getCreateMiscSqlImpl(*hash opt, bool cache);
1436 
1437 
1438  private string getCreateSqlImpl(list l);
1439 
1440 
1441  private string getRenameSqlImpl(string new_name);
1442 
1443 
1444  private AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
1445 
1446 
1447  private AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
1448 
1449 
1450  private AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
1451 
1452 
1453  private AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
1454 
1455 
1456  private AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
1457 
1458 
1459  private AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
1460 
1461 
1462  private AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
1463 
1464 
1465  private bool tryInsertImpl(string sql, hash row);
1466 
1467 
1468  private *list getAlignSqlImpl(AbstractTable t, *hash opt);
1469 
1470 
1471  private hash getQoreTypeMapImpl();
1472 
1473 
1474  private hash getTypeMapImpl();
1475 
1476 
1477  private hash getIndexOptions();
1478 
1479 
1480  private hash getConstraintOptions();
1481 
1482 
1483  private hash getTableCreationOptions();
1484 
1485 
1486  private hash getAlignTableOptions();
1487 
1488 
1490  private hash getWhereOperatorMap();
1491 
1492 
1494  private hash getColumnOperatorMap();
1495 
1496 
1498  private hash getInsertOperatorMap();
1499 
1500 
1502  private *string getSqlValueImpl(any v);
1503 
1504 
1506  string getColumnSqlName(string col);
1507 
1508 
1510  list getColumnSqlNames(softlist cols);
1511 
1512 
1513  private bool emptyImpl();
1514 
1515 
1516  private setupTableImpl(hash desc, *hash opt);
1517 
1518 
1520  private bool constraintsLinkedToIndexesImpl();
1521 
1522 
1524  private bool uniqueIndexCreatesConstraintImpl();
1525 
1526 
1528  private bool supportsTablespacesImpl();
1529 
1530 
1532  private copyImpl(AbstractTable old);
1533 
1534 
1535  };
1536 };
represents an Oracle unique constraint
Definition: OracleSqlUtil.qm.dox.h:450
private hash getSelectOptions()
override in subclasses to return driver-specific options
const Date
represents an Oracle materialized view
Definition: OracleSqlUtil.qm.dox.h:738
date date(date dt)
const COP_SEQ
const Hash
const OracleCreationOptions
oracle-specific generic creation options
Definition: OracleSqlUtil.qm.dox.h:775
list listSynonyms()
returns a list of string synonym names in the database
the OracleSqlUtil namespace contains all the objects in the OracleSqlUtil module
Definition: OracleSqlUtil.qm.dox.h:280
private hash getAlignSchemaOptions()
returns driver-specific options to the base abstract class
const String
const DefaultIopMap
string sprintf(string fmt,...)
const OP_IN
bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
const DefaultCopMap
ListIterator packageIterator()
returns an iterator listing the string package names in the database
const VARCHAR
*string tablespace
the tablespace name of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:372
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:743
*string view_type_owner
Owner of the type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:597
represents an Oracle table
Definition: OracleSqlUtil.qm.dox.h:1100
private hash getInsertOperatorMap()
returns the insert operator map for this object
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:747
const COP_OVER
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:815
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
*OracleType getType(string name)
returns an OracleType object for the package name given or NOTHING if the object does not exist or is...
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:601
bool enabled
True if the trigger is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:630
const True
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
const SZ_MAND
const CHAR
const OracleIndexOptions
Oracle-specific index options.
Definition: OracleSqlUtil.qm.dox.h:1227
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:399
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:427
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:699
number number(softnumber n)
const COP_YEAR_HOUR
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:1257
binary binary()
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:1240
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
const False
*string tablespace
any tablespace for the unique key index
Definition: OracleSqlUtil.qm.dox.h:458
constructor(AbstractDatasource nds, *hash opts)
creates the object from the arguments given
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:455
represents an Oracle view
Definition: OracleSqlUtil.qm.dox.h:587
list getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
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
list list(...)
const Float
private hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
const Boolean
string getEnableSql(string table_name, *hash opt)
returns a string that can be used to enable the constraint in the database
const OracleReservedWords
hash of reserved words
Definition: OracleSqlUtil.qm.dox.h:823
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
const SZ_NUM
date microseconds(softint us)
const Binary
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
*OraclePackage getPackage(string name)
returns an OraclePackage object for the package name given or NOTHING if the object does not exist or...
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:595
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
bool exists(...)
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:1221
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:745
const COP_YEAR_MONTH
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
const BLOB
the Oracle specialization for SqlUtil::AbstractDatabase
Definition: OracleSqlUtil.qm.dox.h:770
string type(any arg)
int byte_size
byte size of the column
Definition: OracleSqlUtil.qm.dox.h:297
const CLOB
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:809
const NOTHING
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:1105
string string(softstring str)
const OracleAlignSchemaOptions
oracle-specific schema description / alignment options
Definition: OracleSqlUtil.qm.dox.h:780
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:1235
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
const OracleIopMap
a hash of default value operator descriptions for Oracle
Definition: OracleSqlUtil.qm.dox.h:1315
string getSchemaName()
returns the schema name
represents an Oracle check constraint
Definition: OracleSqlUtil.qm.dox.h:422
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:353
clearIndex()
clears any index base for the constraint
represents an Oracle package
Definition: OracleSqlUtil.qm.dox.h:711
const COP_YEAR
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:290
*string type_text
Type clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:593
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:1275
list getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table ...
private hash getColumnOperatorMap()
returns the column operator map for this object
const OracleSelectOptions
Oracle select options.
Definition: OracleSqlUtil.qm.dox.h:1252
const QoreTypeMap
maps qore type names to an oracle type
Definition: OracleSqlUtil.qm.dox.h:1195
hash join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash opt)
*string body_src
package body source
Definition: OracleSqlUtil.qm.dox.h:716
*OracleMaterializedView getMaterializedView(string name)
returns an OracleMaterializedView object for the package name given or NOTHING if the object does not...
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
const COP_YEAR_DAY
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:512
*string view_type
Type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:599
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
const Object
represents an Oracle sequence
Definition: OracleSqlUtil.qm.dox.h:570
represents an Oracle trigger
Definition: OracleSqlUtil.qm.dox.h:625
OracleTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns an OracleTable object corresponding to the arguments
hash hash(object obj)
bool container_data
Indicates whether the view contains container-specific data.
Definition: OracleSqlUtil.qm.dox.h:603
const OracleSchemaDescriptionOptions
oracle-specific schema description keys
Definition: OracleSqlUtil.qm.dox.h:794
const SZ_OPT
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:1215
const IOP_SEQ
represents an Oracle foreign constraint
Definition: OracleSqlUtil.qm.dox.h:394
represents an Oracle type
Definition: OracleSqlUtil.qm.dox.h:679
represents an Oracle primary key
Definition: OracleSqlUtil.qm.dox.h:507
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:369
string join(string str,...)
const NUMERIC
const Number
private softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
represents an Oracle index
Definition: OracleSqlUtil.qm.dox.h:364
const DefaultOpMap
bool char_used
the column uses character semantics
Definition: OracleSqlUtil.qm.dox.h:295
represents an Oracle function
Definition: OracleSqlUtil.qm.dox.h:687
the base class for Oracle code objects
Definition: OracleSqlUtil.qm.dox.h:654
string getDisableSql(string table_name)
returns a string that can be used to temporarily disable the constraint from the database ...