Qore OracleSqlUtil Module Reference  1.2
 All Classes Namespaces Functions Variables Groups Pages
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 - 2016 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.12 or better
26 
27 // requires the SqlUtil module
28 
29 // requires the Util module
30 
31 // for bindOracleCollection
32 
33 // don't use "$" signs for variables and class members, assume local variable scope
34 
35 // require type definitions everywhere
36 
37 // enable all warnings
38 
39 
40 /* Version History: see docs below
41 */
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));
72  @endcode
73  note that the following simpler SQL is generated for Oracle 12c+ servers:
74  @code{.py}
75 $ds.vselectRows("select * from schema.table where type = %v order by type offset %v rows fetch next %v rows only", ("user", 200, 100));
76  @endcode
77 
78  @subsection ora_in_operator IN Operator on Oracle
79 
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.
82 
83  For example, the following query:
84  @code{.py}
85 my *hash $q = $table.select(("where": ("col1": op_in(1, 2, 3, 4))));
86  @endcode
87 
88  Results in the equivalent of the following SQL:
89  @code{.py}
90 my *hash $q = $ds.select("select * from schema.table where col1 in (select column_value from table(%v))", bindOracleCollection("SYS.ODCIVARCHAR2LIST", (1,2,3,4)));
91  @endcode
92 
93  @htmlonly <style><!-- td.qore { background-color: #5b9409; color: white; } --></style> @endhtmlonly
94  <table>
95  <tr>
96  <td class="qore"><b>Qore Type</b></td>
97  <td class="qore"><b>Oracle Collection</b></td>
98  </tr>
99  <tr>
100  <td>Date</td>
101  <td>\c SYS.ODCIDATELIST</td>
102  </tr>
103  <tr>
104  <td>Float</td>
105  <td>\c SYS.ODCINUMBERLIST</td>
106  </tr>
107  <tr>
108  <td>Integer</td>
109  <td>\c SYS.ODCINUMBERLIST</td>
110  </tr>
111  <tr>
112  <td>Number</td>
113  <td>\c SYS.ODCINUMBERLIST</td>
114  </tr>
115  <tr>
116  <td>String</td>
117  <td>\c SYS.ODCIVARCHAR2LIST</td>
118  </tr>
119  </table>
120 
121  There universal collections are limited to 32767 elements. And \c SYS.ODCIVARCHAR2LIST element size is \c VARCHAR2(4000).
122 
123  @subsection ora_partitioning_select Partition Support in Selects
124 
125  It's possible to select from a particular partition of a table with %OracleSqlUtil;
126  @ref OracleSqlUtil::OracleTable::OracleSelectOptions "OracleSelectOptions" defines the \c "partition" key which can be added to a
127  @ref select_option_hash "select option hash" to specify the partition to select from as in the following example:
128  @code{.py}
129 my *list $rows = $table.selectRows(("created": op_gt(2012-05-01), "partition": "p1"));
130  @endcode
131  Which generates an SQL command like the following:
132  @code{.py}
133 my *list $rows = $ds.vselectRows("select * from schema.table partition(p1) where created > %v", (2012-05-01));
134  @endcode
135 
136  @subsection ora_partitioning_join Partition Support in Joins
137 
138  It's possible to perform a join on a particular partition of a table with %OracleSqlUtil; the join option \c "partition" is
139  supported to specify the partition to join on as in the following example:
140  @code{.py}
141 my *list $rows = $table.selectRows(("join": join_inner($table2, "t2", ("id": "altid"), NOTHING, ("partition": "p2"))));
142  @endcode
143  Which generates an SQL command like the following:
144  @code{.py}
145 my *list $rows = $ds.vselectRows("select * from schema.table inner join schema.table2 partition(p2) t2 on (schema.table.id = t2.altid)");
146  @endcode
147 
148  @section ora_schema_management Schema Management on Oracle
149 
150  Note that when getting an object description from an Oracle database, if the object cannot be found in the connection schema, then
151  if a synonym of the same type exists and the target object is accessible, then the target object is read automatically and the owning
152  schema name is also set to the actual owner of the object.
153 
154  @subsection ora_type_mapping Type Mapping
155 
156  Column types are mapped from %Qore types as follows:
157 
158  <b>Oracle Column Type Mappings</b>
159  <table>
160  <tr>
161  <td class="qore"><b>Generic Type Name</b></td>
162  <td class="qore"><b>Oracle Type Used</b></td>
163  </tr>
164  <tr>
165  <td>\c float</td>
166  <td>\c number</td>
167  </tr>
168  <tr>
169  <td>\c integer</td>
170  <td>\c number</td>
171  </tr>
172  <tr>
173  <td>\c number</td>
174  <td>\c number</td>
175  </tr>
176  <tr>
177  <td>\c string</td>
178  <td>\c varchar2</td>
179  </tr>
180  <tr>
181  <td>\c date</td>
182  <td>\c timestamp(6)</td>
183  </tr>
184  <tr>
185  <td>\c binary</td>
186  <td>\c blob</td>
187  </tr>
188  <tr>
189  <td>@ref SqlUtil::BLOB</td>
190  <td>\c blob</td>
191  </tr>
192  <tr>
193  <td>@ref SqlUtil::CHAR</td>
194  <td>\c char</td>
195  </tr>
196  <tr>
197  <td>@ref SqlUtil::CLOB</td>
198  <td>\c clob</td>
199  </tr>
200  <tr>
201  <td>@ref SqlUtil::NUMERIC</td>
202  <td>\c number</td>
203  </tr>
204  <tr>
205  <td>@ref SqlUtil::VARCHAR</td>
206  <td>\c varchar2</td>
207  </tr>
208  </table>
209 
210  To use other types, use the \c "native_type" @ref SqlUtil::AbstractTable::ColumnDescOptions "column description option" with the
211  native Oracle type name instead (under the \c "driver" and \c "oracle" keys for schemas supporting multiple databases).
212 
213  @subsection ora_other_objects Additional Object Types Supported
214 
215  The following additional schema objects can be managed with %OracleSqlUtil:
216  - @ref ora_materialized_views "materialized views"
217  - @ref ora_packages "packages"
218  - @ref ora_types "types"
219 
220  @subsection ora_materialized_views Materialized Views
221 
222  The @ref schema_desc_hash takes an optional key, \c "materialized_views" that allows materialized views in Oracle schemas to be managed along with other objects.
223 
224  The \c "materialized_views" should be assigned to a hash, each key name is the name of the materialized view, and the values are hashes with the
225  following keys:
226  - \c "logging": (@ref bool_type "bool") if the materialized view should be logged
227  - \c "use_index": (@ref bool_type "bool") if the materialized view should be indexed
228  - \c "src": (@ref bool_type "bool") the source of the materialized view
229 
230  The \c "materialized_views" key can go in the top level of the @ref schema_desc_hash for Oracle-only schemas, or, for schemas targeting multiple database types, under the \c "driver" and \c "oracle" keys as in the following example:
231 
232  @code{.py}
233 my hash $schema = (
234  "driver": (
235  "oracle": (
236  "materialized_views": (
237  "example_mv": (
238  "logging": False,
239  "use_index": False,
240  "src": "select type, count(1) total_count from table group by type",
241  ),
242  ),
243  ),
244  ),
245 );
246  @endcode
247 
248  @subsection ora_packages Packages
249 
250  The @ref schema_desc_hash takes an optional key, \c "packages" that allows packages in Oracle schemas to be managed along with other objects.
251 
252  The \c "packages" should be assigned to a hash, each key name is the name of the package, and the values are hashes with the
253  following key:
254  - \c "src": (@ref bool_type "bool") the source of the package
255 
256  The \c "packages" key can go in the top level of the @ref schema_desc_hash for Oracle-only schemas, or, for schemas targeting multiple database types, under the \c "driver" and \c "oracle" keys as in the following example:
257 
258  @code{.py}
259 my hash $schema = (
260  "driver": (
261  "oracle": (
262  "packages": (
263  "example_pkg": (
264  "src": "types as
265 type cursorType is ref cursor;
266 MYSTATCOMPLETE constant order_status.orderstatus%type := 'C';
267 MYSTATERROR constant order_status.orderstatus%type := 'E';
268 ",
269  ),
270  ),
271  ),
272  ),
273 );
274  @endcode
275 
276  @subsection ora_types Types
277 
278  The @ref schema_desc_hash takes an optional key, \c "types" that allows types in Oracle schemas to be managed along with other objects.
279 
280  The \c "types" should be assigned to a hash, each key name is the name of the type, and the values are strings giving the type definition.
281 
282  The \c "types" key can go in the top level of the @ref schema_desc_hash for Oracle-only schemas, or, for schemas targeting multiple database types, under the \c "driver" and \c "oracle" keys as in the following example:
283 
284  @code{.py}
285 my hash $schema = (
286  "driver": (
287  "oracle": (
288  "types": (
289  "num_array": "table of number",
290  "str_array": "table of varchar2(240)",
291  ),
292  ),
293  ),
294 );
295  @endcode
296 
297  @see OracleSqlUtil::OracleDatabase::OracleSchemaDescriptionOptions for a list of Oracle-specific schema description hash keys.
298 
299  @section ora_relnotes Release Notes
300 
301  @subsection v12 OracleSqlUtil v1.2
302  - implemented support for the \c "returning" clause as an insert option
303  - implemented support for views for DML in the @ref OracleSqlUtil::OracleTable class
304  - implemented @ref OracleSqlUtil::OracleTable::getBaseType()
305  - implemented support for Oracle pseudocolumns in queries
306  - implemented support for @ref SqlUtil::cop_cast() operator
307  - fixed bugs in @ref SqlUtil::cop_seq() and @ref SqlUtil::cop_seq_currval() (<a href="https://github.com/qorelanguage/qore/issues/624">issue 624</a>)
308  - return lists from Oracle's data dictionary ordered
309  - implemented @ref OracleSqlUtil::OracleTable::bindEmptyStringsAsNull()
310  - implemented high-performance "upsert" (merge) support also supporting bulk DML
311  - implemented @ref SqlUtil::cop_substr() and @ref SqlUtil::uop_substr() operators (<a href="https://github.com/qorelanguage/qore/issues/801">issue 801</a>)
312  - implemented @ref SqlUtil::op_substr() where operator (<a href="https://github.com/qorelanguage/qore/issues/883">issue 883</a>)
313 
314  @subsection v11 OracleSqlUtil v1.1
315  - fixed selects with "limit" but no "offset"
316  - convert date/time values to timestamps with microseconds resolution instead of dates with second resolution when dynamically inserting values as strings in SQL (binding by value not affected)
317  - fixed schema information classes when the "string-numbers" driver option is enabled
318 
319  @subsection v10 OracleSqlUtil v1.0
320  - initial release
321 */
322 
324 namespace OracleSqlUtil {
326  OracleTable get_table(AbstractDatasource nds, string nname, *hash opts);
327 
328 
330  OracleDatabase get_database(AbstractDatasource nds, *hash opts);
331 
332 
335 
336 public:
337  public :
339  bool char_used;
342 
343 public:
344 
345  constructor(string n, string nt, *string qt, softint sz, bool nul, *string dv, *string cm, bool is_char = False, bool cu = False, softint bs) ;
346 
347 
349  string getNativeTypeString();
350 
351 
353 
360  list getAddColumnSql(AbstractTable t);
361 
362 
364 
374  list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
375 
376 
378 
388  string getRenameSql(AbstractTable t, string new_name);
389 
390 
392  bool equalImpl(AbstractColumn c);
393 
394  };
395 
398 
399 public:
400  constructor(string n, string nt, *string qt, softint sz, bool nul, *string dv, *string cm, softint bs, softint n_scale = 0) ;
401 
402 
403  string getNativeTypeString();
404 
405  };
406 
409 
410 public:
411  public :
413  string native_type;
414 
416  *string tablespace;
417 
418 public:
419 
421  constructor(string n, bool u, hash c, string nt, *string t) ;
422 
423 
425  string getCreateSql(string table_name, *hash opt);
426 
427 
429  bool equalImpl(AbstractIndex ix);
430 
431 
433  string getRenameSql(string table_name, string new_name);
434 
435  };
436 
439 
440 public:
441  public :
443  bool enabled;
444 
445 public:
446 
447  constructor(string n, Columns c, ForeignConstraintTarget t, bool e) ;
448 
449 
450  string getCreateSql(string table_name, *hash opt);
451 
452 
453  softlist getRenameSql(string table_name, string new_name);
454 
455 
457  string getDisableSql(string table_name);
458 
459 
461  string getEnableSql(string table_name, *hash opt);
462 
463  };
464 
467 
468 public:
469  public :
471  bool enabled;
472 
473 public:
474 
475  constructor(string n, string n_src, bool e = True) ;
476 
477 
478  string getCreateSql(string table_name, *hash opt);
479 
480 
481  softlist getRenameSql(string table_name, string new_name);
482 
483 
485  string getDisableSql(string table_name);
486 
487 
489  string getEnableSql(string table_name, *hash opt);
490 
491  };
492 
495 
496 public:
497  private :
499  bool enabled;
500 
502  *string tablespace;
503 
504 public:
505 
506  constructor(string n, hash n_cols, bool e = True, *string ts) ;
507 
508 
510 
525  OracleColumn memberGate(string k);
526 
527 
528  bool setIndexBase(string ix);
529 
530 
532  clearIndex();
533 
534 
535  string getCreateSql(string table_name, *hash opts);
536 
537 
538  softlist getRenameSql(string table_name, string new_name);
539 
540 
542  string getDisableSql(string table_name);
543 
544 
546  string getEnableSql(string table_name, *hash opt);
547 
548 
550  bool isEnabled();
551 
552 
554  *string getTablespace();
555 
556  };
557 
560 
561 public:
562  private :
564  *string tablespace;
565 
566 public:
567 
568  constructor();
569 
570 
571  constructor(string n, *hash c, *string ts) ;
572 
573 
575 
590  OracleColumn memberGate(string k);
591 
592 
593  bool setIndexBase(string ix);
594 
595 
597  clearIndex();
598 
599 
600  string getCreateSql(string table_name, *hash opts);
601 
602 
603  softlist getRenameSql(string table_name, string new_name);
604 
605 
607 
609  string getDropSql(string table_name);
610 
611 
613  string getDisableSql(string table_name);
614 
615 
617  string getEnableSql(string table_name, *hash opt);
618 
619  };
620 
623 
624 public:
626  constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end) ;
627 
628 
630  string getCreateSql(*hash opt);
631 
632 
634  string getRenameSql(string new_name);
635 
636  };
637 
640 
641 public:
642  public :
644  *string type_text;
646  *string oid_text;
650  *string view_type;
652  *string superview_name;
655 
656 public:
657 
659  constructor(string n_name, string n_src, *string n_schema, *string n_type_text,
660  *string n_oid_text, *string n_view_type_owner,
661  *string n_view_type, *string n_superview_name,
662  bool n_updatable, bool n_container_data)
663  ;
664 
665 
667  string getCreateSql(*hash opt);
668 
669 
671  softlist getRenameSql(string new_name);
672 
673  };
674 
677 
678 public:
679  public :
681  bool enabled;
682 
683 public:
684 
685  constructor(string n, string n_src, bool en = True) ;
686 
687 
688  softlist getCreateSql(string table_name, *hash opt);
689 
690 
692  bool equalImpl(AbstractFunctionBase t);
693 
694 
696  softlist getRenameSql(string table_name, string new_name);
697 
698 
700  softlist getDropSql(string table_name);
701 
702  };
703 
706 
707 public:
709 
713  constructor(string n, string n_type, string n_src) ;
714 
715 
717  softlist getCreateSql(*hash opt);
718 
719 
721  bool equalImpl(AbstractFunctionBase t);
722 
723 
725  list getRenameSql(string new_name);
726 
727  };
728 
730 class OracleType : public OracleCodeBase {
731 
732 public:
733  constructor(string n_name, string n_src) ;
734 
735 
737 
744  string getDropSqlForce();
745 
746  };
747 
750 
751 public:
753 
756  constructor(string n, string n_src) ;
757 
758  };
759 
762 
763 public:
765 
768  constructor(string n, string n_src) ;
769 
770  };
771 
774 
775 public:
776  private :
778  *string body_src;
779 
780 public:
781 
783 
787  constructor(string n, string n_src, *string n_body_src) ;
788 
789 
791  list getCreateSql(*hash opt);
792 
793 
795  bool equalImpl(AbstractFunctionBase t);
796 
797  };
798 
801 
802 public:
803  public :
805  bool logging;
807  bool use_index;
809  *string tablespace;
810 
811 public:
812 
814 
820  constructor(string n, string n_src, bool n_logging = True, bool n_use_index = True, *string n_tablespace) ;
821 
822 
824  softlist getCreateSql(*hash opt);
825 
826 
827  bool equalImpl(AbstractFunctionBase t);
828 
829  };
830 
833 
834 public:
835  public :
837  const OracleCreationOptions = AbstractDatabase::CreationOptions + (
838  "compute_statistics": Type::Boolean,
839  );
840 
842  const OracleAlignSchemaOptions = AbstractDatabase::CreationOptions
843  + OracleCreationOptions
844  + OracleTable::OracleAlignTableOptions
845  ;
846 
848 
856  const OracleSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
857  "types": Type::Hash,
858  "type_map": Type::Hash,
859 
860  "packages": Type::Hash,
861  "package_map": Type::Hash,
862 
863  "materialized_views": Type::Hash,
864  "materialized_view_map": Type::Hash,
865 
866  //"synonyms": Type::Hash,
867  //"synonym_map": Type::Hash,
868  );
869 
871  const OraclePackageDescriptionOptions = (
872  "src": Type::String,
873  "body": Type::String,
874  );
875 
877  const OracleMaterializedViewDescriptionOptions = (
878  "logging": Type::Boolean,
879  "use_index": Type::Boolean,
880  "tablespace": Type::String,
881  "src": Type::String,
882  );
883 
885  const OracleReservedWords = (
886  "access": True,
887  "else": True,
888  "modify": True,
889  "start": True,
890  "add": True,
891  "exclusive": True,
892  "noaudit": True,
893  "select": True,
894  "all": True,
895  "exists": True,
896  "nocompress": True,
897  "session": True,
898  "alter": True,
899  "file": True,
900  "not": True,
901  "set": True,
902  "and": True,
903  "float": True,
904  "notfound": True,
905  "share": True,
906  "any": True,
907  "for": True,
908  "nowait": True,
909  "size": True,
910  "arraylen": True,
911  "from": True,
912  "null": True,
913  "smallint": True,
914  "as": True,
915  "grant": True,
916  "number": True,
917  "sqlbuf": True,
918  "asc": True,
919  "group": True,
920  "of": True,
921  "successful": True,
922  "audit": True,
923  "having": True,
924  "offline": True,
925  "synonym": True,
926  "between": True,
927  "identified": True,
928  "on": True,
929  "sysdate": True,
930  "by": True,
931  "immediate": True,
932  "online": True,
933  "table": True,
934  "char": True,
935  "in": True,
936  "option": True,
937  "then": True,
938  "check": True,
939  "increment": True,
940  "or": True,
941  "to": True,
942  "cluster": True,
943  "index": True,
944  "order": True,
945  "trigger": True,
946  "column": True,
947  "initial": True,
948  "pctfree": True,
949  "uid": True,
950  "comment": True,
951  "insert": True,
952  "prior": True,
953  "union": True,
954  "compress": True,
955  "integer": True,
956  "privileges": True,
957  "unique": True,
958  "connect": True,
959  "intersect": True,
960  "public": True,
961  "update": True,
962  "create": True,
963  "into": True,
964  "raw": True,
965  "user": True,
966  "current": True,
967  "is": True,
968  "rename": True,
969  "validate": True,
970  "date": True,
971  "level": True,
972  "resource": True,
973  "values": True,
974  "decimal": True,
975  "like": True,
976  "revoke": True,
977  "varchar": True,
978  "default": True,
979  "lock": True,
980  "row": True,
981  "varchar2": True,
982  "delete": True,
983  "long": True,
984  "view": True,
985  "desc": True,
986  "maxextents": True,
987  "rowlabel": True,
988  "whenever": True,
989  "distinct": True,
990  "minus": True,
991  "rownum": True,
992  "where": True,
993  "drop": True,
994  "mode": True,
995  "rows": True,
996  "with": True,
997  );
998 
1000  const OracleRebuildIndexOptions = (
1001  "parallel" : Type::Boolean,
1002  "logging" : Type::Boolean,
1003  "statictics" : Type::Boolean,
1004  "tablespace" : Type::String,
1005  "cond_rebuild" : Type::Boolean,
1006  "cond_maxheight" : Type::Int,
1007  "cond_maxleafpct" : Type::Int,
1008  );
1009 
1011  const OracleComputeStatisticsOptions = ComputeStatisticsOptions + (
1012  "estimate_percent" : Type::Int,
1013  "block_sample" : Type::Boolean,
1014  "method_opt" : Type::String,
1015  "degree" : Type::Int,
1016  "granularity" : Type::String,
1017  "cascade" : Type::Boolean,
1018  "stattab" : Type::String,
1019  "statid" : Type::String,
1020  "options" : Type::String,
1021  "statown" : Type::String,
1022  );
1023 
1024 public:
1025 
1027  constructor(AbstractDatasource nds, *hash opts) ;
1028 
1029 
1030  private list featuresImpl();
1031 
1032 
1033  private OracleSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
1034 
1035 
1036  private getSchemaName(reference name, reference schema);
1037 
1038 
1039  private *AbstractSequence getSequenceImpl(string name);
1040 
1041 
1042  private *AbstractView getViewImpl(string name);
1043 
1044 
1045  private OracleFunction makeFunctionImpl(string name, string src, *hash opts);
1046 
1047 
1048  private OracleProcedure makeProcedureImpl(string name, string src, *hash opts);
1049 
1050 
1051  private OraclePackage makePackage(string name, string src, string body, *hash opts);
1052 
1053 
1054  private OraclePackage makePackageFromDescription(string name, hash ph, *hash opts);
1055 
1056 
1057  private OracleType makeType(string name, string src, *hash opts);
1058 
1059 
1060  private OracleMaterializedView makeMaterializedView(string name, string src, bool logging = True, bool use_index = True, *string tablespace, *hash opts);
1061 
1062 
1063  private OracleMaterializedView makeMaterializedViewFromDescription(string name, hash mvh, *hash opts);
1064 
1065 
1066  private list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
1067 
1068 
1069  private list getAlignSqlImpl(hash schema_hash, *hash opt);
1070 
1071 
1072  private *OracleFunction getFunctionImpl(string name);
1073 
1074 
1075  private *OracleProcedure getProcedureImpl(string name);
1076 
1077 
1079  *OraclePackage getPackage(string name);
1080 
1081 
1083  *OracleType getType(string name);
1084 
1085 
1087  *OracleMaterializedView getMaterializedView(string name);
1088 
1089 
1090  private *string getSource(string type, string name);
1091 
1092 
1093  private checkSource(string type, string name, reference src);
1094 
1095 
1097  list listSynonyms();
1098 
1099 
1101  ListIterator synonymIterator();
1102 
1103 
1105  list listTypes();
1106 
1107 
1109  ListIterator typeIterator();
1110 
1111 
1113  list listPackages();
1114 
1115 
1117  ListIterator packageIterator();
1118 
1119 
1121  list listMaterializedViews();
1122 
1123 
1125  ListIterator materializedViewIterator();
1126 
1127 
1128  private list listTablesImpl();
1129 
1130 
1131  private list listFunctionsImpl();
1132 
1133 
1134  private list listProceduresImpl();
1135 
1136 
1137  private list listSequencesImpl();
1138 
1139 
1140  private list listViewsImpl();
1141 
1142 
1143  private list getListIntern(string type);
1144 
1145 
1146  private list getListIntern(list l);
1147 
1148 
1149  private string getCreateSqlImpl(list l);
1150 
1151 
1152  static string getCreateSql(list l);
1153 
1155  private hash getCreationOptions();
1156 
1157 
1159  private hash getAlignSchemaOptions();
1160 
1161 
1163  private hash getSchemaDescriptionOptions();
1164 
1165 
1167  private hash getRebuildIndexOptions();
1168 
1169 
1171  private hash getComputeStatisticsOptions();
1172 
1173 
1175  private softint getNextSequenceValueImpl(string name);
1176 
1177 
1179  private softint getCurrentSequenceValueImpl(string name);
1180 
1181 
1183  private bool supportsSequencesImpl();
1184 
1185 
1187  private bool supportsTypesImpl();
1188 
1189 
1191  private bool supportsPackagesImpl();
1192 
1193 
1195 
1207  bool rebuildIndexAnalyze(AbstractIndex index, int maxh, int maxleaf);
1208 
1209 
1211 
1223  bool rebuildIndexAnalyze(string name, int maxh, int maxleaf);
1224 
1225 
1227  private bool rebuildIndexImpl(string name, *hash options);
1228 
1229 
1231  private computeStatisticsImpl(*hash options);
1232 
1233 
1235  private computeStatisticsSchemaImpl(*hash options);
1236 
1237 
1239  private computeStatisticsTablesImpl(*hash options);
1240 
1241 
1243  private reclaimSpaceImpl(*hash options);
1244 
1245 
1246  };
1247 
1249 
1252 
1253 public:
1254  public :
1256  const OraTypeMap = (
1257  "number": ("qore": Type::Number, "size": SZ_NUM, "size_range": (1, 38), "scale_range": (-84, 127)),
1258  "varchar2": ("qore": Type::String, "size": SZ_MAND, "size_range": (1, 4000), "is_char": True),
1259  "char": ("qore": Type::String, "size": SZ_MAND, "size_range": (1, 4000), "is_char": True),
1260  "date": ("qore": Type::Date,),
1261  "timestamp": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 9)),
1262  "timestamp with time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 9)),
1263  "timestamp with local time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 9)),
1264  "interval year to month": ("qore": Type::Date,),
1265  "interval day to second": ("qore": Type::Date,),
1266  "timestamp(0)": ("qore": Type::Date,),
1267  "timestamp(1)": ("qore": Type::Date,),
1268  "timestamp(2)": ("qore": Type::Date,),
1269  "timestamp(3)": ("qore": Type::Date,),
1270  "timestamp(4)": ("qore": Type::Date,),
1271  "timestamp(5)": ("qore": Type::Date,),
1272  "timestamp(6)": ("qore": Type::Date,),
1273  "timestamp(7)": ("qore": Type::Date,),
1274  "timestamp(8)": ("qore": Type::Date,),
1275  "timestamp(9)": ("qore": Type::Date,),
1276  "timestamp(0) with time zone": ("qore": Type::Date,),
1277  "timestamp(1) with time zone": ("qore": Type::Date,),
1278  "timestamp(2) with time zone": ("qore": Type::Date,),
1279  "timestamp(3) with time zone": ("qore": Type::Date,),
1280  "timestamp(4) with time zone": ("qore": Type::Date,),
1281  "timestamp(5) with time zone": ("qore": Type::Date,),
1282  "timestamp(6) with time zone": ("qore": Type::Date,),
1283  "timestamp(7) with time zone": ("qore": Type::Date,),
1284  "timestamp(8) with time zone": ("qore": Type::Date,),
1285  "timestamp(9) with time zone": ("qore": Type::Date,),
1286  "timestamp(0) with local time zone": ("qore": Type::Date,),
1287  "timestamp(1) with local time zone": ("qore": Type::Date,),
1288  "timestamp(2) with local time zone": ("qore": Type::Date,),
1289  "timestamp(3) with local time zone": ("qore": Type::Date,),
1290  "timestamp(4) with local time zone": ("qore": Type::Date,),
1291  "timestamp(5) with local time zone": ("qore": Type::Date,),
1292  "timestamp(6) with local time zone": ("qore": Type::Date,),
1293  "timestamp(7) with local time zone": ("qore": Type::Date,),
1294  "timestamp(8) with local time zone": ("qore": Type::Date,),
1295  "timestamp(9) with local time zone": ("qore": Type::Date,),
1296  "interval year(0) to month": ("qore": Type::Date,),
1297  "interval year(1) to month": ("qore": Type::Date,),
1298  "interval year(2) to month": ("qore": Type::Date,),
1299  "interval year(3) to month": ("qore": Type::Date,),
1300  "interval year(4) to month": ("qore": Type::Date,),
1301  "interval year(5) to month": ("qore": Type::Date,),
1302  "interval year(6) to month": ("qore": Type::Date,),
1303  "interval year(7) to month": ("qore": Type::Date,),
1304  "interval year(8) to month": ("qore": Type::Date,),
1305  "interval year(9) to month": ("qore": Type::Date,),
1306  "interval day(0) to second(0)": ("qore": Type::Date,),
1307  "interval day(0) to second(1)": ("qore": Type::Date,),
1308  "interval day(0) to second(2)": ("qore": Type::Date,),
1309  "interval day(0) to second(3)": ("qore": Type::Date,),
1310  "interval day(0) to second(4)": ("qore": Type::Date,),
1311  "interval day(0) to second(5)": ("qore": Type::Date,),
1312  "interval day(0) to second(6)": ("qore": Type::Date,),
1313  "interval day(0) to second(7)": ("qore": Type::Date,),
1314  "interval day(0) to second(8)": ("qore": Type::Date,),
1315  "interval day(0) to second(9)": ("qore": Type::Date,),
1316  "interval day(1) to second(0)": ("qore": Type::Date,),
1317  "interval day(1) to second(1)": ("qore": Type::Date,),
1318  "interval day(1) to second(2)": ("qore": Type::Date,),
1319  "interval day(1) to second(3)": ("qore": Type::Date,),
1320  "interval day(1) to second(4)": ("qore": Type::Date,),
1321  "interval day(1) to second(5)": ("qore": Type::Date,),
1322  "interval day(1) to second(6)": ("qore": Type::Date,),
1323  "interval day(1) to second(7)": ("qore": Type::Date,),
1324  "interval day(1) to second(8)": ("qore": Type::Date,),
1325  "interval day(1) to second(9)": ("qore": Type::Date,),
1326  "interval day(2) to second(0)": ("qore": Type::Date,),
1327  "interval day(2) to second(1)": ("qore": Type::Date,),
1328  "interval day(2) to second(2)": ("qore": Type::Date,),
1329  "interval day(2) to second(3)": ("qore": Type::Date,),
1330  "interval day(2) to second(4)": ("qore": Type::Date,),
1331  "interval day(2) to second(5)": ("qore": Type::Date,),
1332  "interval day(2) to second(6)": ("qore": Type::Date,),
1333  "interval day(2) to second(7)": ("qore": Type::Date,),
1334  "interval day(2) to second(8)": ("qore": Type::Date,),
1335  "interval day(2) to second(9)": ("qore": Type::Date,),
1336  "clob": ("qore": Type::String,),
1337  "blob": ("qore": Type::Binary,),
1338  "long": ("qore": Type::Binary,),
1339  "raw": ("qore": Type::Binary, "size": SZ_MAND, "size_range": (1, 2000)),
1340  "bfile": ("qore": Type::Binary,),
1341  "binary_float": ("qore": Type::Float,),
1342  "binary_double": ("qore": Type::Float,),
1343  "rowid": ("qore": Type::String,),
1344  "urowid": ("qore": Type::String, "size": SZ_OPT, "size_range": (1, 4000)),
1345  );
1346 
1348  const QoreTypeMap = (
1349  "integer": "number",
1350  "float": "number",
1351  "number": "number",
1352  "string": "varchar2",
1353  "date": "timestamp(6)",
1354  "binary": "blob",
1355  SqlUtil::CHAR: "char",
1356  SqlUtil::CLOB: "clob",
1357  SqlUtil::BLOB: "blob",
1358  );
1359 
1360  const OraColumnOpts = (
1361  "character_semantics": Type::Boolean,
1362  );
1363 
1365 
1368  const OraColumnOptions = AbstractTable::ColumnOptions + OraColumnOpts;
1369 
1371 
1374  const OraColumnDescOptions = AbstractTable::ColumnDescOptions + OraColumnOpts;
1375 
1377 
1380  const OracleIndexOptions = AbstractTable::IndexOptions + (
1381  "compute_statistics": Type::Boolean,
1382  );
1383 
1385 
1388  const OracleConstraintOptions = OracleIndexOptions + (
1389  "index": Type::String,
1390  );
1391 
1393  const OracleTableCreationOptions = AbstractTable::TableCreationOptions
1394  + OracleConstraintOptions
1395  + OraColumnOptions
1396  ;
1397 
1398  const OracleAlignTableOptions = AbstractTable::AlignTableOptions + OracleTableCreationOptions;
1399 
1401 
1405  const OracleSelectOptions = AbstractTable::SelectOptions + (
1406  "partition": Type::String,
1407  );
1408 
1410  const OracleOpMap = DefaultOpMap + (
1411  OP_IN: (
1412  "code": string (object t, string cn, softlist arg, reference args, *hash jch, bool join = False, *hash ch, *hash psch) {
1413  // Qorus bug #989 SqlUtil: oracle op_in can fail in large amount of input elements
1414  // There is no support for CLOBs in WHERE clause in Oracle at all.
1415  // Binding large strings (over 4000 chars is performed by a CLOB in Qore driver.
1416  // Result of op_in operator can be "ORA-00932: inconsistent datatypes" if is
1417  // the list longer or if it contains large items with:
1418  // return cn + " in (select regexp_substr(%v,'[^,]+', 1, level) from dual connect by regexp_substr(%v, '[^,]+', 1, level) is not null)";
1419 
1420  // determine list members type. Let's assume the 1st non NULL/NOTHING
1421  // element gives the type code for all elements.
1422  ListIterator it(arg);
1423  int ltype;
1424  while (it.next());
1425 
1426 
1427  // Bind to oracle by expected type
1428  switch (ltype);
1429 
1430 
1431  return cn + " in (select column_value from table(%v))";
1432  throw "MISSING-ORACLE-DRIVER", "op_in requires oracle driver";
1433  },
1434  ),
1435  OP_SUBSTR: (
1436  "code": string (object t, string cn, any arg, reference args, *hash jch, bool join = False, *hash ch, *hash psch) {
1437  args += arg[0]; // start
1438  if (!exists arg[1]);
1439 
1440  args += arg[1]; // count
1441  args += arg[2]; // text
1442  return sprintf("substr(%s,%v,%v) = %v", cn);
1443  },
1444  ),
1445  );
1446 
1448  const OracleCopMap = DefaultCopMap + (
1449  COP_CAST: (
1450  "code": string (string cve, list args) {
1451  string name = QoreTypeMap{args[0]} ?? args[0];
1452  hash desc = OraTypeMap{name};
1453  string sql = sprintf ("cast (%s as %s", cve, name);
1454  switch (name);
1455 
1456  sql += ")";
1457  return sql;
1458  },
1459  ),
1460  COP_SUBSTR: (
1461  "code": string (string cve, list args) {
1462  if (!exists args[1])
1463  return sprintf("substr(%s,%d)", cve, args[0]);
1464  return sprintf("substr(%s,%d,%d)", cve, args[0], args[1]);
1465  },
1466  ),
1467  COP_OVER: (
1468  "argcolumn": True,
1469  "argoptional": True,
1470  "code": string (*string cve, *string arg) {
1471  string sql = cve + " over (";
1472  if (arg)
1473  sql += sprintf("partition by %s", arg);
1474  sql += ")";
1475  return sql;
1476  },
1477  ),
1478  COP_YEAR: (
1479  "code": string (string arg1, any arg) {
1480  return sprintf("to_char(%s, 'YYYY')", arg1);
1481  }
1482  ),
1483  COP_YEAR_MONTH: (
1484  "code": string (string arg1, any arg) {
1485  return sprintf("to_char(%s, 'YYYY-MM')", arg1);
1486  }
1487  ),
1488  COP_YEAR_DAY: (
1489  "code": string (string arg1, any arg) {
1490  return sprintf("to_char(%s, 'YYYY-MM-DD')", arg1);
1491  }
1492  ),
1493  COP_YEAR_HOUR: (
1494  "code": string (string arg1, any arg) {
1495  return sprintf("to_char(%s, 'YYYY-MM-DD HH24')", arg1);
1496  }
1497  ),
1498  COP_SEQ: (
1499  "nocolumn": True,
1500  "withalias": True,
1501  "code": string (*string cve, hash arg, reference psch) {
1502  string sql = sprintf("%s.nextval", arg.seq);
1503  if (arg.as);
1504 
1505  return sql;
1506  }
1507  ),
1508  COP_SEQ_CURRVAL: (
1509  "nocolumn": True,
1510  "withalias": True,
1511  "code": string (*string cve, hash arg, reference psch) {
1512  string sql = sprintf("%s.currval", arg.seq);
1513  if (arg.as);
1514 
1515  return sql;
1516  }
1517  ),
1518  );
1519 
1521  const OracleIopMap = DefaultIopMap + (
1522  IOP_SEQ: (
1523  "arg": Type::String,
1524  "immediate": True,
1525  "code": string (string cve, string arg) {
1526  return sprintf("%s.nextval", arg);
1527  },
1528  ),
1529  IOP_SEQ_CURRVAL: (
1530  "arg": Type::String,
1531  "immediate": True,
1532  "code": string (string cve, string arg) {
1533  return sprintf("%s.currval", arg);
1534  },
1535  ),
1536  );
1537 
1539  const OracleUopMap = DefaultUopMap + (
1540  COP_SEQ: (
1541  "nocolumn": True,
1542  "code": string (*string cve, string arg) {
1543  return sprintf("%s.nextval", arg);
1544  }
1545  ),
1546  COP_SEQ_CURRVAL: (
1547  "nocolumn": True,
1548  "code": string (*string cve, string arg) {
1549  return sprintf("%s.currval", arg);
1550  }
1551  ),
1552  );
1553 
1555  const OraclePseudoColumnHash = (
1556  "rowid": True,
1557  "rownum": True,
1558  "object_id": True,
1559  "object_value": True,
1560  "ora_rowscn": True,
1561  );
1562 
1563 public:
1564 
1565  private :
1566  // schema name
1567  string schema;
1568 
1569  // tablespace name
1570  *string tablespace;
1571 
1572  // is the table read only?
1573  bool readonly;
1574 
1575  // table comment
1576  *string comment;
1577 
1578  // dblink
1579  *string dblink;
1580 
1581  // Oracle server major version
1582  int ora_major;
1583 
1584  // helper flag to indicate if is the OracleTable real table or a view
1585  bool m_isView = False;
1586 
1587 public:
1588 
1589  constructor(AbstractDatasource nds, string nname, *hash opts) ;
1590 
1591 
1592  private bool checkExistenceImpl();
1593 
1594 
1595  private setTableInfoIntern();
1596 
1597 
1599  string getSqlName();
1600 
1601 
1603  bool isView();
1604 
1605 
1606  private hash setSchemaTable();
1607 
1608 
1609  private setDblinkSchema();
1610 
1611 
1612  private hash setTable();
1613 
1614 
1615  private string getUserSchema();
1616 
1617 
1618  private string getDBString();
1619 
1620 
1622  string getSchemaName();
1623 
1624 
1626  *string getTablespaceName();
1627 
1628 
1630  *string getComment();
1631 
1632 
1633  bool readOnly();
1634 
1635 
1636  private hash getColumnOptions();
1637 
1638 
1639  private hash getColumnDescOptions();
1640 
1641 
1643  private hash getSelectOptions();
1644 
1645 
1646  private getSelectWhereSqlUnlocked(reference sql, reference args, *hash qh, *hash jch, bool join = False, *hash ch, *hash psch);
1647 
1648 
1649  private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch, *hash psch, list coll);
1650 
1651 
1653  private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh);
1654 
1655 
1656  private Columns describeImpl();
1657 
1658 
1659  private OraclePrimaryKey getPrimaryKeyImpl();
1660 
1661 
1662  private Indexes getIndexesImpl();
1663 
1664 
1665  private ForeignConstraints getForeignConstraintsImpl(*hash opts);
1666 
1667 
1668  private Constraints getConstraintsImpl();
1669 
1670 
1671  private string getSelectSqlName(*hash qh);
1672 
1673 
1674  private Triggers getTriggersImpl();
1675 
1676 
1677  string getCreateTableSqlImpl(*hash opt);
1678 
1679 
1680  private *list getCreateMiscSqlImpl(*hash opt, bool cache);
1681 
1682 
1683  private string getCreateSqlImpl(list l);
1684 
1685 
1686  private string getRenameSqlImpl(string new_name);
1687 
1688 
1689  private AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
1690 
1691 
1692  private AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
1693 
1694 
1695  private AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
1696 
1697 
1698  private AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
1699 
1700 
1701  private AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
1702 
1703 
1704  private AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
1705 
1706 
1707  private AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
1708 
1709 
1710  private bool tryInsertImpl(string sql, hash row);
1711 
1712 
1713  private *list getAlignSqlImpl(AbstractTable t, *hash opt);
1714 
1715 
1716  private hash getQoreTypeMapImpl();
1717 
1718 
1719  private hash getTypeMapImpl();
1720 
1721 
1722  private hash getIndexOptions();
1723 
1724 
1725  private hash getConstraintOptions();
1726 
1727 
1728  private hash getTableCreationOptions();
1729 
1730 
1731  private hash getAlignTableOptions();
1732 
1733 
1735  private hash getWhereOperatorMap();
1736 
1737 
1739  private hash getColumnOperatorMap();
1740 
1741 
1743  private hash getInsertOperatorMap();
1744 
1745 
1747  private hash getRawUpdateOperatorMap();
1748 
1749 
1751  private *hash getPseudoColumnHash();
1752 
1753 
1755  private *string getSqlValueImpl(any v);
1756 
1757 
1759  string getColumnSqlName(string col);
1760 
1761 
1763  list getColumnSqlNames(softlist cols);
1764 
1765 
1767 
1770  string getBaseType();
1771 
1772 
1774  code getBulkUpsertClosure(hash example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash opt);
1775 
1776 
1778  code getUpsertClosure(hash row, int upsert_strategy = UpsertAuto, *hash opt);
1779 
1780 
1782  private code getUpsertInsertOnly(Columns cols, hash row, *hash opt);
1783 
1784 
1786  private code getUpsertUpdateOnly(Columns cols, hash row, *hash opt);
1787 
1788 
1790  bool hasArrayBind();
1791 
1792 
1794 
1796  bool bindEmptyStringsAsNull();
1797 
1798 
1800  private bool asteriskRequiresPrefix();
1801 
1802 
1803  private *hash doReturningImpl(hash opt, reference sql, list args);
1804 
1805 
1806  private bool emptyImpl();
1807 
1808 
1809  private setupTableImpl(hash desc, *hash opt);
1810 
1811 
1813  private bool constraintsLinkedToIndexesImpl();
1814 
1815 
1817  private bool uniqueIndexCreatesConstraintImpl();
1818 
1819 
1821  private bool supportsTablespacesImpl();
1822 
1823 
1825  private copyImpl(AbstractTable old);
1826 
1827  };
1828 };
represents an Oracle unique constraint
Definition: OracleSqlUtil.qm.dox.h:494
const Date
represents an Oracle materialized view
Definition: OracleSqlUtil.qm.dox.h:800
date date(date dt)
const COP_SEQ
const Hash
const UpsertAuto
const String
const DefaultIopMap
string sprintf(string fmt,...)
const OP_IN
const DefaultCopMap
const VARCHAR
*string tablespace
the tablespace name of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:416
bool logging
Flag if is loggign mode used.
Definition: OracleSqlUtil.qm.dox.h:805
*string view_type_owner
Owner of the type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:648
represents an Oracle table
Definition: OracleSqlUtil.qm.dox.h:1251
*string tablespace
Name of the potential tablespace.
Definition: OracleSqlUtil.qm.dox.h:809
const COP_OVER
*string superview_name
Name of the superview.
Definition: OracleSqlUtil.qm.dox.h:652
bool enabled
True if the trigger is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:681
const COP_SEQ_CURRVAL
const True
const SZ_MAND
const CHAR
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:443
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:471
represents an Oracle procedure
Definition: OracleSqlUtil.qm.dox.h:761
number number(softnumber n)
hash uop_substr(int start, *int count, *hash nest)
const COP_YEAR_HOUR
binary binary()
const IOP_SEQ_CURRVAL
const False
*string tablespace
any tablespace for the unique key index
Definition: OracleSqlUtil.qm.dox.h:502
bool enabled
True if the constraint is enabled, False if not
Definition: OracleSqlUtil.qm.dox.h:499
represents an Oracle view
Definition: OracleSqlUtil.qm.dox.h:639
list list(...)
const Float
hash op_substr(int start, *int count, string text)
int index(softstring str, softstring substr, softint pos=0)
hash cop_cast(any column, string arg, *any arg1, *any arg2)
const Boolean
hash cop_substr(any column, int start, *int count)
const SZ_NUM
date microseconds(softint us)
const Binary
*string oid_text
WITH OID clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:646
bool exists(...)
bool use_index
Flag if is index used.
Definition: OracleSqlUtil.qm.dox.h:807
const COP_YEAR_MONTH
const BLOB
the Oracle specialization for SqlUtil::AbstractDatabase
Definition: OracleSqlUtil.qm.dox.h:832
string type(any arg)
int byte_size
byte size of the column
Definition: OracleSqlUtil.qm.dox.h:341
const CLOB
const NOTHING
bool same(list l)
represents an Oracle check constraint
Definition: OracleSqlUtil.qm.dox.h:466
represents an Oracle number column
Definition: OracleSqlUtil.qm.dox.h:397
represents an Oracle package
Definition: OracleSqlUtil.qm.dox.h:773
const Int
const COP_YEAR
string string(softstring str, *string enc)
represents an Oracle column
Definition: OracleSqlUtil.qm.dox.h:334
*string type_text
Type clause of the typed view.
Definition: OracleSqlUtil.qm.dox.h:644
OracleDatabase get_database(AbstractDatasource nds, *hash opts)
returns an OracleDatabase object corresponding to the arguments
const COP_CAST
hash join_inner(AbstractTable table, *string alias, *hash jcols, *hash cond, *hash opt)
*string body_src
package body source
Definition: OracleSqlUtil.qm.dox.h:778
const DefaultUopMap
hash cop_seq(string seq, *string as)
const COP_YEAR_DAY
string getBaseType()
returns the base type of the underlying object (either "table" or &quot;view&quot;)
*string tablespace
any tablespace for the primary key index
Definition: OracleSqlUtil.qm.dox.h:564
*string view_type
Type of the view if the view is a typed view.
Definition: OracleSqlUtil.qm.dox.h:650
const Object
represents an Oracle sequence
Definition: OracleSqlUtil.qm.dox.h:622
represents an Oracle trigger
Definition: OracleSqlUtil.qm.dox.h:676
OracleTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns an OracleTable object corresponding to the arguments
hash hash(object obj)
bool container_data
Indicates whether the view contains container-specific data.
Definition: OracleSqlUtil.qm.dox.h:654
const COP_SUBSTR
const OracleSchemaDescriptionOptions
oracle-specific schema description keys
Definition: OracleSqlUtil.qm.dox.h:856
const OP_SUBSTR
const SZ_OPT
const IOP_SEQ
represents an Oracle foreign constraint
Definition: OracleSqlUtil.qm.dox.h:438
hash cop_seq_currval(string seq, *string as)
represents an Oracle type
Definition: OracleSqlUtil.qm.dox.h:730
represents an Oracle primary key
Definition: OracleSqlUtil.qm.dox.h:559
string native_type
the native type of the index (if supported)
Definition: OracleSqlUtil.qm.dox.h:413
string join(string str,...)
const NUMERIC
const Number
represents an Oracle index
Definition: OracleSqlUtil.qm.dox.h:408
const DefaultOpMap
bool char_used
the column uses character semantics
Definition: OracleSqlUtil.qm.dox.h:339
represents an Oracle function
Definition: OracleSqlUtil.qm.dox.h:749
the base class for Oracle code objects
Definition: OracleSqlUtil.qm.dox.h:705