cogdmct.ini 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. ;***********************************************************************
  2. ;Licensed Materials - Property of IBM
  3. ;
  4. ;BI and PM: UDA
  5. ;
  6. ;(C) Copyright IBM Corp. 2005, 2018
  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: //uda/main/prod/dmd/sgi/ctlib/cogdmct.ini#5 $
  21. ;
  22. ; Module:
  23. ; cogdmsct.ini
  24. ;
  25. ; This file provides all database information required by the
  26. ; SQL to SQL translator and the RDS component of DMS.
  27. ;
  28. ; ***************************************************************************
  29. ;
  30. ; List of expression results. For now, just do addition.
  31. ; The differences in the tables will arise from date subtraction,
  32. ; and date multiplication and division which do not make sense!
  33. ;
  34. [Expression Results]
  35. ;
  36. ; * Small Integer
  37. ;
  38. sqlSmallInt,+,sqlSmallInt=sqlInteger
  39. sqlSmallInt,+,sqlInteger=sqlInteger
  40. sqlSmallInt,+,sqlDecimal=sqlDecimal
  41. sqlSmallInt,+,sqlFloat=sqlFloat
  42. sqlSmallInt,+,sqlDouble=sqlDouble
  43. sqlSmallInt,+,sqlQuad=sqlQuad
  44. sqlSmallInt,+,sqlDateTime=sqlDateTime
  45. ;
  46. ; * Integer
  47. ;
  48. sqlInteger,+,sqlSmallInt=sqlInteger
  49. sqlInteger,+,sqlInteger=sqlInteger
  50. sqlInteger,+,sqlDecimal=sqlDecimal
  51. sqlInteger,+,sqlFloat=sqlFloat
  52. sqlInteger,+,sqlDouble=sqlDouble
  53. sqlInteger,+,sqlQuad=sqlQuad
  54. sqlInteger,+,sqlDateTime=sqlDateTime
  55. ;
  56. ; * Decimal
  57. ;
  58. sqlDecimal,+,sqlSmallInt=sqlDecimal
  59. sqlDecimal,+,sqlInteger=sqlDecimal
  60. sqlDecimal,+,sqlDecimal=sqlDecimal
  61. sqlDecimal,+,sqlFloat=sqlFloat
  62. sqlDecimal,+,sqlDouble=sqlDouble
  63. sqlDecimal,+,sqlQuad=sqlDecimal
  64. sqlDecimal,+,sqlDateTime=sqlDateTime
  65. ;
  66. ; * Float
  67. ;
  68. sqlFloat,+,sqlSmallInt=sqlFloat
  69. sqlFloat,+,sqlInteger=sqlFloat
  70. sqlFloat,+,sqlDecimal=sqlFloat
  71. sqlFloat,+,sqlFloat=sqlFloat
  72. sqlFloat,+,sqlDouble=sqlDouble
  73. sqlFloat,+,sqlQuad=sqlDouble
  74. sqlFloat,+,sqlDateTime=sqlDateTime
  75. ;
  76. ; * Double
  77. ;
  78. sqlDouble,+,sqlSmallInt=sqlDouble
  79. sqlDouble,+,sqlInteger=sqlDouble
  80. sqlDouble,+,sqlDecimal=sqlDouble
  81. sqlDouble,+,sqlFloat=sqlDouble
  82. sqlDouble,+,sqlDouble=sqlDouble
  83. sqlDouble,+,sqlQuad=sqlDouble
  84. sqlDouble,+,sqlDateTime=sqlDateTime
  85. ;
  86. ; * Quad
  87. ;
  88. sqlQuad,+,sqlSmallInt=sqlQuad
  89. sqlQuad,+,sqlInteger=sqlQuad
  90. sqlQuad,+,sqlDecimal=sqlQuad
  91. sqlQuad,+,sqlFloat=sqlDouble
  92. sqlQuad,+,sqlDouble=sqlDouble
  93. sqlQuad,+,sqlQuad=sqlQuad
  94. sqlQuad,+,sqlDateTime=sqlDateTime
  95. ;
  96. ; * Date/time
  97. ;
  98. sqlDateTime,+,sqlSmallInt=sqlDateTime
  99. sqlDateTime,+,sqlInteger=sqlDateTime
  100. sqlDateTime,+,sqlDecimal=sqlDateTime
  101. sqlDateTime,+,sqlFloat=sqlDateTime
  102. sqlDateTime,+,sqlDouble=sqlDateTime
  103. sqlDateTime,+,sqlQuad=sqlDateTime
  104. ;
  105. ; Operations supported and results of the supported operation.
  106. ; The format is;
  107. ; [Operator <operator name>]
  108. ; <LHS>=<RHS>,<RES>{;<RHS>,<RES>}
  109. ;
  110. ; where
  111. ;
  112. ; LHS = data type of left hand side of operation
  113. ; RHS = data type of right hand side of operation
  114. ; RES = result data type of operation
  115. ;
  116. ; LHS, RHS and RES values may be one of:
  117. ;
  118. ; Name Abbreviation DMS Data Type
  119. ; CHAR CH sqlChar
  120. ; VARCHAR VC sqlVarChar
  121. ; LVARCHAR LC sqlLongVarChar
  122. ; BINARY BN sqlBinary
  123. ; VARBINARY VB sqlVarBinary
  124. ; SMALLINT SM sqlSmallInt
  125. ; INTEGER IT sqlInteger
  126. ; QUAD QD sqlQuad
  127. ; DECIMAL DM sqlDecimal
  128. ; FLOAT FL sqlFloat
  129. ; DOUBLE DB sqlDouble
  130. ; DATE DT sqlDate
  131. ; TIME TM sqlTime
  132. ; TIMESTAMP TS sqlDateTime
  133. ; INTERVAL IV sqlInterval
  134. ; ---- NA sqlUnknownType
  135. ;
  136. [Operator Addition]
  137. Date=
  138. Time=
  139. Timestamp=
  140. Interval=
  141. [Operator Subtraction]
  142. Date=
  143. Time=
  144. Timestamp=
  145. Interval=
  146. [Operator Comparison]
  147. Date=DT,OK:TS,OK
  148. Timestamp=DT,OK:TS,OK
  149. [Operator Cast]
  150. NA=AD,NA
  151. AD=VC,NA:NC,NA:NV,NA:TT,NA:TZ,NA:IV,NA:IY,NA
  152. TM=TS,NA
  153. ;
  154. ; There are no exceptions to the command strings.
  155. ;
  156. [Exceptions Commands]
  157. Select_Star=T
  158. [Exceptions Clauses]
  159. [Exceptions Tables]
  160. Simple=T
  161. Derived=T
  162. Joined=T
  163. UniqueName_Prefix="coguda"
  164. ; Maximum length of aliases.
  165. ; Even though Sybase 15 has increased the size of
  166. ; identifier to 255 from 30, we can not set it because
  167. ; our interface to Sybase is set to use 12.5.
  168. ; It is set to 28 to include the delimited character.
  169. SQL_MAX_TABLE_NAME_LEN="28"
  170. [Exceptions Tables Version:15.7]
  171. ; Even though Sybase 12.5 supports use of derived table,
  172. ; but it has a hard limit of 14 internal work(temp) table
  173. ; to be used to store temp result, this seriously limit
  174. ; the usage of derived table, and since RDS's sql group transformation
  175. ; generates a separate derived table for each distinct OLAP function
  176. ; with distinct FOR clause, so even now the OLAP functions can
  177. ; be pushed down, but it will fail on the server side anyway.
  178. ;
  179. ; Although in ASE 15 Sybase increase the internal work(temp) table
  180. ; from 14 to 46, is still a limitation for UDA.
  181. ;
  182. ; Cognos asked Sybase for removal of the limit and as a result
  183. ; Sybase has created CR 439945: "Enhancement request to remove
  184. ; the limit number of work table for derived tables".
  185. ; Until CR 439945 is implemented by Sybase, the "Derived" entry is still set to False.
  186. ;
  187. Derived=F
  188. Joined=F
  189. [Exceptions Joins]
  190. Inner=T
  191. Inner_Syntax=" INNER JOIN "
  192. Inner_Tbl_Restrict=F
  193. Left_Eql=" LEFT OUTER JOIN "
  194. Non_Equi_Joins=T
  195. Non_Join_Expr=T
  196. Non_Join_Non_Equi_Expr=T
  197. On_Condition_Subqueries=T
  198. Optnl_Tbl_Filter=T
  199. Optnl_Tbl_Join_Restrict=F
  200. Optnl_Tbl_Restrict=F
  201. Outer_Syntax=T
  202. Prsrv_Tbl_Filter=T
  203. Prsrv_Tbl_Join_Filter=T
  204. Right_Eql=" RIGHT OUTER JOIN "
  205. Cross=
  206. Left_Outer=T
  207. Right_Outer=T
  208. Full_Outer=
  209. Nested_Outer=T
  210. Outer_Tbl_List=F
  211. Left_Pre=""
  212. Left_Post=""
  213. Right_Pre=""
  214. Right_Post=""
  215. Left_Nested=T
  216. Right_Nested=T
  217. Two_Sided_Join_Restrict=F
  218. Optnl_Tbl_Join_Filter=T
  219. Full_Non_Equi_Join=F
  220. On_Condition_Set_Functions=F
  221. On_Condition_Not_Predicate=T
  222. On_Condition_In_Predicate=T
  223. On_Condition_Between_Predicate=T
  224. On_Condition_Like_Predicate=T
  225. On_Condition_IsNull_Predicate=T
  226. On_Condition_Or_Predicate=T
  227. Full_Syntax=
  228. Cross_Syntax=
  229. Union_Syntax=
  230. Natural_Syntax=
  231. Full_Pre=
  232. Full_Post=
  233. ;
  234. ; Sybase does not support 'match' or 'overlaps'
  235. ;
  236. [Exceptions Predicates]
  237. Match=
  238. Overlaps=
  239. [Exceptions Aggregates]
  240. Max="max"
  241. Min="min"
  242. Avg="avg"
  243. Sum="sum"
  244. Count="count"
  245. Count_Star="count(*)"
  246. [Exceptions Set Operators]
  247. Union_All=T
  248. Except=
  249. Intersect=
  250. Order_By_Limit="31"
  251. [Exceptions Operators]
  252. Neq="!="
  253. [Exceptions Value Expressions]
  254. Cast=T
  255. Case=T
  256. Coalesce=T
  257. Nullif=T
  258. Extract=C
  259. Position=C
  260. Char_Length=C
  261. Octet_length=C
  262. Bit_Length=F
  263. Substring=C
  264. Upper=T
  265. Lower=T
  266. Strcat=C
  267. Abs=T
  268. Mod=C
  269. Ln=C
  270. Exp=T
  271. Power=T
  272. Sqrt=T
  273. Floor=T
  274. Ceiling=T
  275. Trim=F
  276. Trim_Both_Spaces=C
  277. Trim_Leading_Spaces=C
  278. Trim_Trailing_Spaces=C
  279. [Exceptions Blob Expressions]
  280. Blob_In_Substring=F
  281. Blob_In_StrCat=F
  282. Blob_In_IsNull=F
  283. ;
  284. ; Extract=C, above, indicates that SQL'92 EXTRACT functionality is [partially]
  285. ; supported by the Sybase Gateway through the use of the following function maps.
  286. ;
  287. ; EXTRACT( YEAR FROM <dateColumn> )' maps to coguda#extract_year( <dateexpr> ).
  288. ;
  289. Extract_Year=coguda#extract_year
  290. Extract_Month=coguda#extract_month
  291. Extract_Day=coguda#extract_day
  292. Extract_Hours=coguda#extract_hour
  293. Extract_Minutes=coguda#extract_minute
  294. Extract_Seconds=coguda#extract_second
  295. [Exceptions Value Expressions Version:11.0]
  296. Cast=F
  297. Case=F
  298. Coalesce=F
  299. Nullif=F
  300. Extract=F
  301. [Exceptions General]
  302. Nulls_Sort_Last=F
  303. Group_By_Expr=T
  304. Multiple_Distinct=T
  305. Subquery_Column_Alias=F
  306. Count_Non_Distinct=T
  307. Count_Value_Expr=T
  308. Count_Literal=T
  309. Count_Blob=F
  310. Like_Value_Expr=T
  311. Is_Null_Value_Expr=T
  312. Is_Null_Value_Parm=F
  313. Subquery_In_Group_By=F
  314. Subquery_In_Case=T
  315. Subqueries=T
  316. Like_With_Escape=T
  317. Current_Date=C
  318. Current_Time=F
  319. Current_Timestamp=F
  320. Localtime=C
  321. Localtimestamp=C
  322. Boolean_Comparison=F
  323. Parameter_In_Select_List=F
  324. Parameter_In_Having=F
  325. ;
  326. ; We have problems with subqueries in version 11.0 and 11.5 in a variety of
  327. ; scenarios, enough that we cannot identify specific conditions in which
  328. ; we can and cannot safely push subqueries to SQL Server.
  329. ;
  330. [Exceptions General Version:11.0]
  331. Subqueries=F
  332. Correlated_Subqueries=F
  333. ; refer trakker 233108
  334. Subquery_In_Case=F
  335. Localtime=F
  336. [Exceptions General Version:11.5.0]
  337. Subqueries=F
  338. Correlated_Subqueries=F
  339. ; refer trakker 233108
  340. Subquery_In_Case=F
  341. Localtime=F
  342. [Exceptions General Version:11.9.1]
  343. Correlated_Subqueries=F
  344. Subqueries=F
  345. ; refer trakker 233108
  346. Subquery_In_Case=F
  347. Localtime=F
  348. ;
  349. ; Commented down below entry because the problem is fixed in 11.9.2 EBF 8891.
  350. ; The Sybase bug number that causes the problem is 203089: A 'Group By' query
  351. ; with an 'IN' list and an 'ISNULL' clause within a 'Case' expression returns
  352. ; results as a Cartesian product. Trakker number is 266806.
  353. [Exceptions General Version:11.9.2]
  354. ;Group_By_Expr=F
  355. ; refer trakker 233108
  356. Subquery_In_Case=F
  357. [Exceptions General Version:12.0.0]
  358. Localtime=F
  359. [Exceptions General Version:12.5.0]
  360. Localtime=F
  361. [Exceptions Literals]
  362. Alt_Timestamp_Literal_Str="'%s-%s-%s %s:%s:%s.%-.3s'"
  363. Alt_Date_Literal_Assignment=T
  364. Alt_Date_Literal_Between=T
  365. Alt_Date_Literal_Comparison=T
  366. Alt_Date_Literal_In=T
  367. Alt_Date_Literal_Insert_Value=T
  368. ;
  369. Date_Literal=C
  370. Date_Format_Str="YYYY MM DD"
  371. Date_Literal_Str="convert(date,'%s-%s-%s')"
  372. Date_Add_Function_Str="dateadd(day,?2,?1)"
  373. Date_Sub_Function_Str="datediff(day,?2,?1)"
  374. ;
  375. Interval_Literal=F
  376. IntervalYM_Literal=F
  377. ;
  378. Time_Literal=C
  379. Time_Format_Str="HH MM SS FFF"
  380. Time_Literal_Str="convert(time,'%s:%s:%s.%-.3s')"
  381. ;
  382. TimeTZ_Literal=F
  383. TimeTZ_Format_Str=
  384. TimeTZ_Literal_Str=
  385. ;
  386. Timestamp_Literal=C
  387. Timestamp_Format_Str="YYYY MM DD HH MM SS FFF"
  388. Timestamp_Literal_Str="convert(datetime,'%s-%s-%s %s:%s:%s.%-.3s')"
  389. ;
  390. TimestampTZ_Literal=F
  391. TimestampTZ_Format_Str=
  392. TimestampTZ_Literal_Str=
  393. ;
  394. NChar_Literal=F
  395. ;
  396. Boolean_Literal=F
  397. True_Literal_Str=
  398. False_Literal_Str=
  399. Unknown_Literal_Str=
  400. ; The datetime datatype for Sybase ASE has a range starting at
  401. ; January 1, 1753 and ending at December 31, 9999.
  402. Timestamp_Range_Start="1753-01-01"
  403. Timestamp_Range_End="9999-12-31"
  404. [Exceptions Literals Version:12.0.0]
  405. Date_Literal_Str="convert(datetime,'%s-%s-%s')"
  406. Time_Literal=F
  407. [Exceptions Literals Version:12.5.0]
  408. Date_Literal_Str="convert(datetime,'%s-%s-%s')"
  409. Time_Literal=F
  410. [Exceptions Delimiters]
  411. ;
  412. ; Specifies the delimiter character for each name part.
  413. ;
  414. ; If a delimiter is set to nothing, then the database does not support the
  415. ; delimiting of that name part; otherwise, the specified string is used to
  416. ; delimit the corresponding name part.
  417. ;
  418. ; NOTE: if Wholename specified and not empty then this indicates that fully
  419. ; qualified names are delimited with this character;
  420. ; For example,
  421. ; "myCatalog.mySchema.myTable.myColumn"
  422. ;
  423. ; NOTE: for a double quote (") entry, specifies "\"".
  424. ;
  425. Catalog_Delimiter=
  426. Schema_Delimiter=
  427. Table_Delimiter="\""
  428. Column_Delimiter="\""
  429. Procedure_Delimiter=
  430. Wholename_Delimiter=
  431. [Exceptions Separators]
  432. ;
  433. ; Specifies the name separator that follows the type of name.
  434. ; [<catalog><catalogSeparator>][<schema><schemaSeparator>][<table><tableSeparator>][<column>]
  435. ; [<catalog><catalogSeparator>][<schema><schemaSeparator>][<procedure>]
  436. ;
  437. Catalog_Separator="."
  438. Schema_Separator="."
  439. Table_Separator="."
  440. [Exceptions Misc]
  441. Session_Sort_Order=T
  442. ;
  443. ; System 10 functions equivalent to EE functions
  444. ;
  445. ; Several functions are supported by System 10 but do
  446. ; not match the EE functions closely enough to be
  447. ; used as substitutes:
  448. ;
  449. ; ascii (the convert function requires a size specification)
  450. ; index (patindex) (patindex requires % characters around string)
  451. ;
  452. [Builtin Functions]
  453. n:cast_float(%1bcdints)=convert(float(48),%1);
  454. n:cast_real(%1bcdints)=convert(real,%1);
  455. ;
  456. ; mapping cast_decimal to convert(decimal(31, 16),%1) is a KLUDGE for
  457. ; fixing trakker 229629 (incorrect results for division expression)
  458. ; temporarily. The bug should be fixed in translator
  459. ; to allow precision and scale to be passed to cast_decimal.
  460. ;
  461. n:cast_decimal(%1bcdints)=convert(decimal(31, 16),%1);
  462. n:cast_integer(%1bcdints)=convert(integer,%1);
  463. n:cast_smallint(%1bcdints)=convert(smallint,%1);
  464. s:cast_timestamp(%1bcdints)=convert(datetime,%1);
  465. c:cast_char(%1bcdints)=convert(char,%1);
  466. c:cast_varchar(%1bcdints)=convert(varchar,%1);
  467. n:octet_length(%1cx)=datalength(%1);
  468. n:position(%1c,%2c)=charindex(%1,%2);
  469. c:substring(%1c,%2n,%3n)=substring(%1,%2,%3);
  470. c:substring(%1c,%2n)=substring(%1,%2,char_length(%1));
  471. ;c:substring(%1x,%2n,%3n)=substring( convert(varchar(16384),%1),%2,%3 );
  472. c:coguda#concat(%1c,%2c)=%1 + %2;
  473. c:coguda#concat(%1bdints,%2bdints)=%1 + %2;
  474. ;c:coguda#concat(%1x,%2c)=convert( VARCHAR(16384),%1 ) + %2;
  475. ;c:coguda#concat(%1c,%2x)=%1 + convert( VARCHAR(16384),%2 );
  476. ;c:coguda#concat(%1x,%2x)= convert( VARCHAR(16384),%1 ) + convert( VARCHAR(16384),%2 );
  477. n:mod(%1n,%2n)=( (%1) % (%2) );
  478. n:ln(%1n)=LOG(%1);
  479. n:char_length(%1cx)=char_length(%1);
  480. d:current_date()=current_date();
  481. t:localtime()=current_time();
  482. s:localtimestamp({%1n})=getdate();
  483. n:absolute(%1n)=abs(%1);
  484. n:ceiling(%1n)=ceiling(%1);
  485. c:concat(%1c,%2c)=%1 + %2;
  486. c:downshift(%1c)=lower(%1);
  487. n:floor(%1n)=floor(%1);
  488. n:index(%1c,%2c)=charindex(%2,%1);
  489. c:leftjustify(%1c)=ltrim(%1);
  490. n:position(%1c,%2c)=charindex(%1,%2);
  491. n:power(%1n,%2n)=power(%1,%2);
  492. c:reverse(%1c)=reverse(%1);
  493. n:size(%1c)=datalength(%1);
  494. c:truncate(%1c)=rtrim(%1);
  495. c:upshift(%1c)=upper(%1);
  496. n:round(%1n,%2n)=round(%1, %2);
  497. n:ascii(%1c)=ascii(%1);
  498. ;
  499. ; Business Functions for Date Calculations
  500. ;
  501. d:_add_days(%1d,%2n)=DATEADD( DAY, %2, %1 );
  502. s:_add_days(%1s,%2n)=DATEADD( DAY, %2, %1 );
  503. d:_add_months(%1d,%2n)=DATEADD( MONTH, %2, %1 );
  504. s:_add_months(%1s,%2n)=DATEADD( MONTH, %2, %1 );
  505. d:_add_years(%1d,%2n)=DATEADD( YEAR, %2, %1 );
  506. s:_add_years(%1s,%2n)=DATEADD( YEAR, %2, %1 );
  507. n:_days_between(%1ds,%2ds)=DATEDIFF( DAY, %2, %1 );
  508. n:_months_between(%1ds,%2ds)=DATEDIFF( MONTH, %2, %1 );
  509. n:_years_between(%1ds,%2ds)=DATEDIFF( YEAR, %2, %1 );
  510. n:_days_to_end_of_month(%1ds)=DATEDIFF( DAY, %1, DATEADD( DAY, -1, DATEADD( MONTH, 1, DATEADD( DAY, 1 - DATEPART( DAY, %1 ), %1 ) ) ) );
  511. n:_age(%1ds)=;
  512. d:_first_of_month(%1d)=DATEADD( DAY, -DATEPART( DAY, %1 ) + 1, %1 );
  513. s:_first_of_month(%1s)=DATEADD( DAY, -DATEPART( DAY, %1 ) + 1, %1 );
  514. d:_last_of_month(%1d)=DATEADD( DAY, -1, DATEADD( MONTH, 1, DATEADD( DAY, -DATEPART( DAY, %1 ) + 1, %1 ) ) );
  515. s:_last_of_month(%1s)=DATEADD( DAY, -1, DATEADD( MONTH, 1, DATEADD( DAY, -DATEPART( DAY, %1 ) + 1, %1 ) ) );
  516. s:_make_timestamp(%1n,%2n,%3n)=CONVERT( DATETIME, CONVERT( VARCHAR(8), ( %1 * 10000 ) + ( %2 * 100 ) + %3 ) );
  517. n:_ymdint_between(%1ds,%2ds)=;
  518. n:_day_of_year(%1ds)=DATEPART( DAYOFYEAR, %1 );
  519. n:_week_of_year(%1ds)=DATEPART( CALWEEKOFYEAR, %1 );
  520. n:_day_of_week(%1ds, %2n)=(( ( DATEPART( WEEKDAY, %1 ) + 5 ) % 7 - %2 + 8 ) % 7 + 1);
  521. n:_round(%1n,%2n)=ROUND(%1, %2);
  522. ;
  523. ; Additional Business Functions for Date Calculations
  524. ;
  525. s:_add_hours(%1s,%2n)=DATEADD( HOUR, %2, %1 );
  526. t:_add_hours(%1t,%2n)=DATEADD( HOUR, %2, %1 );
  527. s:_add_minutes(%1s,%2n)=DATEADD( MINUTE, %2, %1 );
  528. t:_add_minutes(%1t,%2n)=DATEADD( MINUTE, %2, %1 );
  529. s:_add_seconds(%1s,%2n)=DATEADD( SECOND, %2, %1 );
  530. t:_add_seconds(%1t,%2n)=DATEADD( SECOND, %2, %1 );
  531. n:_hours_between(%1ds,%2ds)=DATEDIFF( HOUR, %2, %1 );
  532. n:_minutes_between(%1ds,%2ds)=DATEDIFF( MINUTE, %2, %1 );
  533. n:_seconds_between(%1ds,%2ds)=DATEDIFF( SECOND, %2, %1 );
  534. ;
  535. ; Functions required by EXTRACT.
  536. ;
  537. n:coguda#extract_year(%1ds)=DATEPART(YEAR, %1);
  538. n:coguda#extract_month(%1ds)=DATEPART(MONTH, %1);
  539. n:coguda#extract_day(%1ds)=DATEPART(DAY, %1);
  540. n:coguda#extract_hour(%1dst)=DATEPART(HOUR, %1);
  541. n:coguda#extract_minute(%1dst)=DATEPART(MINUTE, %1);
  542. ; Case 11139380 (CR 391255)
  543. ; For TIME columns that are NULLABLE, using the DATEPART function with the SECOND and
  544. ; MILLISECOND option returns incorrect data
  545. n:coguda#extract_second(%1ds)=DATEPART(SECOND, %1) + convert( decimal, DATEPART(MILLISECOND, %1)) / 1000;
  546. ;CAST functions
  547. ; for timestamp we need to change it to DATETIME
  548. s:coguda#cast_timestamp(%1cnds)=CAST( %1 AS DATETIME );
  549. [Builtin Functions Version:12.5.0]
  550. d:current_date()=convert(datetime, convert( char(8), getdate(), 112 ), 112);
  551. [Builtin Functions Version:12.0.0]
  552. d:current_date()=convert(datetime, convert( char(8), getdate(), 112 ), 112);
  553. [Builtin Functions Version:11.9.2]
  554. d:current_date()=convert(datetime, convert( char(8), getdate(), 112 ), 112);
  555. [Database Functions]
  556. ;
  557. ; Character
  558. ;
  559. n:sy_ascii(%1c)=ascii(%1);
  560. c:sy_char(%1n)=char(%1);
  561. n:sy_char_length(%1c)=char_length(%1);
  562. c:sy_right(%1c,%2n)=right(%1,%2);
  563. c:sy_soundex(%1c)=soundex(%1);
  564. cx:trim_leading_spaces(%1cx)=LTRIM(%1);
  565. cx:trim_trailing_spaces(%1cx)=RTRIM(%1);
  566. cx:trim_both_spaces(%1cx)=LTRIM(RTRIM(%1));
  567. ;
  568. ; Numeric
  569. ;
  570. n:sy_rand(%1n)=rand(%1);
  571. n:sy_round(%1n,%2n)=round(%1,%2);
  572. ;
  573. ; Conversion
  574. ;
  575. ; SQL Server supports several type conversions. The ones listed
  576. ; below are the ones we are interested in:
  577. ;
  578. ; - number to char
  579. ; - datetime to char
  580. ;
  581. ; - char to number
  582. ;
  583. ; - char to datetime
  584. ; - number to datetime
  585. ;
  586. bcdints:convert(%1bcdints,%2bcxdints {,%3n})=convert(%1,%2 {,%3});
  587. ;
  588. ; System functions
  589. ;
  590. c:sy_user()=user;
  591. ;
  592. ; This section currently unused
  593. ;
  594. [Database Specific Variables]
  595. @@char_convert=n
  596. @@client_csname=c
  597. @@client_csid=n
  598. @@connections=n
  599. @@cpu_busy=n
  600. @@error=n
  601. @@identity=n
  602. @@idle=n
  603. @@io_busy=n
  604. @@isolation=n
  605. @@langid=c
  606. @@language=c
  607. @@maxcharlen=n
  608. @@max_connections=n
  609. @@maxread=n
  610. @@maxwrite=n
  611. @@minwrite=n
  612. @@ncharsize=n
  613. @@nestlevel=n
  614. @@pack_receivea=n
  615. @@pack_senta=n
  616. @@packet_errorsa=n
  617. @@procid=n
  618. @@rowcounta=n
  619. @@servername=c
  620. @@spid=n
  621. @@sqlstatus=n
  622. @@textsize=n
  623. @@thresh_hysteresis=n
  624. @@timeticks=n
  625. @@total_errors=n
  626. @@total_read=n
  627. @@total_write=n
  628. @@tranchained=n
  629. @@trancount=n
  630. @@transtate=n
  631. @@version=t
  632. [Directives Session]
  633. ;
  634. ; By default SQL_ATTRIB_DB_DOP( Degree of Parallelism ) is 0.
  635. ; To disable parallel execution this attribute must be changed to
  636. ; Dop_Text="SET PARALLEL_DEGREE 1"
  637. ;
  638. Dop_Text="SET PARALLEL_DEGREE 0"
  639. Dop_Pos=
  640. ;
  641. ; By default SQL_ATTRIB_DB_JOIN_ORDER( table ordering ) is
  642. ; SQL_NO_JOIN_ORDER.
  643. ; To set to SQL_ORDERED_JOIN this attribute must be changed to
  644. ; Ordered_Text="SET FORCEPLAN ON"
  645. ;
  646. Ordered_Text="SET FORCEPLAN OFF"
  647. Ordered_Pos=
  648. ; Row Limit in Sybase ASE Server is achieved by adding
  649. ; the following line: TOP n right after the first SELECT or SELECT DISTINCT
  650. ;
  651. ; The Row Limit in Sybase ASE Server is
  652. ; supported from version 12.5.3 and up
  653. ;
  654. Query_Row_Limit_Pos=Append_Distinct
  655. Query_Row_Limit_Text=" TOP %d "
  656. [Directives Session Version:12.5.0]
  657. Query_Row_Limit_Pos=
  658. Query_Row_Limit_Text=
  659. [Directives Session Version:12.5.1]
  660. Query_Row_Limit_Pos=
  661. Query_Row_Limit_Text=
  662. [Directives Session Version:12.5.2]
  663. Query_Row_Limit_Pos=
  664. Query_Row_Limit_Text=
  665. [Misc]
  666. ;
  667. ; The entry 'Debug' indicates if debug is enabled or disabled. 0 indicates
  668. ; that CT-Library debug tracing is disabled. The following values may
  669. ; be added together to enable various levels of CT-Library debug tracing:
  670. ;
  671. ; 0 = disables all tracing
  672. ;
  673. ; 1 = prints function-level state transition information
  674. ;
  675. ; 2 = prints information each time an asynchronous operation begins or
  676. ; completes
  677. ;
  678. ; 4 = prints message text whenever a CT-Library or server message is
  679. ; generated
  680. ;
  681. ; 8 = prints trace information whenever a CT-Library error occurs
  682. ;
  683. ; 16 = prints memory management information
  684. ;
  685. ; 32 = prints CT-Library network interaction information
  686. ;
  687. ; 64 = prints CT-Library protocol-level state transition information
  688. ;
  689. ; For example, if to enable:
  690. ;
  691. ; - asynchronous information
  692. ; - CT-Library error trace information
  693. ; - protocol-level state transition information
  694. ;
  695. ; the value for 'Debug' would be:
  696. ;
  697. ; 2 + 8 + 64 = 74
  698. ;
  699. ; The 'Debug File' entry indicates to which file the CT-Library debug
  700. ; trace results should be written. If no name is supplied, the file
  701. ; ctdebug.log is created in the user's temporary directory (as indicated
  702. ; by the value of either the TMP or TMPDIR DOS environment variables).
  703. ;
  704. ; The name of the debug file may contain the strings TMP or TMPDIR in
  705. ; which case the value of the corresponding environment variable is
  706. ; substituted in the string supplied by the user.
  707. ;
  708. Debug=0
  709. Debug File=TMP\ctlib.log
  710. ;
  711. ; The entry 'Enable cancel' enables the use of asynchronous cancellations
  712. ; of the asynchronous opening of cursors. Previously, due to a bug in
  713. ; CT-Library, cancelling an asynchronous cursor open command would cause
  714. ; the application to hang. This bug has been fixed by Sybase. If this
  715. ; problem is encountered, this following setting should be set to '0'. The
  716. ; latest version of CT-Library should be obtained from Sybase to fix this
  717. ; problem.
  718. ;
  719. Enable cancel=1
  720. ;
  721. ; The entry 'Enable notify' enables the reception of asynchronous RPC
  722. ; notifications. Enabling notifications may cause an application
  723. ; to abort during the 'describe' operation. When this has been fixed in
  724. ; CT-Library. If the problem is encountered, set the 'Enable notify' item
  725. ; to '1'. Having this item set to '0' disables the reception of asynchronous
  726. ; notifications from an open server.
  727. ;
  728. Enable notify=0
  729. ;
  730. ; The entry 'Enable delimit' enables the support of delimited identifiers
  731. ; within SQL queries. Due to problems with Sybase System 10's handling
  732. ; of SQL queries with this option enabled, the default is to disable
  733. ; the use of delimited identifiers. If these problems are fixed, set
  734. ; the value of this flag to '1' to enable the use of delimited identifiers.
  735. ; NOTE: if this flag is set to '1', do not forget to change the entry
  736. ; under [Exceptions Delimiters] to "\" for the corresponding name part
  737. ;
  738. Enable delimit=0
  739. ;
  740. ; The entry 'Read Only Clause' is used to add an explicit 'for read only'
  741. ; clause to the end of all (non 'for update') select statements. CT-Library
  742. ; does not currently make cursors read-only without the explicit syntax
  743. ; added to the SQL statement. If this problem is fixed, then this value
  744. ; may be set to 0. Setting the value to 0 without this bug fixed will
  745. ; cause all select statements to be executed with a read/write cursor,
  746. ; possibly affecting performance, especially if a where clause references
  747. ; an indexed column.
  748. ;
  749. Read Only Clause=1
  750. ;
  751. ; The entry 'NUMOFROWS' is used to set the number of rows that the server
  752. ; returns to Client-Library per each internal fetch request.
  753. NUMOFROWS=20
  754. ;
  755. ; The entry 'Enable APICheck' enables CT-Library to perform argument
  756. ; and state checking for their routine.
  757. ; By default, we do not do API checking. With API checking disabled, CT-Library
  758. ; does not check for usage errors. Trakker 259102 is a usage error, where
  759. ; a stored procedure does not expect the right number of parameter. With API
  760. ; checking is disabled, user does not receive any error. However, when user
  761. ; tries to retrieve the result set, CT-Library GPF.
  762. ; Workaround for 259102, to set 'Enable APIChk' to 1.
  763. Enable APICheck=0
  764. ; Default processing mode.
  765. Processing Mode=Limited Local
  766. ; Sybase CTLIB does not have a definition for ASE's varchar datatype
  767. ; A field called usertype in CTLIB structure can be used to
  768. ; indicate that the datatype is ASE's varchar.
  769. ; However this 'usertype' can return incorrect or inaccurate information as
  770. ; describe in Sybase bug CR 431945:"When executing a SELECT statment via DYNAMIC SQL
  771. ; Adaptive Server could send incorrect or inaccurate information in the column format
  772. ; descriptions for the user type id field. As per Jan 2007, the bug is fixed
  773. ; in ASE 12.5.4 ESD 3 but not in ASE 15 and up
  774. ;
  775. ; For user who has a fix for Sybase bug CR 431945 and would like to have
  776. ; ASE's varchar returns as varchar then the following entry should be
  777. ; set to 1.
  778. ; See Trakker 459431 for more description.
  779. ;
  780. Return Varchar=1
  781. [Misc Version:12.0.0]
  782. Return Varchar=0
  783. [Misc Version:12.5.0]
  784. Return Varchar=0
  785. [Misc Version:12.5.1]
  786. Return Varchar=0
  787. [Misc Version:12.5.2]
  788. Return Varchar=0
  789. [Misc Version:12.5.3]
  790. Return Varchar=0
  791. [Misc Version:15.0.0]
  792. Return Varchar=0
  793. [Misc Version:15.0.1]
  794. Return Varchar=0
  795. ;
  796. ; Support of UDA USER OPTIONS.
  797. ;
  798. [UDA USER OPTIONS]
  799. Attach=SET QUOTED_IDENTIFIER ON
  800. [I18N Encoding Mapping]
  801. iso_1=ISO8859-1
  802. eucgb=ibm-1383
  803. euccns=ibm-964
  804. eucksc=ibm-970
  805. tis620=tis-620
  806. cp874=cp874
  807. [DRIVER:SYODASE.DLL]
  808. ;Since SET QUOTED_IDENTIFIER is ON, identifiers should be delimited by double quotes
  809. ;Overwrite ODBC SQLGetInfo which returns a space for SQL_IDENTIFIER_QUOTE_CHAR
  810. SQL_IDENTIFIER_QUOTE_CHAR="""
  811. ;Driver returns 30 which is incorrect
  812. SQL_MAX_TABLE_NAME_LEN="28"
  813. [DRIVER:Adaptive Server Enterprise Version:15]
  814. ;Since SET QUOTED_IDENTIFIER is ON, identifiers should be delimited by double quotes
  815. ;Overwrite ODBC SQLGetInfo which returns a space for SQL_IDENTIFIER_QUOTE_CHAR
  816. SQL_IDENTIFIER_QUOTE_CHAR="""
  817. ;Driver returns 30 which is incorrect
  818. SQL_MAX_TABLE_NAME_LEN="28"
  819. Connection Access Mode Is Changeable="F"