boot1110.sql 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  1. { ************************************************************************* }
  2. { }
  3. { Licensed Materials - Property of IBM and/or HCL }
  4. { }
  5. { IBM Informix Dynamic Server }
  6. { (c) Copyright IBM Corporation 2015 All rights reserved. }
  7. { (c) Copyright HCL Technologies Ltd. 2017. All Rights Reserved. }
  8. { }
  9. { Title: boot1110.sql }
  10. { }
  11. { Description: }
  12. { Bootstrapping script for a 11.10 database }
  13. { }
  14. { ************************************************************************* }
  15. { }
  16. { ** IMPORTANT - PLEASE READ }
  17. { }
  18. { All types and routines referenced in this file must be prefixed }
  19. { with the user name "informix". E.g., use "informix.boolean" }
  20. { and not "boolean" }
  21. { }
  22. { Also, please follow the formatting conventions!!! }
  23. { }
  24. { Please ensure that the identifiers that you choose are <= 18 }
  25. { characters in length. Otherwise the changes would affect database }
  26. { reversion. }
  27. { }
  28. { ************************************************************************* }
  29. { --- Create CDR exposed checksum functions }
  30. create dba function informix.ifx_checksum(informix.lvarchar, informix.integer)
  31. returns informix.integer
  32. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  33. external name '(lvarchar_checksum)'
  34. language C;
  35. grant execute on function informix.ifx_checksum(informix.lvarchar, informix.integer) to public as informix;
  36. create dba function informix.ifx_checksum(informix.integer, informix.integer)
  37. returns informix.integer
  38. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  39. external name '(integer_checksum)'
  40. language C;
  41. grant execute on function informix.ifx_checksum(informix.integer, informix.integer)
  42. to public as informix;
  43. create dba function informix.ifx_checksum(informix.smallint, informix.integer)
  44. returns informix.integer
  45. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  46. external name '(short_checksum)'
  47. language C;
  48. grant execute on function informix.ifx_checksum(informix.smallint, informix.integer)
  49. to public as informix;
  50. create dba function informix.ifx_checksum(p1 references byte,informix.integer)
  51. returns informix.integer
  52. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  53. external name '(classicBlob_checksum)'
  54. language C;
  55. grant execute on function informix.ifx_checksum(informix.byte, informix.integer)
  56. to public as informix;
  57. create dba function informix.ifx_checksum(p1 references text,informix.integer)
  58. returns informix.integer
  59. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  60. external name '(classicBlob_checksum)'
  61. language C;
  62. grant execute on function informix.ifx_checksum(informix.text, informix.integer)
  63. to public as informix;
  64. create dba function informix.ifx_checksum(informix.blob, informix.integer)
  65. returns informix.integer
  66. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  67. external name '(sblob_checksum)'
  68. language C;
  69. grant execute on function informix.ifx_checksum(informix.blob, informix.integer)
  70. to public as informix;
  71. create dba function informix.ifx_checksum(informix.clob, informix.integer)
  72. returns informix.integer
  73. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  74. external name '(sblob_checksum)'
  75. language C;
  76. grant execute on function informix.ifx_checksum(informix.clob, informix.integer)
  77. to public as informix;
  78. create dba function informix.ifx_checksum(informix.int8, informix.integer)
  79. returns informix.integer
  80. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  81. external name '(int8_checksum)'
  82. language C;
  83. grant execute on function informix.ifx_checksum(informix.int8, informix.integer)
  84. to public as informix;
  85. create dba function informix.ifx_checksum(informix.decimal, informix.integer)
  86. returns informix.integer
  87. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  88. external name '(decimal_checksum)'
  89. language C;
  90. grant execute on function informix.ifx_checksum(informix.decimal, informix.integer)
  91. to public as informix;
  92. create dba function informix.ifx_checksum(informix.money, informix.integer)
  93. returns informix.integer
  94. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  95. external name '(money_checksum)'
  96. language C;
  97. grant execute on function informix.ifx_checksum(informix.money, informix.integer)
  98. to public as informix;
  99. create dba function informix.ifx_checksum(informix.float, informix.integer)
  100. returns informix.integer
  101. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  102. external name '(double_checksum)'
  103. language C;
  104. grant execute on function informix.ifx_checksum(informix.float, informix.integer)
  105. to public as informix;
  106. create dba function informix.ifx_checksum(informix.real, informix.integer)
  107. returns informix.integer
  108. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  109. external name '(real_checksum)'
  110. language C;
  111. grant execute on function informix.ifx_checksum(informix.real, informix.integer)
  112. to public as informix;
  113. create dba function informix.ifx_checksum(informix.date, informix.integer)
  114. returns informix.integer
  115. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  116. external name '(date_checksum)'
  117. language C;
  118. grant execute on function informix.ifx_checksum(informix.date, informix.integer)
  119. to public as informix;
  120. create dba function informix.ifx_checksum(datetime year to fraction, informix.integer)
  121. returns informix.integer
  122. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  123. external name '(datetime_checksum)'
  124. language C;
  125. grant execute on function informix.ifx_checksum(datetime, informix.integer)
  126. to public as informix;
  127. create dba function informix.ifx_checksum(interval year to month,informix.integer)
  128. returns informix.integer
  129. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  130. external name '(interval_checksum)'
  131. language C;
  132. grant execute on function informix.ifx_checksum(interval, informix.integer)
  133. to public as informix;
  134. create dba function informix.ifx_checksum(informix.set, informix.integer)
  135. returns informix.integer
  136. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  137. external name '(collection_checksum)'
  138. language C;
  139. grant execute on function informix.ifx_checksum(informix.set, informix.integer)
  140. to public as informix;
  141. create dba function informix.ifx_checksum(informix.multiset, informix.integer)
  142. returns informix.integer
  143. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  144. external name '(collection_checksum)'
  145. language C;
  146. grant execute on function informix.ifx_checksum(informix.multiset, informix.integer)
  147. to public as informix;
  148. create dba function informix.ifx_checksum(list, informix.integer)
  149. returns informix.integer
  150. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  151. external name '(collection_checksum)'
  152. language C;
  153. grant execute on function informix.ifx_checksum(informix.list, informix.integer)
  154. to public as informix;
  155. create dba function informix.ifx_checksum(informix.row, informix.integer)
  156. returns informix.integer
  157. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  158. external name '(row_checksum)'
  159. language C;
  160. grant execute on function informix.ifx_checksum(informix.row, informix.integer) to public as informix;
  161. { --- Create new systdist procedure }
  162. create dba procedure informix.systdist (table_id int, column_no int)
  163. returning int, datetime year to fraction (5), char(1),
  164. smallfloat, smallfloat, float , stat, char(1);
  165. define v_tabauth char(8);
  166. define v_colauth char(3);
  167. define is_allowed int;
  168. define search_columns int;
  169. define v_colno smallint;
  170. define v_seqno int;
  171. define v_constr_time datetime year to fraction(5);
  172. define v_mode char(1);
  173. define v_resolution smallfloat;
  174. define v_confidence smallfloat;
  175. define v_encdat stat;
  176. define v_owner char(8);
  177. define user procedure;
  178. define v_stattype char(1);
  179. define v_smplsize float;
  180. define v_rolename varchar(32);
  181. -- First verify that the current user has select privileges on this column
  182. let is_allowed = 0;
  183. let search_columns = 0;
  184. if user = 'informix' then
  185. let is_allowed = 1;
  186. else
  187. -- Check sysusers to see if the usertype is 'D', ie., the
  188. -- current user has dba privileges and may see any columns.
  189. select usertype
  190. into v_mode
  191. from informix.sysusers
  192. where username = user;
  193. if v_mode = 'D' then
  194. let is_allowed = 1;
  195. else
  196. -- See if the user owns the table, and therefore can see the columns.
  197. select owner
  198. into v_owner
  199. from informix.systables
  200. where tabid = table_id;
  201. if v_owner = user then
  202. let is_allowed = 1;
  203. end if
  204. end if
  205. end if
  206. if is_allowed = 0 then
  207. foreach
  208. select tabauth
  209. into v_tabauth
  210. from informix.systabauth
  211. where tabid = table_id and
  212. (grantee = user or
  213. grantee = 'public')
  214. if substr(v_tabauth, 1, 1) = 's' or substr(v_tabauth, 1, 1) = 'S' then
  215. let is_allowed = 1;
  216. exit foreach;
  217. elif substr(v_tabauth, 3, 1) = '*' then
  218. let search_columns = 1;
  219. end if
  220. end foreach
  221. end if
  222. -- Search syscolauth only if user does not have select
  223. -- privileges on all columns. If the user has no select
  224. -- privileges on any column, then we need search no further.
  225. if is_allowed = 0 and search_columns = 1 then
  226. foreach
  227. select colauth
  228. into v_colauth
  229. from informix.syscolauth
  230. where tabid = table_id and
  231. colno = column_no and
  232. (grantee = user or
  233. grantee = 'public')
  234. if substr(v_colauth, 1, 1) = 's' or substr(v_colauth, 1, 1) = 'S' then
  235. let is_allowed = 1;
  236. exit foreach;
  237. end if
  238. end foreach
  239. end if
  240. -- Check user's current role for privileges on table and columns
  241. if is_allowed = 0 then
  242. select CURRENT_ROLE
  243. into v_rolename
  244. from informix.systables
  245. where tabid = 1;
  246. if v_rolename is NOT NULL then
  247. -- Check if user's current role has select privilege on table,
  248. -- and hence can see the columns
  249. foreach
  250. select tabauth
  251. into v_tabauth
  252. from informix.systabauth
  253. where tabid = table_id and
  254. grantee = v_rolename
  255. if substr(v_tabauth, 1, 1) = 's' or
  256. substr(v_tabauth, 1, 1) = 'S' then
  257. let is_allowed = 1;
  258. exit foreach;
  259. elif substr(v_tabauth, 3, 1) = '*' then
  260. let search_columns = 1;
  261. end if
  262. end foreach
  263. -- Search syscolauth only if user's current role does not have select
  264. -- privileges on all columns. If the user's current role has no select
  265. -- privileges on any column, then we need search no further.
  266. if is_allowed = 0 and search_columns = 1 then
  267. foreach
  268. select colauth
  269. into v_colauth
  270. from informix.syscolauth
  271. where tabid = table_id and
  272. colno = column_no and
  273. grantee = v_rolename
  274. if substr(v_colauth, 1, 1) = 's' or
  275. substr(v_colauth, 1, 1) = 'S' then
  276. let is_allowed = 1;
  277. exit foreach;
  278. end if
  279. end foreach
  280. end if
  281. end if
  282. end if
  283. -- Return with no rows found if not allowed to select from
  284. -- the column designated by (tabid,colno).
  285. if is_allowed = 0 then
  286. raise exception -272;
  287. end if
  288. -- Now find the distribution rows
  289. foreach
  290. select seqno, constr_time, mode,
  291. resolution, confidence, smplsize, encdat, type
  292. into v_seqno, v_constr_time, v_mode,
  293. v_resolution, v_confidence, v_smplsize, v_encdat, v_stattype
  294. from informix.sysdistrib
  295. where tabid = table_id and
  296. colno = column_no
  297. order by seqno
  298. return v_seqno, v_constr_time, v_mode,
  299. v_resolution, v_confidence, v_smplsize, v_encdat, v_stattype
  300. with resume;
  301. end foreach
  302. -- Engine will return 100 to user
  303. end procedure;
  304. grant execute on informix.systdist to public as informix;
  305. { ********************** LBAC types, casts, functions *********************** }
  306. { Distinct types for LBAC }
  307. create distinct type informix.IDSSECURITYLABEL as varchar(128);
  308. create distinct type informix.IDSELEMENTENC as char(8);
  309. create distinct type informix.IDSCOVERINGINFO as varchar(128);
  310. { Drop the explicit casts created for the LBAC distinct types }
  311. drop cast (informix.IDSSECURITYLABEL as varchar(128));
  312. drop cast (varchar(128) as informix.IDSSECURITYLABEL);
  313. drop cast (informix.IDSELEMENTENC as char(8));
  314. drop cast (char(8) as informix.IDSELEMENTENC);
  315. drop cast (informix.IDSCOVERINGINFO as varchar(128));
  316. drop cast (varchar(128) as informix.IDSCOVERINGINFO);
  317. { Create the implicit casts for the LBAC distinct types }
  318. create function informix.SeclabelInput(informix.lvarchar)
  319. returns informix.IDSSECURITYLABEL
  320. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  321. external name '(seclabel_in)'
  322. language C;
  323. grant execute on function informix.SeclabelInput(informix.lvarchar)
  324. to public as informix;
  325. create implicit cast(informix.lvarchar as informix.IDSSECURITYLABEL
  326. with informix.SeclabelInput);
  327. create function informix.SeclabelOutput(informix.IDSSECURITYLABEL)
  328. returns informix.lvarchar
  329. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  330. external name '(seclabel_out)'
  331. language C;
  332. grant execute on function informix.SeclabelOutput(informix.IDSSECURITYLABEL)
  333. to public as informix;
  334. create implicit cast(informix.IDSSECURITYLABEL as informix.lvarchar
  335. with informix.SeclabelOutput);
  336. create function informix.ElementencInput(informix.lvarchar)
  337. returns informix.IDSELEMENTENC
  338. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  339. external name '(elementenc_in)'
  340. language C;
  341. grant execute on function informix.ElementencInput(informix.lvarchar)
  342. to public as informix;
  343. create implicit cast(informix.lvarchar as informix.IDSELEMENTENC
  344. with informix.ElementencInput);
  345. create function informix.ElementencOutput(informix.IDSELEMENTENC)
  346. returns informix.lvarchar
  347. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  348. external name '(elementenc_out)'
  349. language C;
  350. grant execute on function informix.ElementencOutput(informix.IDSELEMENTENC)
  351. to public as informix;
  352. create implicit cast(informix.IDSELEMENTENC as informix.lvarchar
  353. with informix.ElementencOutput);
  354. create function informix.CoveringinfoInput(informix.lvarchar)
  355. returns informix.IDSCOVERINGINFO
  356. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  357. external name '(coveringinfo_in)'
  358. language C;
  359. grant execute on function informix.CoveringinfoInput(informix.lvarchar)
  360. to public as informix;
  361. create implicit cast(informix.lvarchar as informix.IDSCOVERINGINFO
  362. with informix.CoveringinfoInput);
  363. create function informix.CoveringinfoOutput(informix.IDSCOVERINGINFO)
  364. returns informix.lvarchar
  365. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  366. external name '(coveringinfo_out)'
  367. language C;
  368. grant execute on function informix.CoveringinfoOutput(informix.IDSCOVERINGINFO)
  369. to public as informix;
  370. create implicit cast(informix.IDSCOVERINGINFO as informix.lvarchar
  371. with informix.CoveringinfoOutput);
  372. { LBAC SQL function SECLABEL_BY_COMP }
  373. create function informix.SECLABEL_BY_COMP(informix.lvarchar,
  374. informix.lvarchar)
  375. returns informix.IDSSECURITYLABEL
  376. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  377. external name '(ifx_seclabel_by_comp)'
  378. language C;
  379. grant execute on function informix.SECLABEL_BY_COMP(informix.lvarchar,
  380. informix.lvarchar) to public as informix;
  381. { LBAC SQL function SECLABEL_BY_NAME }
  382. create function informix.SECLABEL_BY_NAME(informix.lvarchar,
  383. informix.lvarchar)
  384. returns informix.IDSSECURITYLABEL
  385. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  386. external name '(ifx_seclabel_by_name)'
  387. language C;
  388. grant execute on function informix.SECLABEL_BY_NAME(informix.lvarchar,
  389. informix.lvarchar) to public as informix;
  390. { LBAC SQL function SECLABEL_TO_CHAR }
  391. create function informix.SECLABEL_TO_CHAR(informix.lvarchar,
  392. informix.IDSSECURITYLABEL)
  393. returns informix.lvarchar
  394. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  395. external name '(ifx_seclabel_to_char)'
  396. language C;
  397. grant execute on function informix.SECLABEL_TO_CHAR(informix.lvarchar,
  398. informix.IDSSECURITYLABEL) to public as informix;
  399. { LBAC SQL function ELEMENTENC_TO_DECIMAL }
  400. create function informix.ELEMENTENC_TO_DECIMAL(informix.IDSELEMENTENC)
  401. returns informix.decimal
  402. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE)
  403. external name '(ifx_elementenc_to_decimal)'
  404. language C;
  405. grant execute on function informix.ELEMENTENC_TO_DECIMAL(informix.IDSELEMENTENC)
  406. to public as informix;
  407. { *************************************************************************** }
  408. create dba function informix.extract(informix.lvarchar,informix.lvarchar)
  409. returns informix.lvarchar(32739)
  410. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  411. PERCALL_COST = 32768 )
  412. external name '$INFORMIXDIR/lib/libxml.udr(xmlextract)'
  413. language C;
  414. grant execute on function informix.extract(informix.lvarchar,informix.lvarchar)
  415. to public as informix;
  416. create dba function informix.extract(informix.clob,informix.lvarchar)
  417. returns informix.lvarchar(32739)
  418. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  419. PERCALL_COST = 32768 )
  420. external name '$INFORMIXDIR/lib/libxml.udr(xmlextractinputclob)'
  421. language C;
  422. grant execute on function informix.extract(informix.clob,informix.lvarchar)
  423. to public as informix;
  424. create dba function informix.extractclob(informix.clob,informix.lvarchar)
  425. returns informix.clob
  426. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  427. PERCALL_COST = 32768 )
  428. external name '$INFORMIXDIR/lib/libxml.udr(xmlextractclob)'
  429. language C;
  430. grant execute on function informix.extractclob(informix.clob,informix.lvarchar)
  431. to public as informix;
  432. create dba function informix.extractvalue(informix.lvarchar,informix.lvarchar)
  433. returns informix.lvarchar(32739)
  434. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  435. PERCALL_COST = 32768 )
  436. external name '$INFORMIXDIR/lib/libxml.udr(xmlextractvalue)'
  437. language C;
  438. grant execute on function informix.extractvalue(informix.lvarchar,informix.lvarchar)
  439. to public as informix;
  440. create dba function informix.extractvalue(informix.clob,informix.lvarchar)
  441. returns informix.lvarchar(32739)
  442. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  443. PERCALL_COST = 32768 )
  444. external name '$INFORMIXDIR/lib/libxml.udr(xmlextractvalueinputclob)'
  445. language C;
  446. grant execute on function informix.extractvalue(informix.clob,informix.lvarchar)
  447. to public as informix;
  448. create dba function informix.existsnode(informix.lvarchar,informix.lvarchar)
  449. returns informix.integer
  450. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  451. PERCALL_COST = 32768 )
  452. external name '$INFORMIXDIR/lib/libxml.udr(xmlexistnode)'
  453. language C;
  454. grant execute on function informix.existsnode(informix.lvarchar,informix.lvarchar)
  455. to public as informix;
  456. create dba function informix.existsnode(informix.clob,informix.lvarchar)
  457. returns informix.integer
  458. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  459. PERCALL_COST = 32768 )
  460. external name '$INFORMIXDIR/lib/libxml.udr(xmlexistnodeinputclob)'
  461. language C;
  462. grant execute on function informix.existsnode(informix.clob,informix.lvarchar)
  463. to public as informix;
  464. create dba function informix.idsxmlparse(informix.lvarchar)
  465. returns informix.lvarchar(32739)
  466. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  467. PERCALL_COST = 32768 )
  468. external name '$INFORMIXDIR/lib/libxml.udr(xmlparse)'
  469. language C;
  470. grant execute on function informix.idsxmlparse(informix.lvarchar)
  471. to public as informix;
  472. create dba function informix.idsxmlparse(informix.clob)
  473. returns informix.clob
  474. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  475. PERCALL_COST = 32768 )
  476. external name '$INFORMIXDIR/lib/libxml.udr(xmlparseclob)'
  477. language C;
  478. grant execute on function informix.idsxmlparse(informix.clob)
  479. to public as informix;
  480. create dba function informix.extractvalueclob(informix.clob,informix.lvarchar)
  481. returns informix.clob
  482. with (NOT VARIANT, HANDLESNULLS, PARALLELIZABLE, CLASS = 'idsxmlvp',
  483. PERCALL_COST = 32768 )
  484. external name '$INFORMIXDIR/lib/libxml.udr(xmlextractvalueclob)'
  485. language C;
  486. grant execute on function informix.extractvalueclob(informix.clob,informix.lvarchar)
  487. to public as informix;
  488. create AGGREGATE informix.genxml
  489. with (
  490. INIT = init_aggrxml,
  491. ITER = iter_aggrxml,
  492. COMBINE = comb_aggrxml,
  493. FINAL = final_aggrxml,
  494. HANDLESNULLS
  495. );
  496. create dba function informix.init_aggrxml(informix.ROW, informix.lvarchar)
  497. returns informix.pointer
  498. external name '(init_aggrxml)'
  499. language C;
  500. grant execute on function informix.init_aggrxml(informix.ROW, informix.lvarchar) to public as informix;
  501. alter function informix.init_aggrxml (informix.ROW, informix.lvarchar)
  502. with (add handlesnulls);
  503. create dba function informix.iter_aggrxml(informix.pointer, informix.ROW)
  504. returns informix.pointer
  505. external name '(iter_aggrxml)'
  506. language C;
  507. grant execute on function informix.iter_aggrxml(informix.pointer, informix.ROW)
  508. to public as informix;
  509. alter function informix.iter_aggrxml (informix.pointer, informix.ROW)
  510. with (add handlesnulls);
  511. create dba function informix.comb_aggrxml(informix.pointer,informix.pointer)
  512. returns informix.pointer
  513. external name '(comb_aggrxml)'
  514. language C;
  515. grant execute on function informix.comb_aggrxml(informix.pointer,informix.pointer)
  516. to public as informix;
  517. alter function informix.comb_aggrxml (informix.pointer,informix.pointer)
  518. with (add handlesnulls);
  519. create dba function informix.final_aggrxml(informix.pointer)
  520. returns informix.lvarchar(32739)
  521. external name '(final_aggrxml)'
  522. language C;
  523. grant execute on function informix.final_aggrxml(informix.pointer)
  524. to public as informix;
  525. alter function informix.final_aggrxml (informix.pointer)
  526. with (add handlesnulls);
  527. create AGGREGATE informix.genxmlelem
  528. with (
  529. INIT = init_aggrelem,
  530. ITER = iter_aggrelem,
  531. COMBINE = comb_aggrelem,
  532. FINAL = final_aggrelem,
  533. HANDLESNULLS
  534. );
  535. create dba function informix.init_aggrelem(informix.ROW, informix.lvarchar)
  536. returns informix.pointer
  537. external name '(init_aggrelem)'
  538. language C;
  539. grant execute on function informix.init_aggrelem(informix.ROW, informix.lvarchar)
  540. to public as informix;
  541. alter function informix.init_aggrelem (informix.ROW, informix.lvarchar)
  542. with (add handlesnulls);
  543. create dba function informix.iter_aggrelem(informix.pointer, informix.ROW)
  544. returns informix.pointer
  545. external name '(iter_aggrelem)'
  546. language C;
  547. grant execute on function informix.iter_aggrelem(informix.pointer, informix.ROW)
  548. to public as informix;
  549. alter function informix.iter_aggrelem (informix.pointer, informix.ROW)
  550. with (add handlesnulls);
  551. create dba function informix.comb_aggrelem(informix.pointer,informix.pointer)
  552. returns informix.pointer
  553. external name '(comb_aggrelem)'
  554. language C;
  555. grant execute on function informix.comb_aggrelem(informix.pointer,informix.pointer)
  556. to public as informix;
  557. alter function informix.comb_aggrelem (informix.pointer,informix.pointer)
  558. with (add handlesnulls);
  559. create dba function informix.final_aggrelem(informix.pointer)
  560. returns informix.lvarchar(32739)
  561. external name '(final_aggrelem)'
  562. language C;
  563. grant execute on function informix.final_aggrelem(informix.pointer)
  564. to public as informix;
  565. alter function informix.final_aggrelem (informix.pointer)
  566. with (add handlesnulls);
  567. create AGGREGATE informix.genxmlschema
  568. with (
  569. INIT = init_aggrschema,
  570. ITER = iter_aggrschema,
  571. COMBINE = comb_aggrschema,
  572. FINAL = final_aggrschema,
  573. HANDLESNULLS
  574. );
  575. create dba function informix.init_aggrschema(informix.ROW, informix.lvarchar)
  576. returns informix.pointer
  577. external name '(init_aggrschema)'
  578. language C;
  579. grant execute on function informix.init_aggrschema(informix.ROW, informix.lvarchar)
  580. to public as informix;
  581. alter function informix.init_aggrschema (informix.ROW, informix.lvarchar)
  582. with (add handlesnulls);
  583. create dba function informix.iter_aggrschema(informix.pointer, informix.ROW)
  584. returns informix.pointer
  585. external name '(iter_aggrschema)'
  586. language C;
  587. grant execute on function informix.iter_aggrschema(informix.pointer, informix.ROW)
  588. to public as informix;
  589. alter function informix.iter_aggrschema (informix.pointer, informix.ROW)
  590. with (add handlesnulls);
  591. create dba function informix.comb_aggrschema(informix.pointer,informix.pointer)
  592. returns informix.pointer
  593. external name '(comb_aggrschema)'
  594. language C;
  595. grant execute on function informix.comb_aggrschema(informix.pointer,informix.pointer)
  596. to public as informix;
  597. alter function informix.comb_aggrschema (informix.pointer,informix.pointer)
  598. with (add handlesnulls);
  599. create dba function informix.final_aggrschema(informix.pointer)
  600. returns informix.lvarchar(32739)
  601. external name '(final_aggrschema)'
  602. language C;
  603. grant execute on function informix.final_aggrschema(informix.pointer)
  604. to public as informix;
  605. alter function informix.final_aggrschema (informix.pointer)
  606. with (add handlesnulls);
  607. create dba function informix.genxmlqueryhdr(informix.LVARCHAR, informix.LVARCHAR)
  608. returns informix.lvarchar(32739)
  609. with(NOT VARIANT)
  610. external name '(genxmlqueryhdr)'
  611. language C;
  612. grant execute on function informix.genxmlqueryhdr(informix.LVARCHAR, informix.LVARCHAR)
  613. to public as informix;
  614. create dba function informix.genxmlquery(informix.LVARCHAR, informix.lvarchar)
  615. returns informix.lvarchar(32739)
  616. with(NOT VARIANT)
  617. external name '(genxmlquery)'
  618. language C;
  619. grant execute on function informix.genxmlquery(informix.LVARCHAR, informix.lvarchar)
  620. to public as informix;
  621. create AGGREGATE informix.genxmlclob
  622. with (
  623. INIT = init_aggrxmlc,
  624. ITER = iter_aggrxmlc,
  625. COMBINE = comb_aggrxmlc,
  626. FINAL = final_aggrxmlc,
  627. HANDLESNULLS
  628. );
  629. create dba function informix.init_aggrxmlc(informix.ROW, informix.lvarchar)
  630. returns informix.pointer
  631. external name '(init_aggrxmlc)'
  632. language C;
  633. grant execute on function informix.init_aggrxmlc(informix.ROW, informix.lvarchar) to public as informix;
  634. alter function informix.init_aggrxmlc (informix.ROW, informix.lvarchar)
  635. with (add handlesnulls);
  636. create dba function informix.iter_aggrxmlc(informix.pointer, informix.ROW)
  637. returns informix.pointer
  638. external name '(iter_aggrxmlc)'
  639. language C;
  640. grant execute on function informix.iter_aggrxmlc(informix.pointer, informix.ROW)
  641. to public as informix;
  642. alter function informix.iter_aggrxmlc (informix.pointer, informix.ROW)
  643. with (add handlesnulls);
  644. create dba function informix.comb_aggrxmlc(informix.pointer,informix.pointer)
  645. returns informix.pointer
  646. external name '(comb_aggrxmlc)'
  647. language C;
  648. grant execute on function informix.comb_aggrxmlc(informix.pointer,informix.pointer)
  649. to public as informix;
  650. alter function informix.comb_aggrxmlc (informix.pointer,informix.pointer)
  651. with (add handlesnulls);
  652. create dba function informix.final_aggrxmlc(informix.pointer)
  653. returns informix.clob
  654. external name '(final_aggrxmlc)'
  655. language C;
  656. grant execute on function informix.final_aggrxmlc(informix.pointer)
  657. to public as informix;
  658. alter function informix.final_aggrxmlc (informix.pointer)
  659. with (add handlesnulls);
  660. create AGGREGATE informix.genxmlelemclob
  661. with (
  662. INIT = init_aggrelemc,
  663. ITER = iter_aggrelemc,
  664. COMBINE = comb_aggrelemc,
  665. FINAL = final_aggrelemc,
  666. HANDLESNULLS
  667. );
  668. create dba function informix.init_aggrelemc(informix.ROW, informix.lvarchar)
  669. returns informix.pointer
  670. external name '(init_aggrelemc)'
  671. language C;
  672. grant execute on function informix.init_aggrelemc(informix.ROW, informix.lvarchar) to public as informix;
  673. alter function informix.init_aggrelemc (informix.ROW, informix.lvarchar)
  674. with (add handlesnulls);
  675. create dba function informix.iter_aggrelemc(informix.pointer, informix.ROW)
  676. returns informix.pointer
  677. external name '(iter_aggrelemc)'
  678. language C;
  679. grant execute on function informix.iter_aggrelemc(informix.pointer, informix.ROW)
  680. to public as informix;
  681. alter function informix.iter_aggrelemc (informix.pointer, informix.ROW)
  682. with (add handlesnulls);
  683. create dba function informix.comb_aggrelemc(informix.pointer,informix.pointer)
  684. returns informix.pointer
  685. external name '(comb_aggrelemc)'
  686. language C;
  687. grant execute on function informix.comb_aggrelemc(informix.pointer,informix.pointer)
  688. to public as informix;
  689. alter function informix.comb_aggrelemc (informix.pointer,informix.pointer)
  690. with (add handlesnulls);
  691. create dba function informix.final_aggrelemc(informix.pointer)
  692. returns informix.clob
  693. external name '(final_aggrelemc)'
  694. language C;
  695. grant execute on function informix.final_aggrelemc(informix.pointer)
  696. to public as informix;
  697. alter function informix.final_aggrelemc (informix.pointer)
  698. with (add handlesnulls);
  699. create AGGREGATE informix.genxmlschemaclob
  700. with (
  701. INIT = init_aggrschemac,
  702. ITER = iter_aggrschemac,
  703. COMBINE = comb_aggrschemac,
  704. FINAL = final_aggrschemac,
  705. HANDLESNULLS
  706. );
  707. create dba function informix.init_aggrschemac(informix.ROW, informix.lvarchar)
  708. returns informix.pointer
  709. external name '(init_aggrschemac)'
  710. language C;
  711. grant execute on function informix.init_aggrschemac(informix.ROW, informix.lvarchar) to public as informix;
  712. alter function informix.init_aggrschemac (informix.ROW, informix.lvarchar)
  713. with (add handlesnulls);
  714. create dba function informix.iter_aggrschemac(informix.pointer, informix.ROW)
  715. returns informix.pointer
  716. external name '(iter_aggrschemac)'
  717. language C;
  718. grant execute on function informix.iter_aggrschemac(informix.pointer, informix.ROW)
  719. to public as informix;
  720. alter function informix.iter_aggrschemac (informix.pointer, informix.ROW)
  721. with (add handlesnulls);
  722. create dba function informix.comb_aggrschemac(informix.pointer,informix.pointer)
  723. returns informix.pointer
  724. external name '(comb_aggrschemac)'
  725. language C;
  726. grant execute on function informix.comb_aggrschemac(informix.pointer,informix.pointer)
  727. to public as informix;
  728. alter function informix.comb_aggrschemac (informix.pointer,informix.pointer)
  729. with (add handlesnulls);
  730. create dba function informix.final_aggrschemac(informix.pointer)
  731. returns informix.clob
  732. external name '(final_aggrschemac)'
  733. language C;
  734. grant execute on function informix.final_aggrschemac(informix.pointer)
  735. to public as informix;
  736. alter function informix.final_aggrschemac (informix.pointer)
  737. with (add handlesnulls);
  738. create dba function informix.genxmlqueryhdrclob(informix.LVARCHAR, informix.LVARCHAR)
  739. returns informix.clob
  740. with(NOT VARIANT)
  741. external name '(genxmlqueryhdrclob)'
  742. language C;
  743. grant execute on function informix.genxmlqueryhdrclob(informix.LVARCHAR, informix.LVARCHAR)
  744. to public as informix;
  745. create dba function informix.genxmlqueryclob(informix.LVARCHAR, informix.LVARCHAR)
  746. returns informix.clob
  747. with(NOT VARIANT)
  748. external name '(genxmlqueryclob)'
  749. language C;
  750. grant execute on function informix.genxmlqueryclob(informix.LVARCHAR, informix.LVARCHAR)
  751. to public as informix;
  752. {Changing the cast from explicit to implicit for bytetoblob and texttoclob routines. defect#134359}
  753. drop cast (byte as blob);
  754. create implicit cast (byte as informix.blob with informix.bytetoblob);
  755. drop cast (text as clob);
  756. create implicit cast (text as informix.clob with informix.texttoclob);