sysbldinit.sql 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. { This file is the bootstrap file for DataBlade module management. }
  2. { It is properly executed by issuing the following SQL command: }
  3. { }
  4. { create function SYSBldPrepare (CHAR(18)) returns integer }
  5. { external name '$INFORMIXDIR/extend/'%SYSBLDNAME%'/ifxmngr.bld(SYSBldPrepare)' language c; }
  6. { }
  7. { execute function SYSBldInit('sysblderrorlog'); -- or SYSBldPrepare('') will use default table. }
  8. { }
  9. { 'sysblderrorlog' is an error output table. The return value is 0 for success, }
  10. { and -1 for a fatal error (note that most SQL errors should be ignored). }
  11. { }
  12. { Note that this is called automatically every time BladeManager }
  13. { connects to a database. Many of the commands fail the second time, }
  14. { but the errors are correctly ignored by BladeManager. }
  15. -- Start by clearing out log table.
  16. delete from %SYSBLDERRORLOG% where bld_id = '%SYSBLDNAME%';
  17. -- This creates the trace entry for BladeManager error reporting.
  18. insert into informix.systraceclasses(name) select 'blademgr' from systables where tabid = 1 and (not exists (select * from informix.systraceclasses where name = 'blademgr'));
  19. -- Create our custom type SYSBldSQLText for use in our sysbldobjects table.
  20. create opaque type if not exists SYSBldSQLText(
  21. internallength = variable,
  22. maxlen = 24000,
  23. alignment = 1
  24. );
  25. grant usage on type SYSBldSQLText to public;
  26. create function if not exists SYSBldSQLTextIn (lvarchar)
  27. returns SYSBldSQLText
  28. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSQLTextIn)'
  29. language c;
  30. grant execute on function SYSBldSQLTextIn (lvarchar) to public;
  31. create implicit cast if not exists
  32. (
  33. lvarchar as SYSBldSQLText
  34. with SYSBldSQLTextIn
  35. );
  36. create function if not exists SYSBldSQLTextOut (SYSBldSQLText)
  37. returns lvarchar
  38. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSQLTextIn)'
  39. language c;
  40. grant execute on function SYSBldSQLTextOut (SYSBldSQLText) to public;
  41. create cast if not exists
  42. (
  43. SYSBldSQLText as lvarchar
  44. with SYSBldSQLTextOut
  45. );
  46. create function if not exists SYSBldSQLTextSend (SYSBldSQLText)
  47. returns sendrecv
  48. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSQLTextOut)'
  49. language c;
  50. grant execute on function SYSBldSQLTextSend (SYSBldSQLText) to public;
  51. create cast if not exists
  52. (
  53. SYSBldSQLText as sendrecv
  54. with SYSBldSQLTextSend
  55. );
  56. create function if not exists SYSBldSQLTextRecv (sendrecv)
  57. returns SYSBldSQLText
  58. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSQLTextIn)'
  59. language c;
  60. grant execute on function SYSBldSQLTextRecv (sendrecv) to public;
  61. create implicit cast if not exists
  62. (
  63. sendrecv as SYSBldSQLText
  64. with SYSBldSQLTextRecv
  65. );
  66. create function if not exists SYSBldSQLTextImpT (impexp)
  67. returns SYSBldSQLText
  68. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSQLTextIn)'
  69. language c;
  70. grant execute on function SYSBldSQLTextImpT (impexp) to public;
  71. create implicit cast if not exists
  72. (
  73. impexp as SYSBldSQLText
  74. with SYSBldSQLTextImpT
  75. );
  76. create function if not exists SYSBldSQLTextExpT (SYSBldSQLText)
  77. returns impexp
  78. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSQLTextOut)'
  79. language c;
  80. grant execute on function SYSBldSQLTextExpT (SYSBldSQLText) to public;
  81. create cast if not exists
  82. (
  83. SYSBldSQLText as impexp
  84. with SYSBldSQLTextExpT
  85. );
  86. create function if not exists SYSBldSQLTextImpB (impexpbin)
  87. returns SYSBldSQLText
  88. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSQLTextIn)'
  89. language c;
  90. grant execute on function SYSBldSQLTextImpB (impexpbin) to public;
  91. create implicit cast if not exists
  92. (
  93. impexpbin as SYSBldSQLText
  94. with SYSBldSQLTextImpB
  95. );
  96. create function if not exists SYSBldSQLTextExpB (SYSBldSQLText)
  97. returns impexpbin
  98. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSQLTextOut)'
  99. language c;
  100. grant execute on function SYSBldSQLTextExpB (SYSBldSQLText) to public;
  101. create cast if not exists
  102. (
  103. SYSBldSQLText as impexpbin
  104. with SYSBldSQLTextExpB
  105. );
  106. create function if not exists Equal (SYSBldSQLText,SYSBldSQLText)
  107. returns boolean
  108. external name '$INFORMIXDIR/extend/%SYSBLDNAME%/ifxmngr.bld(SYSBldSQLTextEqual)'
  109. language c;
  110. grant execute on function Equal (SYSBldSQLText,SYSBldSQLText) to public;
  111. create function if not exists SysBldLike (SYSBldSQLText,SYSBldSQLText)
  112. returns boolean
  113. external name '$INFORMIXDIR/extend/%SYSBLDNAME%/ifxmngr.bld(SYSBldSQLTextLike)'
  114. language c;
  115. grant execute on function SysBldLike (SYSBldSQLText,SYSBldSQLText) to public;
  116. -- This table contains the list of available DataBlade modules.
  117. create temp table sysbldmodules
  118. (bld_id CHAR(64) not null primary key,
  119. bld_server_type CHAR(32),
  120. bld_inst_state SMALLINT
  121. );
  122. -- This creates some entries for the locale, but these are not the only
  123. -- entries uesd.
  124. create temp table sysbldlocales
  125. (blocale_id CHAR(32) not null primary key
  126. );
  127. insert into sysbldlocales
  128. values ('en_us.8859-1');
  129. insert into sysbldlocales
  130. values ('en_us.819');
  131. insert into sysbldlocales
  132. values ('en_us.1252');
  133. insert into sysbldlocales
  134. values ('ja_jp.euc');
  135. insert into sysbldlocales
  136. values ('ja_jp.sjis');
  137. -- This lists the scripts registered by the DataBlade module.
  138. create temp table sysbldscripts
  139. (bld_id CHAR(64) not null,
  140. blocale_id CHAR(32) not null,
  141. bscr_type SMALLINT not null,
  142. bscr_sequence SMALLINT not null,
  143. bscr_sql_script CHAR(64) not null,
  144. bscr_old_bld CHAR(64),
  145. primary key (bld_id, blocale_id, bscr_type, bscr_sequence)
  146. );
  147. -- This lists the vendor who built the DataBlade module.
  148. create temp table sysbldvendors
  149. (bvendor_id CHAR(32) not null,
  150. bvendor_name CHAR(32) not null,
  151. blocale_id CHAR(32) not null,
  152. bvendor_format SMALLINT not null,
  153. bvendor_desc CHAR(255),
  154. primary key (bvendor_id, blocale_id, bvendor_format)
  155. );
  156. -- This is a description of the DataBlade module.
  157. create temp table sysblddescription
  158. (bld_id CHAR(64) not null,
  159. blocale_id CHAR(32) not null,
  160. bdesc_format SMALLINT not null,
  161. bvendor_id CHAR(32),
  162. bdesc_desc CHAR(255),
  163. bdesc_copyright CHAR(255),
  164. primary key (bld_id, blocale_id, bdesc_format)
  165. );
  166. -- This is a list of client files used by the DataBlade module.
  167. create temp table sysbldclientfiles
  168. (clntfile_id CHAR(192) not null primary key,
  169. clntfile_type SMALLINT not null,
  170. clntfile_name CHAR(128) not null,
  171. clntfile_path CHAR(128) not null,
  172. clntfile_icon_text CHAR(64));
  173. -- This is a list of known client operating systems, prep scripts may add more.
  174. create temp table sysbldclientos
  175. (clntos_id CHAR(32) not null unique,
  176. clntos_name CHAR(32) not null,
  177. clntos_ver CHAR(32) not null,
  178. clntos_arch CHAR(32) not null,
  179. primary key (clntos_id, clntos_ver, clntos_arch));
  180. insert into sysbldclientos
  181. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  182. values ('any/any/any', 'any', 'any', 'any');
  183. insert into sysbldclientos
  184. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  185. values ('NT/3.51/x86', 'WinNT', '3.51', 'INTEL');
  186. insert into sysbldclientos
  187. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  188. values ('NT/4.0/x86', 'WinNT', '4.0', 'INTEL');
  189. insert into sysbldclientos
  190. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  191. values ('Win95/4.0/x86', 'Win95', '4.0', 'INTEL');
  192. insert into sysbldclientos
  193. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  194. values ('solaris/2.5/sparc', 'solaris', '2.5', 'sparc');
  195. insert into sysbldclientos
  196. (clntos_id, clntos_name, clntos_ver,clntos_arch)
  197. values ('HPUX/10.01/hp','HPUX','10.01','hp');
  198. insert into sysbldclientos
  199. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  200. values ('IRIX32/6.2/mips', 'IRIX32', '6.2', 'mips');
  201. insert into sysbldclientos
  202. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  203. values ('PTX/4.4/Sequent', 'PTX', '4.4','Sequent');
  204. insert into sysbldclientos
  205. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  206. values ('SCO_SV/5.0.5/i386', 'SCO_SV', '5.0.5','i386');
  207. insert into sysbldclientos
  208. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  209. values ('SINIX/5.43/RM600','SINIX','5.43','RM600');
  210. insert into sysbldclientos
  211. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  212. values ('SINIX/5.44/RM600','SINIX','5.44','RM600');
  213. insert into sysbldclientos
  214. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  215. values ('AIX/4.2/ibmrs6000', 'AIX', '4.2', 'ibmrs6000');
  216. insert into sysbldclientos
  217. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  218. values ('MP-RAS/3.01/NCR', 'MP-RAS', '3.01', 'NCR');
  219. insert into sysbldclientos
  220. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  221. values ('HPUX/10.20/hp','HPUX','10.20','hp');
  222. insert into sysbldclientos
  223. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  224. values ('OSF1/4.0/decalpha', 'OSF1', '4.0', 'decalpha');
  225. insert into sysbldclientos
  226. (clntos_id, clntos_name, clntos_ver, clntos_arch)
  227. values ('dgux/4.11MU03/dgintel', 'dgux', '4.11MU03','dgintel');
  228. -- This table contains a temporary list of error files.
  229. create temp table sysblderrorfiles
  230. (bld_id CHAR(64) not null,
  231. error_file varchar(255));
  232. -- This is a relationship table between client files and the OS they run on.
  233. create temp table sysbldclientfileos
  234. (bld_id CHAR(64) not null,
  235. blocale_id CHAR(32) not null,
  236. clntos_id CHAR(32) not null,
  237. clntfile_id CHAR(192) not null,
  238. primary key (bld_id, blocale_id, clntos_id, clntfile_id));
  239. -- This is a list of interfaces available, or used by any DataBlade module.
  240. create temp table sysbldinterfaces
  241. (bldi_id CHAR(64) not null,
  242. bldi_name CHAR(64) not null,
  243. bldi_desc CHAR(255));
  244. -- This is a relationship table between a DataBlade module and an interface it provides.
  245. create temp table sysbldifacprovided
  246. (bldi_id CHAR(64) not null,
  247. bld_id CHAR(64) not null,
  248. primary key (bld_id, bldi_id));
  249. -- This is a relationship table between a DataBlade module and an interface it requires.
  250. create temp table sysbldifacrequired
  251. (bldi_id CHAR(64) not null,
  252. bld_id CHAR(64) not null,
  253. primary key (bld_id, bldi_id));
  254. -- This table lists possible upgrades between DataBlade modules. The second column
  255. -- stores a like clause for prefixs for DataBlades which a current module can upgrade.
  256. create temp table sysbldupgrades
  257. (bld_id CHAR(64) not null,
  258. bld_upgrade_like CHAR(64) not null);
  259. -- These are the public SQL routines which can be used to perform DataBlade registrations.
  260. -- All of these operations take CHAR(64) which is a DataBlade module name, or a CHAR(18)
  261. -- which is a table to output errors (must be of a format similar to sysblderrorlog).
  262. -- the return value of these functions is always 0 for success and -1 for failure.
  263. -- this must already be there since we are running this script.
  264. -- create function SYSBldPrepare(CHAR(18)) returns integer
  265. -- external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldPrepare)'
  266. -- language C not variant;
  267. -- note that upgrades and downgrades are automatically executed if appropriate.
  268. create function if not exists SYSBldPrepare() returns integer
  269. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldPrepare2)'
  270. language C variant;
  271. create function if not exists SYSBldRegister(CHAR(64), CHAR(18)) returns integer
  272. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldRegister)'
  273. language C variant;
  274. create function if not exists SYSBldRegister(CHAR(64)) returns integer
  275. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldRegister2)'
  276. language C variant;
  277. create function if not exists SYSBldUnregister(CHAR(64), CHAR(18)) returns integer
  278. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldUnregister)'
  279. language C variant;
  280. create function if not exists SYSBldUnregister(CHAR(64)) returns integer
  281. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldUnregister2)'
  282. language C variant;
  283. create function if not exists SYSBldTrace(CHAR(64), integer) returns integer
  284. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSetTraceFile)'
  285. language C variant;
  286. create function if not exists SYSBldTrace(integer) returns integer
  287. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldSetTraceFile2)'
  288. language C variant;
  289. create function if not exists SYSBldCleanupTables() returns integer
  290. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldCleanupTables)'
  291. language C variant;
  292. -- These are some routines which are called only by BladeManager
  293. create function if not exists SYSBldRelease() returns lvarchar
  294. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(MackRelease)'
  295. language C not variant;
  296. grant execute on function SYSBldRelease() to public;
  297. create function if not exists SYSBldGetSrvrFile(lvarchar, lvarchar) returns integer
  298. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(FetchSrvrFile)'
  299. language C variant;
  300. grant execute on function SYSBldGetSrvrFile(lvarchar, lvarchar) to public;
  301. create function if not exists SYSBldLstBldToPrep() returns lvarchar
  302. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(LstBldToPrep)'
  303. language C variant;
  304. grant execute on function SYSBldLstBldToPrep() to public;
  305. create function if not exists SYSBldPrepBlade(lvarchar) returns integer
  306. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(PrepBlade)'
  307. language C variant;
  308. grant execute on function SYSBldPrepBlade(lvarchar) to public;
  309. create function if not exists SYSBldTstSBSpace (lvarchar) returns integer
  310. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldTstSBSpace)'
  311. language c variant;
  312. grant execute on function SYSBldTstSBSpace(lvarchar) to public;
  313. create function if not exists SYSBldTstVP (lvarchar) returns integer
  314. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldTstVP)'
  315. language c variant;
  316. grant execute on function SYSBldTstVP(lvarchar) to public;
  317. create function if not exists SYSBldUnPrepare() returns integer
  318. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldUnPrepare)'
  319. language C variant;
  320. grant execute on function SYSBldUnPrepare() to public;
  321. create function if not exists SYSBldAddBldDir(lvarchar, lvarchar) returns integer
  322. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldAddBldDir)'
  323. language C variant;
  324. grant execute on function SYSBldAddBldDir(lvarchar, lvarchar) to public;
  325. create function if not exists SYSBldPutSrvrFile(lvarchar, lvarchar) returns integer
  326. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldPutSrvrFile)'
  327. language C variant;
  328. grant execute on function SYSBldPutSrvrFile(lvarchar, lvarchar) to public;
  329. create function if not exists SYSBldGetAnySrvrFile(lvarchar, lvarchar) returns integer
  330. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldGetAnySrvrFile)'
  331. language C variant;
  332. grant execute on function SYSBldGetAnySrvrFile(lvarchar, lvarchar) to public;
  333. -- These are some routines which are called by DBDK Dependency Tools
  334. create function if not exists SYSBldHTMLTableize(lvarchar,lvarchar) returns integer
  335. external name '$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldHTMLTableize)' language c;
  336. grant execute on function SYSBldHTMLTableize (lvarchar,lvarchar) to public;
  337. create function if not exists SYSBldHTMLObjDependents(lvarchar,lvarchar) returns integer
  338. external name "$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldHTMLObjDependents)" language c;
  339. grant execute on function SYSBldHTMLObjDependents (lvarchar,lvarchar) to public;
  340. create function if not exists SYSBldHTMLObjDependencies(lvarchar,lvarchar) returns integer
  341. external name "$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldHTMLObjDependencies)" language c;
  342. grant execute on function SYSBldHTMLObjDependencies (lvarchar,lvarchar) to public;
  343. create function if not exists SYSBldHTMLBldDependencies(lvarchar,lvarchar) returns integer
  344. external name "$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldHTMLBldDependencies)" language c;
  345. grant execute on function SYSBldHTMLBldDependencies (lvarchar,lvarchar) to public;
  346. create function if not exists SYSBldHTMLBeginFile(lvarchar,lvarchar) returns integer
  347. external name "$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldHTMLBeginFile)" language c;
  348. grant execute on function SYSBldHTMLBeginFile (lvarchar,lvarchar) to public;
  349. create function if not exists SYSBldHTMLEndFile(lvarchar) returns integer
  350. external name "$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldHTMLEndFile)" language c;
  351. grant execute on function SYSBldHTMLEndFile (lvarchar) to public;
  352. create function if not exists SYSBldHTMLBldObjs(lvarchar,lvarchar) returns integer
  353. external name "$INFORMIXDIR/extend/%SYSBLDDIR%/ifxmngr.bld(SYSBldHTMLBldObjs)" language c;
  354. grant execute on function SYSBldHTMLBldObjs (lvarchar,lvarchar) to public;
  355. -- Create the "permanent" database tables, this fails if they are already there.
  356. create table if not exists sysbldobjects
  357. (create_order serial8, bld_id CHAR(64) not null,
  358. obj_kind integer default 0,
  359. obj_signature lvarchar not null,
  360. obj_owner CHAR(64) default 'informix',
  361. sequence integer default 0,
  362. create_sql SYSBldSQLText, create_can_fail boolean default 'f',
  363. drop_sql lvarchar, drop_can_fail boolean default 'f',
  364. alter_sql lvarchar, alter_can_fail boolean default 'f',
  365. state char default 'U',
  366. temp_state char default 'U',
  367. final_state char default 'U',
  368. metadata lvarchar,
  369. reserved1 varchar(255),
  370. reserved2 integer,
  371. reserved3 integer
  372. );
  373. create index if not exists sysbldobjindex on sysbldobjects (create_order);
  374. -- create object dependency table.
  375. create table if not exists sysbldobjdepends
  376. (bld_id CHAR(64) not null,
  377. obj_kind integer default 0,
  378. obj_signature lvarchar not null,
  379. obj_owner CHAR(64) default 'informix',
  380. need_obj_kind integer default 0,
  381. need_obj_signature lvarchar not null,
  382. need_obj_owner CHAR(64) default 'informix',
  383. state char default 'U',
  384. temp_state char default 'U',
  385. final_state char default 'U',
  386. reserved1 varchar(255),
  387. reserved2 integer,
  388. reserved3 integer
  389. );
  390. create table if not exists sysbldobjkinds
  391. (obj_kind integer not null primary key,
  392. description varchar (32),
  393. format varchar (64)
  394. );
  395. insert into sysbldobjkinds (obj_kind, description, format)
  396. select 0, 'unknown', '<any>'
  397. from systables
  398. where tabid = 1
  399. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 0));
  400. insert into sysbldobjkinds (obj_kind, description, format)
  401. select 1, 'error', '<code>-<locale>'
  402. from systables
  403. where tabid = 1
  404. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 1));
  405. insert into sysbldobjkinds (obj_kind, description, format)
  406. select 2, 'aggregate', '<name>(<type>)'
  407. from systables
  408. where tabid = 1
  409. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 2));
  410. insert into sysbldobjkinds (obj_kind, description, format)
  411. select 3, 'cast', '<from_type>-><to_type>'
  412. from systables
  413. where tabid = 1
  414. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 3));
  415. insert into sysbldobjkinds (obj_kind, description, format)
  416. select 4, 'operator', '<name>'
  417. from systables
  418. where tabid = 1
  419. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 4));
  420. insert into sysbldobjkinds (obj_kind, description, format)
  421. select 5, 'function', '<name> (<arg1>[, <arg2>] ... [, <arg20>])'
  422. from systables
  423. where tabid = 1
  424. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 5));
  425. insert into sysbldobjkinds (obj_kind, description, format)
  426. select 6, 'procedure', '<name> (<arg1>[, <arg2>] ... [, <arg20>])'
  427. from systables
  428. where tabid = 1
  429. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 6));
  430. insert into sysbldobjkinds (obj_kind, description, format)
  431. select 7, 'type', '<name>'
  432. from systables
  433. where tabid = 1
  434. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 7));
  435. insert into sysbldobjkinds (obj_kind, description, format)
  436. select 8, 'table', '<name>'
  437. from systables
  438. where tabid = 1
  439. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 8));
  440. insert into sysbldobjkinds (obj_kind, description, format)
  441. select 9, 'access method', '<name>'
  442. from systables
  443. where tabid = 1
  444. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 9));
  445. insert into sysbldobjkinds (obj_kind, description, format)
  446. select 10, 'DataBlade module', '<name>'
  447. from systables
  448. where tabid = 1
  449. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 10));
  450. insert into sysbldobjkinds (obj_kind, description, format)
  451. select 11, 'database', '<name>'
  452. from systables
  453. where tabid = 1
  454. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 11));
  455. insert into sysbldobjkinds (obj_kind, description, format)
  456. select 12, 'operator class', '<name>'
  457. from systables
  458. where tabid = 1
  459. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 12));
  460. insert into sysbldobjkinds (obj_kind, description, format)
  461. select 13, 'index', '<name>'
  462. from systables
  463. where tabid = 1
  464. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 13));
  465. insert into sysbldobjkinds (obj_kind, description, format)
  466. select 14, 'trigger', '<name>'
  467. from systables
  468. where tabid = 1
  469. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 14));
  470. insert into sysbldobjkinds (obj_kind, description, format)
  471. select 15, 'interface', '<name>'
  472. from systables
  473. where tabid = 1
  474. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 15));
  475. insert into sysbldobjkinds (obj_kind, description, format)
  476. select 16, 'script', '<file name>'
  477. from systables
  478. where tabid = 1
  479. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 16));
  480. insert into sysbldobjkinds (obj_kind, description, format)
  481. select 64, 'privilege', '<name>'
  482. from systables
  483. where tabid = 1
  484. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 64));
  485. insert into sysbldobjkinds (obj_kind, description, format)
  486. select 69, 'privilege-function', '<name> (<arg1>[, <arg2>] ... [, <arg20>])'
  487. from systables
  488. where tabid = 1
  489. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 69));
  490. insert into sysbldobjkinds (obj_kind, description, format)
  491. select 70, 'privilege-procedure', '<name> (<arg1>[, <arg2>] ... [, <arg20>])'
  492. from systables
  493. where tabid = 1
  494. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 70));
  495. insert into sysbldobjkinds (obj_kind, description, format)
  496. select 71, 'privilege-type', '<name>'
  497. from systables
  498. where tabid = 1
  499. and (not exists (select obj_kind from sysbldobjkinds where obj_kind = 71));
  500. create table if not exists sysbldregistered
  501. (bld_id CHAR(64) not null primary key);
  502. create table if not exists sysbldirequired
  503. (bldi_id CHAR(64) not null,
  504. bld_id CHAR(64) not null,
  505. primary key (bld_id, bldi_id));
  506. create table if not exists sysbldiprovided
  507. (bldi_id CHAR(64) not null primary key,
  508. bld_id CHAR(64) not null);
  509. -- Create old style tables, for backward compatability.
  510. create temp table bld_modules
  511. (bld_id CHAR(64) not null primary key,
  512. bld_server_type CHAR(32),
  513. bld_inst_state SMALLINT
  514. );
  515. create temp table bld_scripts
  516. (bld_id CHAR(64) not null,
  517. blocale_id CHAR(32) not null,
  518. bscr_type SMALLINT not null,
  519. bscr_sequence SMALLINT not null,
  520. bscr_sql_script CHAR(64) not null,
  521. bscr_old_bld CHAR(64),
  522. primary key (bld_id, blocale_id, bscr_type, bscr_sequence)
  523. );
  524. create temp table bld_vendors
  525. (bvendor_id CHAR(32) not null,
  526. bvendor_name CHAR(32) not null,
  527. blocale_id CHAR(32) not null,
  528. bvendor_format SMALLINT not null,
  529. bvendor_desc CHAR(255),
  530. primary key (bvendor_id, blocale_id, bvendor_format)
  531. );
  532. create temp table bld_desc
  533. (bld_id CHAR(64) not null,
  534. blocale_id CHAR(32) not null,
  535. bdesc_format SMALLINT not null,
  536. bvendor_id CHAR(32),
  537. bdesc_desc CHAR(255),
  538. bdesc_copyright CHAR(255),
  539. primary key (bld_id, blocale_id, bdesc_format)
  540. );
  541. create temp table client_files
  542. (clntfile_id CHAR(64) not null primary key,
  543. clntfile_type SMALLINT not null,
  544. clntfile_name CHAR(32) not null,
  545. clntfile_path CHAR(64) not null,
  546. clntfile_icon_text CHAR(64));
  547. create temp table clntfile_os_rel
  548. (bld_id CHAR(64) not null,
  549. blocale_id CHAR(32) not null,
  550. clntos_id CHAR(32) not null,
  551. clntfile_id CHAR(64) not null,
  552. primary key (bld_id, blocale_id, clntos_id, clntfile_id));
  553. create temp table bld_interfaces
  554. (bldi_id CHAR(64) not null,
  555. bldi_name CHAR(64) not null,
  556. bldi_desc CHAR(255));
  557. create temp table dbi_provided
  558. (bldi_id CHAR(64) not null,
  559. bld_id CHAR(64) not null,
  560. primary key (bld_id, bldi_id));
  561. create temp table dbi_required
  562. (bldi_id CHAR(64) not null,
  563. bld_id CHAR(64) not null,
  564. primary key (bld_id, bldi_id));