cogdmor.ini 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. ;***********************************************************************
  2. ;Licensed Materials - Property of IBM
  3. ;
  4. ;BI and PM: UDA
  5. ;
  6. ;(C) Copyright IBM Corp. 2005, 2020
  7. ;
  8. ;U.S. Government Users Restricted Rights - Use, duplication, or disclosure
  9. ;by GSA ADP Schedule Contract with IBM Corp.
  10. ;
  11. ;Unless specifically authorized by IBM, you may not modify any part of this
  12. ;file. Where modification is authorized, you must reproduce any copyright
  13. ;notices contained in this file and specifically identify which
  14. ;modifications have been made by your organization. YOU ARE SOLELY
  15. ;RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF ANY MODIFICATIONS TO
  16. ;THIS FILE AND ASSUME ALL RISKS ASSOCIATED WITH THE USE AND DISTRIBUTION
  17. ;OF THE MODIFIED FILE. IBM will not provide support relating to
  18. ;unauthorized changes you make to this file.
  19. ;***********************************************************************
  20. ; $Header: $
  21. ;
  22. ; Module:
  23. ; cogdmor.ini
  24. ;
  25. ; Purpose:
  26. ; This module contains information used by the Oracle gateway.
  27. ;
  28. ; Notes:
  29. ; Do NOT modify this file. Doing so could result in unknown behavior
  30. ; by the Oracle gateway, possibly resulting in application aborts.
  31. ;
  32. ; ************************************************************************
  33. ; To create a trace of OCI routines called, uncomment the following two lines
  34. ; and specify a vaild trace file name.
  35. ;[TRACE]
  36. ;Output=<my trace file>
  37. ;
  38. ; To enable printing the elapsed times for OCI function calls, uncomment the following line:
  39. ;Timer=yes
  40. [Expression Results]
  41. [Exceptions Commands]
  42. Call="call "
  43. Max_Literal_Len="4000"
  44. [Exceptions Clauses]
  45. With="with "
  46. [Exceptions Tables]
  47. Joined=T
  48. Derived=T
  49. UniqueName_Prefix="coguda"
  50. ; Maximum length of aliases.
  51. SQL_MAX_TABLE_NAME_LEN="128"
  52. [Exceptions Tables ORACLE12.1.0]
  53. SQL_MAX_TABLE_NAME_LEN="30"
  54. [Exceptions Tables ORACLE11.2.0]
  55. SQL_MAX_TABLE_NAME_LEN="30"
  56. [Exceptions Tables ORACLE10.2.0]
  57. SQL_MAX_TABLE_NAME_LEN="30"
  58. [Exceptions Tables ORACLE10.1.0]
  59. SQL_MAX_TABLE_NAME_LEN="30"
  60. [Exceptions Joins]
  61. Inner=T
  62. Left_Outer=T
  63. Right_Outer=T
  64. Full_Outer=T
  65. Cross=T
  66. Nested_Inner=T
  67. Nested_Outer=T
  68. Left_Nested=T
  69. Right_Nested=T
  70. Inner_Tbl_Restrict=F
  71. Optnl_Tbl_Restrict=T
  72. Non_Equi_Joins=T
  73. Optnl_Tbl_Join_Filter=T
  74. Optnl_Tbl_Filter=T
  75. Two_Sided_Join_Restrict=F
  76. Optnl_Tbl_Join_Restrict=F
  77. On_Condition_Between_Predicate=T
  78. On_Condition_Like_Predicate=T
  79. On_Condition_Not_Predicate=T
  80. On_Condition_IsNull_Predicate=T
  81. On_Condition_In_Predicate=T
  82. On_Condition_Set_Functions=F
  83. On_Condition_Subqueries=T
  84. On_Condition_Functions=T
  85. On_Condition_Or_Predicate=T
  86. Prsrv_Tbl_Join_Filter=T
  87. Full_Syntax=" FULL OUTER JOIN "
  88. Inner_Syntax=" INNER JOIN "
  89. Left_Eql=" LEFT OUTER JOIN "
  90. Right_Eql=" RIGHT OUTER JOIN "
  91. [Exceptions Joins ORACLE10.1.0]
  92. Full_Outer=F
  93. [Exceptions Predicates]
  94. All="all "
  95. Exists="exists "
  96. [Exceptions Aggregates]
  97. Max="max"
  98. Min="min"
  99. Sum="sum"
  100. Avg="avg"
  101. Count="count"
  102. Count_Star="count(*)"
  103. Stddev="stddev"
  104. Variance="variance"
  105. Stddev_Pop="stddev_pop"
  106. Var_Pop="var_pop"
  107. Stddev_Samp="stddev_samp"
  108. Var_Samp="var_samp"
  109. Rank="rank"
  110. Dense_Rank="dense_rank"
  111. Percent_Rank="percent_rank"
  112. Cume_Dist="cume_dist"
  113. Grouping="grouping"
  114. [Exceptions OLAP Functions]
  115. Olap_Max="max"
  116. Olap_Min="min"
  117. Olap_Sum="sum"
  118. Olap_Avg="avg"
  119. Olap_Count="count"
  120. Olap_Count_Star="count(*)"
  121. Olap_Stddev_Pop="stddev_pop"
  122. Olap_Var_Pop="var_pop"
  123. Olap_Stddev_Samp="stddev_samp"
  124. Olap_Var_Samp="var_samp"
  125. Olap_Rank="rank"
  126. Olap_Dense_Rank="dense_rank"
  127. Olap_Percent_Rank="percent_rank"
  128. Olap_Cume_Dist="cume_dist"
  129. Olap_Row_Number="row_number"
  130. Olap_Ratio_To_Report="ratio_to_report"
  131. Olap_Ntile="ntile"
  132. Olap_First_Value="first_value"
  133. Olap_Last_Value="last_value"
  134. Olap_Percentile_Cont="percentile_cont"
  135. Olap_Percentile_Disc="percentile_disc"
  136. ;Trakker 577783
  137. Olap_Last_Value_Default="ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING"
  138. [Exceptions Set Operators]
  139. Distinct="distinct"
  140. Union="union"
  141. Intersect="intersect"
  142. Except=" minus "
  143. Union_All=T
  144. [Exceptions Operators]
  145. Neq=" <> "
  146. [Exceptions Blob Expressions]
  147. ;Even though Oracle allows some expression on blobs, but
  148. ;LONG type is different story, and since UDA does not
  149. ;distinguish LONG from CLOB, so there might be some problem here
  150. Blob_In_Substring=T
  151. Blob_In_StrCat=T
  152. Blob_In_Trim=T
  153. Blob_In_Substring_Return_Blob=T
  154. [Exceptions Value Expressions]
  155. Extract=C
  156. Extract_Year=coguda#extract_year
  157. Extract_Month=coguda#extract_month
  158. Extract_Day=coguda#extract_day
  159. Extract_Hours=coguda#extract_hour
  160. Extract_Minutes=coguda#extract_minute
  161. Extract_Seconds=coguda#extract_second
  162. Position=C
  163. Char_Length=C
  164. Substring=C
  165. Upper=T
  166. Lower=T
  167. StrCat=T
  168. Case=T
  169. Coalesce=T
  170. Nullif=T
  171. Cast=C
  172. Trim=T
  173. Cube=T
  174. Rollup=T
  175. Grouping_Sets=T
  176. Bit_Length=C
  177. Octet_Length=C
  178. Current_Date=C
  179. Current_Time=F
  180. Current_Timestamp=T
  181. Abs=T
  182. Mod=T
  183. Ln=T
  184. Exp=T
  185. Power=T
  186. Sqrt=T
  187. Floor=T
  188. Ceiling=C
  189. Localtime=F
  190. Localtimestamp=T
  191. Row_Value_Constructors=T
  192. ; SGI will only support TIMESTAMP literal, other entries are written for future reference.
  193. ; Although format string for Date and Time are provided but they are not used as
  194. ; we only set Timestamp_Literal=C, if user wants to pass DATE/TIME expressions
  195. ; then set Date_Literal=C, Time_Literal=C and TimeTZ_Literal=C.
  196. [Exceptions Literals]
  197. Date_Literal=T
  198. Time_Literal=F
  199. TimeTZ_Literal=F
  200. Interval_Literal=T
  201. Interval_Format_Str="DDDDDDDDD HH MM SS FFFFFFFFF"
  202. IntervalYM_Literal=T
  203. IntervalYM_Format_Str="YYYYYYYYY MM"
  204. Interval_Explicit_Precision=T
  205. Timestamp_Literal=T
  206. TimestampTZ_Literal=T
  207. Date_Format_Str="YYYY MM DD"
  208. Time_Format_Str="HH MM SS FFFFFFFFF"
  209. TimeTZ_Format_Str="HH MM SS FFFFFFFFF HHMM"
  210. Timestamp_Format_Str="YYYY MM DD HH MM SS FFFFFFFFF"
  211. TimestampTZ_Format_Str="YYYY MM DD HH MM SS FFFFFFFFF HHMM"
  212. Date_Literal_Str="to_date('%s-%s-%s', 'YYYY-MM-DD')"
  213. Time_Literal_Str="to_timestamp('%s:%s:%s.%s', 'HH24:MI:SS.FF9')"
  214. TimeTZ_Literal_Str="to_timestamp_tz('%s:%s:%s.%s %s:%s', 'HH24:MI:SS.FF9 TZH:TZM' )"
  215. Timestamp_Literal_Str="to_timestamp('%s-%s-%s %s:%s:%s.%s', 'YYYY-MM-DD HH24:MI:SS.FF9')"
  216. TimestampTZ_Literal_Str="to_timestamp_tz('%s-%s-%s %s:%s:%s.%s %s:%s', 'YYYY-MM-DD HH24:MI:SS.FF9 TZH:TZM' )"
  217. Date_Sub_Function_Str="to_timestamp(to_char(?1,'YYYY-MM-DD HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS') - to_timestamp(to_char(?2,'YYYY-MM-DD HH24:MI:SS'), 'YYYY-MM-DD HH24:MI:SS')"
  218. DateRange_Start_Str="to_date('%s-%s-%s 00:00:00', 'YYYY-MM-DD HH24:MI:SS')"
  219. DateRange_End_Str="( to_date('%s-%s-%s 00:00:00', 'YYYY-MM-DD HH24:MI:SS') + INTERVAL '1' DAY )"
  220. NChar_Literal=T
  221. Boolean_Literal=F
  222. True_Literal_Str=
  223. False_Literal_Str=
  224. Unknown_Literal_Str=
  225. ;Exception Literal section for Oracle 8 and Oracle 8.1 allows
  226. ;to generate Date Literals in the format that satisfies Oracle partitioning
  227. ;requirements; These entries should be uncommented only if the user requires
  228. ;to take advantage of table partitioning;
  229. [Exceptions General]
  230. Group_By_Expr=T
  231. Multiple_Distinct=T
  232. Count_Non_Distinct=T
  233. Count_Value_Expr=T
  234. Count_Literal=T
  235. Is_Null_Value_Expr=T
  236. Is_Null_Value_Parm=T
  237. Like_Value_Expr=T
  238. Subquery_In_Having=T
  239. Subquery_In_Group_By=F
  240. Count_Blob=F
  241. Case_To_Decode=F
  242. Expression_In_In=T
  243. Null_Order=T
  244. Integer_Division_Truncation=F
  245. Use_Dbkey_For_Blob=T
  246. Olap_Null_Order=T
  247. Empty_String_Is_Null=T
  248. Order_By_In_Derived_Table=T
  249. Interval_As_VarChar=T
  250. Boolean_Comparison=F
  251. Derived_Column_List=F
  252. With_Column_List=F
  253. Aggr_With_Interval=F
  254. ;When setting to "PT", the native SQL in common table expression of a With clause
  255. ;is considered as a pass-through SQL only which is pushed to database.
  256. ;When setting to "DT", the native SQL is re-written as a derived table (10.1 and prior behaviour)
  257. ;Native_SQL_In_CTE="KEEP"
  258. [Exceptions Delimiters]
  259. Catalog_Delimiter="\""
  260. Schema_Delimiter="\""
  261. Table_Delimiter="\""
  262. Column_Delimiter="\""
  263. Procedure_Delimiter="\""
  264. Wholename_Delimiter=
  265. Table_Function_PreStr="TABLE( "
  266. Table_Function_PostStr=" )"
  267. Comment_Begin="/* "
  268. Comment_End=" */ "
  269. [Exceptions Separators]
  270. Catalog_Separator="."
  271. Schema_Separator="."
  272. Table_Separator="."
  273. [Exceptions Misc]
  274. Session_Sort_Order=T
  275. ;Oracle applies implicit conversion function on DATE column
  276. ;when comparison with TIMESTAMP, and causes no index scan on DATE column
  277. ;Convert TIMESTAMP literal without time value to DATE literal to
  278. ;avoid Oracle performance issue.
  279. Convert_Timestamp_Literal_To_Date=F
  280. [Builtin Functions]
  281. ;Each of the parameter is identified by "%" followed by the number , followed by the type . The types can be the following:
  282. ;"b" stands for boolean.
  283. ;"c" stands for character.
  284. ;"x" stands for text.
  285. ;"d" stands for date.
  286. ;"i" stands for the interval.
  287. ;"n" stands for the numeric.
  288. ;"s" stands for the timestamp.
  289. ;"t" stands for the time.
  290. ;"y" stands for time with time zone
  291. ;"z" stands for timestamp with time zone
  292. n:char_length(%1cx)=LENGTH(%1);
  293. n:character_length(%1cx)=LENGTH(%1);
  294. bcdints:coalesce(%1bcdintsz,%2bcdintsz)=NVL(%1,%2);
  295. bcdints:nullif(%1bcdintsz,%2bcdintsz)=decode(%1,%2,NULL,%1);
  296. n:octet_length(%1cx)=LENGTHB(%1);
  297. n:bit_length(%1cx)=LENGTHB(%1) * 8;
  298. n:position(%1cx,%2cx)=INSTR(%2,%1);
  299. c:substring(%1c,%2n {,%3n})=SUBSTR(%1,%2 {,%3});
  300. x:substring(%1x,%2n {,%3n})=SUBSTR(%1,%2 {,%3});
  301. n:ceiling(%1n)=CEIL(%1);
  302. n:absolute(%1n)=ABS(%1);
  303. c:downshift(%1c)=LOWER(%1);
  304. n:floor(%1n)=FLOOR(%1);
  305. n:index(%1c,%2c)=INSTR(%1,%2);
  306. ds:lastday(%1dsz)=LAST_DAY(%1);
  307. c:leftjustify(%1c)=LTRIM(%1);
  308. n:nconvert(%1c)=TO_NUMBER(%1);
  309. n:size(%1c)=LENGTH(%1);
  310. c:truncate(%1c)=RTRIM(%1);
  311. c:upshift(%1c)=UPPER(%1);
  312. n:power(%1n,%2n)=POWER(%1,%2);
  313. n:monthsbetween(%1dsz,%2dsz)=TRUNC(MONTHS_BETWEEN(%2,%1));
  314. n:ascii(%1c)=ascii(%1);
  315. n:round(%1n,%2n)=round(%1,%2);
  316. c:cast_varchar(%1n)=TO_CHAR(%1);
  317. c:cast_varchar(%1d)=TO_CHAR(%1, 'YYYY-MM-DD');
  318. c:cast_varchar(%1s)=TO_CHAR( TO_TIMESTAMP(%1), 'YYYY-MM-DD HH24:MI:SS.FF9');
  319. c:cast_varchar(%1z)=TO_CHAR((%1), 'YYYY-MM-DD HH24:MI:SS.FF9 TZR' );
  320. ;
  321. ; Functions required for the EXTRACT function
  322. ;
  323. n:coguda#extract_hour(%1dstz)=EXTRACT( HOUR FROM CAST((%1) AS TIMESTAMP(2)) );
  324. n:coguda#extract_hour(%1i)=EXTRACT( HOUR FROM (%1) );
  325. n:coguda#extract_minute(%1dstz)=EXTRACT( MINUTE FROM CAST((%1) AS TIMESTAMP(2)) );
  326. n:coguda#extract_minute(%1i)=EXTRACT( MINUTE FROM (%1) );
  327. n:coguda#extract_second(%1dst)=EXTRACT( SECOND FROM CAST((%1) AS TIMESTAMP) );
  328. n:coguda#extract_second(%1iz)=EXTRACT( SECOND FROM (%1) );
  329. n:coguda#extract_year(%1dsiz)=EXTRACT( YEAR FROM (%1) );
  330. n:coguda#extract_month(%1dsiz)=EXTRACT( MONTH FROM (%1) );
  331. n:coguda#extract_day(%1dsiz)=EXTRACT( DAY FROM (%1) );
  332. ;
  333. ; Function mappings for CAST function
  334. ;
  335. c:coguda#cast_char(%1nx,%2n)=CAST( %1 AS CHAR( %2 ) );
  336. c:coguda#cast_char(%1c,%2n)=CAST( %1 AS CHAR( %2 CHAR ) );
  337. c:coguda#cast_char(%1d,%2n)=CAST( TO_CHAR(%1, 'YYYY-MM-DD') AS CHAR( %2 ) );
  338. c:coguda#cast_char(%1s,%2n)=CAST( TO_CHAR( cast(%1 as TIMESTAMP(9)), 'YYYY-MM-DD HH24:MI:SS.FF9') AS CHAR( %2 ) );
  339. c:coguda#cast_char(%1z,%2n)=CAST( TO_CHAR( %1, 'YYYY-MM-DD HH24:MI:SS.FF9TZR') AS CHAR( %2 ) );
  340. c:coguda#cast_varchar(%1nx,%2n)=CAST( %1 AS VARCHAR( %2 ) );
  341. c:coguda#cast_varchar(%1c,%2n)=CAST( %1 AS VARCHAR( %2 CHAR ) );
  342. c:coguda#cast_varchar(%1d,%2n)=CAST( TO_CHAR(%1, 'YYYY-MM-DD') AS VARCHAR( %2 ) );
  343. c:coguda#cast_varchar(%1s,%2n)=CAST( TO_CHAR(cast(%1 as TIMESTAMP(9)), 'YYYY-MM-DD HH24:MI:SS.FF9') AS VARCHAR( %2 ) );
  344. c:coguda#cast_varchar(%1z,%2n)=CAST( TO_CHAR((%1), 'YYYY-MM-DD HH24:MI:SS.FF9TZR' ) AS VARCHAR( %2 ) );
  345. c:coguda#cast_nchar(%1ncx,%2n)=CAST( %1 AS NCHAR( %2 ) );
  346. c:coguda#cast_nchar(%1d,%2n)=CAST( TO_CHAR(%1, 'YYYY-MM-DD') AS NCHAR( %2 ) );
  347. c:coguda#cast_nchar(%1s,%2n)=CAST( TO_CHAR( cast(%1 as TIMESTAMP(9)), 'YYYY-MM-DD HH24:MI:SS.FF9') AS NCHAR( %2 ) );
  348. c:coguda#cast_nchar(%1z,%2n)=CAST( TO_CHAR( %1, 'YYYY-MM-DD HH24:MI:SS.FF9TZR') AS NCHAR( %2 ) );
  349. c:coguda#cast_nvarchar(%1ncx,%2n)=CAST( %1 AS NCHAR VARYING( %2 ) );
  350. c:coguda#cast_nvarchar(%1d,%2n)=CAST( TO_CHAR(%1, 'YYYY-MM-DD') AS NCHAR VARYING( %2 ) );
  351. c:coguda#cast_nvarchar(%1s,%2n)=CAST( TO_CHAR( cast(%1 as TIMESTAMP(9)), 'YYYY-MM-DD HH24:MI:SS.FF9') AS NCHAR VARYING( %2 ) );
  352. c:coguda#cast_nvarchar(%1z,%2n)=CAST( TO_CHAR((%1), 'YYYY-MM-DD HH24:MI:SS.FF9TZR' ) AS NCHAR VARYING( %2 ) );
  353. n:coguda#cast_double_precision(%1)=CAST( %1 AS DOUBLE PRECISION );
  354. d:coguda#cast_date(%1ds)=TRUNC(cast(%1 as TIMESTAMP(9)));
  355. d:coguda#cast_date(%1c)=TO_DATE( %1, 'YYYY-MM-DD' );
  356. ;
  357. ; an EE style cast( number as date). The number is YYYYMMDD. Trakker #536672 & 545831
  358. d:coguda#cast_date(%1n)=CASE %1 WHEN 0 THEN TO_DATE( '00010101','YYYYMMDD') ELSE TO_DATE( TO_CHAR( %1 ), 'YYYYMMDD') END;
  359. t:coguda#cast_timestampTZ(%1)=CAST( ( %1 ) AS TIMESTAMP WITH TIME ZONE );
  360. s:coguda#cast_timestamp(%1c)=TO_TIMESTAMP(%1,'YYYY-MM-DD HH24:MI:SS.FF9');
  361. s:coguda#cast_timestamp(%1dsz)=CAST( ( %1 ) AS TIMESTAMP );
  362. ; Business Functions for Date Calculations
  363. ;
  364. s:_add_days(%1s,%2n)=(%1 + (INTERVAL '1' DAY * (%2)));
  365. d:_add_days(%1d,%2n)=(%1 + (INTERVAL '1' DAY * (%2)));
  366. z:_add_days(%1z,%2n)=(%1 + (INTERVAL '1' DAY * (%2)));
  367. s:_add_months(%1s,%2n)=CASE WHEN EXTRACT( DAY FROM %1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY + NUMTOYMINTERVAL( %2, 'MONTH' ) + INTERVAL '1' MONTH - INTERVAL '1' DAY ) < EXTRACT( DAY FROM %1 ) THEN %1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY + NUMTOYMINTERVAL( %2, 'MONTH' ) + INTERVAL '1' MONTH - INTERVAL '1' DAY ELSE %1 + NUMTOYMINTERVAL( %2, 'MONTH' ) END;
  368. d:_add_months(%1d,%2n)=CASE WHEN EXTRACT( DAY FROM %1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY + NUMTOYMINTERVAL( %2, 'MONTH' ) + INTERVAL '1' MONTH - INTERVAL '1' DAY ) < EXTRACT( DAY FROM %1 ) THEN %1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY + NUMTOYMINTERVAL( %2, 'MONTH' ) + INTERVAL '1' MONTH - INTERVAL '1' DAY ELSE %1 + NUMTOYMINTERVAL( %2, 'MONTH' ) END;
  369. z:_add_months(%1z,%2n)=CASE WHEN EXTRACT( DAY FROM %1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY + NUMTOYMINTERVAL( %2, 'MONTH' ) + INTERVAL '1' MONTH - INTERVAL '1' DAY ) < EXTRACT( DAY FROM %1 ) THEN %1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY + NUMTOYMINTERVAL( %2, 'MONTH' ) + INTERVAL '1' MONTH - INTERVAL '1' DAY ELSE %1 + NUMTOYMINTERVAL( %2, 'MONTH' ) END;
  370. s:_add_years(%1s,%2n)=CASE WHEN TO_CHAR(%1,'MMDD') = '0229' AND MOD(%2,4) <> 0 THEN (%1 + INTERVAL '1' DAY) + NUMTOYMINTERVAL(%2,'YEAR') - INTERVAL '1' DAY ELSE %1 + NUMTOYMINTERVAL(%2,'YEAR') END;
  371. d:_add_years(%1d,%2n)=CASE WHEN TO_CHAR(%1,'MMDD') = '0229' AND MOD(%2,4) <> 0 THEN (%1 + INTERVAL '1' DAY) + NUMTOYMINTERVAL(%2,'YEAR') - INTERVAL '1' DAY ELSE %1 + NUMTOYMINTERVAL(%2,'YEAR') END;
  372. z:_add_years(%1z,%2n)=CASE WHEN TO_CHAR(%1,'MMDD') = '0229' AND MOD(%2,4) <> 0 THEN (%1 + INTERVAL '1' DAY) + NUMTOYMINTERVAL(%2,'YEAR') - INTERVAL '1' DAY ELSE %1 + NUMTOYMINTERVAL(%2,'YEAR') END;
  373. n:_days_between(%1dsz,%2dsz)=(TRUNC( CAST( %1 AS TIMESTAMP ) ) - TRUNC( CAST( %2 AS TIMESTAMP ) ));
  374. n:_months_between(%1dsz,%2dsz)=TRUNC( MONTHS_BETWEEN( %1, %2 ), 0 );
  375. n:_years_between(%1dsz,%2dsz)=TRUNC( ( MONTHS_BETWEEN( %1, %2) / 12 ), 0 );
  376. n:_days_to_end_of_month(%1dsz)=(EXTRACT( DAY FROM LAST_DAY(%1) ) - EXTRACT( DAY FROM %1 ));
  377. n:_age(%1dsz)=;
  378. s:_first_of_month(%1s)=(%1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY);
  379. d:_first_of_month(%1d)=(%1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY);
  380. z:_first_of_month(%1z)=(%1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY);
  381. d:_last_of_month(%1d)=(%1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY + INTERVAL '1' MONTH - INTERVAL '1' DAY);
  382. s:_last_of_month(%1s)=(%1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY + INTERVAL '1' MONTH - INTERVAL '1' DAY);
  383. z:_last_of_month(%1z)=(%1 - NUMTODSINTERVAL( EXTRACT( DAY FROM %1 ), 'DAY' ) + INTERVAL '1' DAY + INTERVAL '1' MONTH - INTERVAL '1' DAY);
  384. s:_make_timestamp(%1n,%2n,%3n)=TO_TIMESTAMP( ( LPAD( %1, 4, '0' ) || '-' || LPAD( %2, 2, '0' ) || '-' || LPAD( %3, 2, '0' ) ), 'YYYY-MM-DD' );
  385. n:_ymdint_between(%1dsz,%2dsz)=;
  386. n:_day_of_year(%1dsz)=TO_NUMBER( TO_CHAR( %1, 'DDD' ) );
  387. n:_week_of_year(%1dsz)=TO_NUMBER( TO_CHAR( %1, 'IW' ) );
  388. n:_day_of_week(%1dsz, %2n)=(MOD( MOD( TO_NUMBER( TO_CHAR( %1, 'D' ) ) - TO_NUMBER( TO_CHAR( TO_DATE( '2003-01-06', 'YYYY-MM-DD' ), 'D' ) ) + 7, 7 ) + 1 - %2 + 7, 7 ) + 1);
  389. ;
  390. ; Additional Business Functions for Date Calculations
  391. ;
  392. s:_add_hours(%1s,%2n)=(%1 + (INTERVAL '1' HOUR * (%2)));
  393. t:_add_hours(%1t,%2n)=(%1 + (INTERVAL '1' HOUR * (%2)));
  394. s:_add_minutes(%1s,%2n)=(%1 + (INTERVAL '1' MINUTE * (%2)));
  395. t:_add_minutes(%1t,%2n)=(%1 + (INTERVAL '1' MINUTE * (%2)));
  396. s:_add_seconds(%1s,%2n)=(%1 + (INTERVAL '1' SECOND * (%2)));
  397. t:_add_seconds(%1t,%2n)=(%1 + (INTERVAL '1' SECOND * (%2)));
  398. n:_hours_between(%1ds,%2ds)=;
  399. n:_minutes_between(%1ds,%2ds)=;
  400. n:_seconds_between(%1ds,%2ds)=;
  401. [Builtin Functions ORACLE10.2.0]
  402. ;
  403. ; There are a number of oracle bugs w.r.t TRUNC, OLAP sum and sorts (ORA-0600).
  404. ; 4655998, 4736198, 5202144
  405. ; Rewriting cast_date in this form avoids these errors.
  406. ; The other alternative is to disable OLAP_SUM which would be very computationally expensive.
  407. ;
  408. ; this goal of this expression is to 'zero out' the time portion of the
  409. ; Oracle DATE object using TRUNC( X, 'DD' ) however we must ensure that
  410. ; Oracle uses TRUNC ( date, char) instead of TRUNC( numeric, char) when
  411. ; working with parameters. Hence the innermost cast to DATE
  412. ;
  413. d:coguda#cast_date(%1ds)=cast( TRUNC( CAST( %1 as DATE), 'DD' ) AS DATE );
  414. [Database Functions]
  415. c:translate(%1c,%2c,%3c)=TRANSLATE(%1,%2,%3);
  416. n:_round(%1n, %2n)=round(%1, %2);
  417. d:current_date()=TRUNC( CURRENT_DATE );
  418. ds:adddays(%1dsz,%2n)=((%1) + (%2));
  419. n:datedaydiff(%1dsz,%2dsz)=((%2) - (%1));
  420. n:or_ascii(%1c)=ASCII(%1);
  421. n:or_avg(%1c,%2n)=AVG(%1 %2);
  422. bcdints:or_count(%1c,%2bcdintsz)=COUNT(%1 %2);
  423. bcdints:or_max(%1c,%2bcdintsz)=MAX(%1 %2);
  424. bcdints:or_min(%1c,%2bcdintsz)=MIN(%1 %2);
  425. dns:or_round(%1dns {,%2cn})=ROUND(%1 {,%2});
  426. c:or_soundex(%1c)=SOUNDEX(%1);
  427. n:or_sum(%1c,%2n)=SUM(%1 %2);
  428. c:or_user()=USER;
  429. ds:sysdate()=SYSDATE;
  430. n:uid()=UID;
  431. c:userenv(%1c {,%2c})=SUBSTR(USERENV(%1),1);
  432. n:rownum()=ROWNUM;
  433. [Directives Session]
  434. Ordered_Pos=Block_Comment
  435. Ordered_Text="ORDERED"
  436. Star_Pos=Block_Comment
  437. Star_Text="STAR"
  438. Block_Comment_Pre_Text="/*+"
  439. Block_Comment_Post_Text="*/"
  440. Append_Pre_Text=""
  441. Append_Post_Text=""
  442. ; First Row optimization has been disabled due to performance issues. (Trakker 493725)
  443. ; To enable first row optimization, set the First_Row_Text entry to "FIRST_ROWS".
  444. ; Please note that first row optimization would cause the Oracle error "ORA-00600: internal
  445. ; error code, arguments: [12410], [], [], [], [], [], [], []" when running against an
  446. ; Oracle 10g server. (Trakker 448744) This issue was resolved in Oracle 10.1.0.4.0.
  447. First_Row_Text=
  448. First_Row_Pos=Block_Comment
  449. ; Row Limit in Oracle is achieved by using
  450. ; the pseudo-rownum which is assigned in run time
  451. ; by Oracle db engine during fetch time, thus by
  452. ; limiting the rownum we limit the total row count
  453. ; for the fetch.
  454. ; The ROWNUM is added to the WHERE clause of an outer select
  455. Query_Row_Limit_Pos=Outer_Select_Predicate
  456. Query_Row_Limit_Text="ROWNUM <= %d"
  457. ;Oracle does not allow to execute a few sql statements at the same time!!!
  458. ;All statements have to be separated by a semicolon.
  459. [UDA USER OPTIONS]
  460. ;Attach=ALTER SESSION SET NLS_LANGUAGE=FRENCH;ALTER SESSION SET NLS_TERRITORY=FRANCE NLS_SORT=BINARY
  461. ;
  462. ;Trakker 586412:[TLC3] Unable to reopen a certain filtered QS Reports with a specific relational source
  463. ;The problem is caused by Oracle bug 6051782, which is fixed in 10.2.0.4 and 11.1.0.7.
  464. ;Workarounds provided by Oracle to either remove DISTINCT, ORDER BY or
  465. ;ALTER SESSION SET "_COMPLEX_VIEW_MERGING" = FALSE, which can be set at the
  466. ;connection command block in the content store as follow:
  467. ;<commandBlock>
  468. ;<commands>
  469. ;<sqlCommand>
  470. ;<sql>ALTER SESSION SET "_COMPLEX_VIEW_MERGING" = FALSE</sql>
  471. ;</sqlCommand>
  472. ;</commands>
  473. ;</commandBlock>
  474. ;
  475. ;The setting of ALTER SESSSION via command blocks is the preferred method.
  476. ;User can also set the alter session by uncomment the following line but beaware that
  477. ;all ORACLE connections get this setting:
  478. ;Attach=ALTER SESSION SET "_COMPLEX_VIEW_MERGING" = FALSE
  479. [I18N Encoding]
  480. UTF8=utf-8
  481. AL32UTF8=utf-8
  482. AL16UTF16=utf-16
  483. US7ASCII=US-ASCII
  484. WE8ISO8859P1=iso-8859-1
  485. BLT8ISO8859P1=iso-8859-1
  486. CEL8ISO8859P1=iso-8859-1
  487. EE8ISO8859P2=iso-8859-2
  488. E8ISO8859P3=iso-8859-3
  489. NEE8ISO8859P4=iso-8859-4
  490. CL8ISO8859P5=iso-8859-5
  491. AR8ISO8859P6=iso-8859-6
  492. AR8ISO8859P6=iso-8859-6
  493. EL8ISO8859P7=iso-8859-7
  494. IW8ISO8859P8=iso-8859-8
  495. WE8ISO8859P9=iso-8859-9
  496. NE8ISO8859P10=iso-8859-10
  497. WE8ISO8859P15=iso-8859-15
  498. EE8MSWIN1250=cp1250
  499. CL8MSWIN1251=cp1251
  500. WE8MSWIN1252=cp1252
  501. EL8MSWIN1253=cp1253
  502. TR8MSWIN1254=cp1254
  503. IW8MSWIN1255=cp1255
  504. AR8MSWIN1256=cp1256
  505. BLT8MSWIN1257=cp1257
  506. VN8MSWIN1258=cp1258
  507. ;Simplified Chinese
  508. ZHS16CGB231280=ibm-eucCN
  509. ZHS16CGB231280FIXED=ibm-eucCN
  510. ZHS16GBK=cp936
  511. ;Traditional Chinese
  512. ZHT16BIG5=cp950
  513. ZHT16MSWIN950=cp950
  514. ZHS32GB18030=gb18030
  515. ;Korean
  516. KO16KSC5601=5601
  517. KO16MSWIN949=cp949
  518. ;Japanese Shift JIS
  519. JA16SJIS=sjis
  520. ;Japanese EUC JIS
  521. JA16EUC=eucjis
  522. ;Thai
  523. TH8TISASCII=cp874
  524. TH8TISEBCDICS=cp9030
  525. TH8TISEBCDIC=cp9030
  526. [Misc]
  527. ; Specifies which conversion algorithm to use
  528. Numeric_binding=C
  529. ;
  530. ; The Transparent Gateways for DB/2, SQL/400 and DRDA have, depending
  531. ; upon the version of the gateway, exhibited a problem with distinct
  532. ; clauses and aggregates. The backend databases have restrictions for
  533. ; which the gateways should account, but sometimes do not. Setting
  534. ; the 'Distinct Restriction' entry to zero indicates that this problem
  535. ; has been corrected.
  536. ;
  537. Distinct Restriction=1
  538. ;
  539. ;
  540. ; The entry 'Fetch Number of Rows' is used to determine how many rows to fetch
  541. ; per fetch operation. Increasing this number can provide better performance
  542. ; on some systems. Note that the OCI currently limits this number to 32767.
  543. ; Also note that numbers larger than 100 may actually degrade performance on
  544. ; some systems.
  545. ;
  546. ; The entry 'Fetch Buffer Size' is used to determine the size of buffer to
  547. ; use when fetching. Larger values can provide better performance on
  548. ; some systems. Note that on 16bit Windows platforms, this is restricted
  549. ; to approximately 64k.
  550. ;
  551. ; If both 'Fetch Buffer Size' and 'Fetch Number of Rows' are set, the latter
  552. ; will take precedence and the former will be ignored.
  553. ;
  554. ; By default, the buffer size used is 2048 bytes, to change this default,
  555. ; uncomment one of the following entries and set it accordingly.
  556. ;
  557. ;Fetch Buffer Size=2048
  558. ;Fetch Number of Rows=10
  559. ; The entry 'Not Support Scaled Integer' is used to change the Oracle scaled
  560. ; integer type from interger types to sqlDecimal type. The default of this entry
  561. ; is 0 for 'Not Support Scaled Integer' is FALSE. Set the value to 1, users will
  562. ; get sqlDecimal for all the non-zero scaled integers.
  563. ;
  564. Not Support Scaled Integer=0
  565. ; This flag allows the user to alter the session details as required.
  566. ; Please make sure that the user enters the valid parameters ( specific
  567. ; to Oracle ) to be altered. Please do not put double qoutes around
  568. ; each parameter , however, user can put single quotes around some
  569. ; of the parameters like :- NLS_DATE_FORMAT='YYYY-DD-MM' . Check
  570. ; Oracle SQL reference manual for details for uasge.
  571. ;
  572. ; ALTER_SESSION_PARAMETERS=NLS_LANGUAGE=FRENCH NLS_TERRITORY=FRANCE NLS_SORT=BINARY
  573. ; Default processing mode
  574. ;
  575. Processing Mode=Database Only
  576. ;
  577. [UDA Misc]
  578. ; Set this entry to one of the following values to force the type of
  579. ; transformation performed on queries containing aggregates computed
  580. ; at different levels of granularity. A value other than 0 will cause
  581. ; a query to generated that is more materialized view friendly.
  582. ;
  583. ; 0 = default
  584. ; 1 = derived tables
  585. ; 2 = union
  586. ;
  587. Multigrain_Query_XForm_Strategy=0
  588. ;
  589. ; Operations supported and results of the supported operation.
  590. ; The format is;
  591. ; [Operator <operator name>]
  592. ; <LHS>=<RHS>,<RES>{:<RHS>,<RES>}
  593. ;
  594. ; where
  595. ;
  596. ; LHS = data type of left hand side of operation
  597. ; RHS = data type of right hand side of operation
  598. ; RES = result data type of operation
  599. ;
  600. ; LHS, RHS and RES values may be one of:
  601. ;
  602. ; Name Abbreviation DMS Data Type
  603. ; CHAR CH sqlChar
  604. ; VARCHAR VC sqlVarChar
  605. ; LVARCHAR LC sqlLongVarChar
  606. ; NCHAR NC sqlNChar
  607. ; NVARCHAR NV sqlNVarChar
  608. ; BINARY BN sqlBinary
  609. ; VARBINARY VB sqlVarBinary
  610. ; BOOLEAN BO sqlBoolean
  611. ; SMALLINT SM sqlSmallInt
  612. ; INTEGER IT sqlInteger
  613. ; QUAD QD sqlQuad
  614. ; DECIMAL DM sqlDecimal
  615. ; NUMERIC NU sqlNumeric
  616. ; FLOAT FL sqlFloat
  617. ; DOUBLE DB sqlDouble
  618. ; DATE DT sqlDate
  619. ; TIME TM sqlTime
  620. ; TIMESTAMP TS sqlDateTime
  621. ; INTERVAL IV sqlInterval
  622. ; TIME_TZ TT sqlTimeTZ
  623. ; TIMESTAMP_TZ TZ sqlTimestampTZ
  624. ; INTERVAL_YM IY sqlIntervalYM
  625. ; TEXT TX sqlText
  626. ; BLOB BL sqlBlob
  627. ; ALL DATATYPES AD -------------
  628. ; ---- NA sqlUnknownType
  629. ;
  630. ;The following entries are needed for Date/Time/DateTime/Interval data type
  631. ;arithmetic operations. Unless set here, any arithmetic operations on those
  632. ;data types will return UDA-SQL-0492 Date/Time aritmetic is not supported. error
  633. ;Oracle supports arthmetic ADD/SUBTRACT on DateTime datatype
  634. [Operator Addition]
  635. Date=SM,DT:IT,DT:DM,DT:NU,DT:FL,DT:DB,DT
  636. Timestamp=SM,TS:IT,TS:DM,TS:NU,TS:FL,TS:DB,TS
  637. [Operator Subtraction]
  638. Date=SM,DT:IT,DT:DM,DT:NU,DT:FL,DT:DB,DT
  639. Timestamp=SM,TS:IT,TS:DM,TS:NU,TS:FL,TS:DB,TS
  640. [Operator Comparison]
  641. Date=DT,OK:TS,OK
  642. Timestamp=DT,OK:TS,OK
  643. ;
  644. ; These SQL-92 CAST expressions are supported by Oracle
  645. ; To furthur expand cast support, we could use built-in cast_functions
  646. ;
  647. ; Notes:
  648. ; - Casting as SMALLINT, INTEGER and BIGINT cannot be supported for
  649. ; Oracle because Oracle only has one datatype (NUMBER) to represent
  650. ; exact numeric values and its precision is the number of digits,
  651. ; which does not help UDA map to the correct datatype.
  652. ; ie. The maximum value of a SMALLINT is 32767 and this value has
  653. ; a precision of 5. As the maximum value of a NUMBER with
  654. ; precision 5 is 99999, UDA maps this precision value to an
  655. ; INTEGER, not a SMALLINT.
  656. ;
  657. [Operator Cast]
  658. AD=AD,NA
  659. NA=CH,CH:VC,VC:NC,NC:NV,NV:DB,DB:DT,DT:TS,TS:TZ,TZ:NU,NU:DM,DM
  660. CH=CH,CH:VC,VC:NU,NU:DM,DM:DB,DB:DT,DT:TS,TS
  661. VC=CH,CH:VC,VC:NU,NU:DM,DM:DB,DB:DT,DT:TS,TS
  662. NC=NC,NC:NV,NV:NU,NU:DM,DM:DB,DB
  663. NV=NC,NC:NV,NV:NU,NU:DM,DM:DB,DB
  664. SM=CH,CH:VC,VC:NC,NC:NV,NV:NU,NU:DM,DM:DB,DB:DT,DT
  665. IT=CH,CH:VC,VC:NC,NC:NV,NV:NU,NU:DM,DM:DB,DB:DT,DT
  666. NU=CH,CH:VC,VC:NC,NC:NV,NV:NU,NU:DM,DM:DB,DB:DT,DT
  667. DM=CH,CH:VC,VC:NC,NC:NV,NV:NU,NU:DM,DM:DB,DB:DT,DT
  668. FL=CH,CH:VC,VC:NC,NC:NV,NV:FL,FL:DB,DB:NU,NU:DM,DM
  669. DB=CH,CH:VC,VC:NC,NC:NV,NV:DB,DB:NU,NU:DM,DM
  670. DT=CH,CH:VC,VC:NC,NC:NV,NV:DT,DT:TS,TS
  671. TS=CH,CH:VC,VC:NC,NC:NV,NV:DT,DT:TS,TS
  672. TZ=CH,CH:VC,VC:NC,NC:NV,NV
  673. IY=CH,CH:VC,VC:NC,NC:NV,NV
  674. QD=CH,CH:VC,VC:NC,NC:NV,NV:NU,NU:DM,DM:DB,DB:DT,DT
  675. TX=AD,AD
  676. BL=AD,AD