File: sql_code_uddi.c

package info (click to toggle)
virtuoso-opensource 6.1.6+dfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (3208 lines) | stat: -rw-r--r-- 107,528 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
/* This file is automatically generated by sql_to_c.awk */

#include "sqlnode.h"
#include "sqlfn.h"
#include "sqltype.h"

/* uddi.sql */

static const char *tbl0 = 
"create table UDDI..BUSINESS_ENTITY (\n"
"BE_BUSINESS_KEY		varchar,\n"
"BE_AUTHORIZED_NAME 	varchar,\n"
"BE_OPERATOR		varchar,\n"
"BE_NAME			varchar not null,\n"
"BE_CREATED		datetime,\n"
"BE_CHANGED		timestamp,\n"
"BE_OWNER		integer,\n"
"PRIMARY KEY (BE_BUSINESS_KEY)\n"
")\n";

static const char *tbl1 = 
"create table UDDI..BUSINESS_SERVICE (\n"
"BS_BUSINESS_KEY		varchar,\n"
"BS_SERVICE_KEY		varchar not null,\n"
"BS_NAME			varchar not null,\n"
"BS_CREATED		datetime,\n"
"BS_CHANGED		timestamp,\n"
"BS_OWNER		integer,\n"
"PRIMARY KEY (BS_SERVICE_KEY)\n"
")\n";

static const char *tbl2 = 
"create table UDDI..BINDING_TEMPLATE (\n"
"BT_BINDING_KEY		varchar,\n"
"BT_SERVICE_KEY		varchar,\n"
"BT_ACCESS_POINT		varchar,\n"
"BT_HOSTING_REDIRECTOR	varchar,\n"
"BT_URL_TYPE		varchar,\n"
"BT_CREATED		datetime,\n"
"BT_CHANGED		timestamp,\n"
"BT_OWNER		integer,\n"
"PRIMARY KEY (BT_BINDING_KEY)\n"
")\n";

static const char *tbl3 = 
"create table UDDI..TMODEL (\n"
"TM_TMODEL_KEY		varchar,\n"
"TM_AUTHORIZED_NAME      varchar,\n"
"TM_OPERATOR             varchar,\n"
"TM_NAME                 varchar,\n"
"TM_CREATED		datetime,\n"
"TM_CHANGED		timestamp,\n"
"TM_OWNER		integer,\n"
"primary key (TM_TMODEL_KEY)\n"
")\n";

static const char *tbl4 = 
"create table UDDI..DESCRIPTION (\n"
"UD_DESCRIPTION_KEY	varchar not null,\n"
"UD_DESC			varchar,\n"
"UD_LANG			varchar,\n"
"UD_PARENT_ID		varchar,\n"
"UD_TYPE			varchar\n"
")\n"
"create index DESC_PARENT on DESCRIPTION (UD_TYPE, UD_PARENT_ID)\n";

static const char *tbl5 = 
"create table UDDI..DISCOVERY_URL (\n"
"DU_DISCOVERY_KEY	varchar not null,\n"
"DU_PARENT_ID		varchar not null,\n"
"DU_PARENT_TYPE		varchar not null,\n"
"DU_URL			varchar,\n"
"DU_USE_TYPE		varchar\n"
")\n"
"create index DISCOVERY_URLS_PARENT on DISCOVERY_URL (DU_PARENT_TYPE, DU_PARENT_ID)\n";

static const char *tbl6 = 
"create table UDDI..ADDRESS_LINE (\n"
"AL_ADDRESS_KEY		varchar not null,\n"
"AL_PARENT_ID		varchar not null,\n"
"AL_PARENT_TYPE		varchar not null,\n"
"AL_USE_TYPE		varchar,\n"
"AL_SORT_CODE		varchar,\n"
"AL_LINE			varchar\n"
")\n"
"create index ADDR_LINE_PARENT on ADDRESS_LINE (AL_PARENT_TYPE, AL_PARENT_ID)\n";

static const char *tbl7 = 
"create table UDDI..CONTACTS (\n"
"CO_CONTACT_KEY		varchar,\n"
"CO_BUSINESS_ID		varchar not null,\n"
"CO_USE_TYPE		varchar,\n"
"CO_PERSONAL_NAME	varchar not NULL,\n"
"PRIMARY KEY (CO_CONTACT_KEY)\n"
")\n"
"create index IN_BUSINESS on CONTACTS (CO_BUSINESS_ID)\n";

static const char *tbl8 = 
"create table UDDI..EMAIL (\n"
"EM_EMAIL_KEY	varchar not null,\n"
"EM_CONTACT_KEY     varchar not null,\n"
"EM_ADDR            varchar,\n"
"EM_USE_TYPE        varchar\n"
")\n"
"create index IN_EMPARENT on EMAIL (EM_CONTACT_KEY)\n";

static const char *tbl9 = 
"create table UDDI..PHONE (\n"
"PH_PHONE_KEY	varchar not null,\n"
"PH_CONTACT_KEY     varchar not null,\n"
"PH_PHONE           varchar,\n"
"PH_USE_TYPE        varchar\n"
")\n"
"create index IN_PHPARENT on PHONE (PH_CONTACT_KEY)\n";

static const char *tbl10 = 
"create table UDDI..IDENTIFIER_BAG (\n"
"IB_IDENTIFIER_KEY	varchar not null,\n"
"IB_PARENT_ID		varchar not null,\n"
"IB_PARENT_TYPE		varchar not null,\n"
"IB_TMODEL_KEY_ID	varchar,\n"
"IB_KEY_NAME		varchar,\n"
"IB_KEY_VALUE		varchar\n"
")\n"
"create index IB_PARENT on IDENTIFIER_BAG (IB_PARENT_ID,IB_PARENT_TYPE)\n";

static const char *tbl11 = 
"create table UDDI..CATEGORY_BAG (\n"
"CB_CATEGORY_KEY		varchar not null,\n"
"CB_PARENT_ID		varchar not null,\n"
"CB_PARENT_TYPE		varchar not null,\n"
"CB_TMODEL_KEY_ID		varchar,\n"
"CB_KEY_NAME			varchar,\n"
"CB_KEY_VALUE		varchar\n"
")\n"
"create index CB_PARENT on CATEGORY_BAG (CB_PARENT_ID, CB_PARENT_TYPE)\n";

static const char *tbl12 = 
"create table UDDI..OVERVIEW_DOC (\n"
"OV_KEY				varchar,\n"
"OV_PARENT_ID			varchar not null,\n"
"OV_PARENT_TYPE			varchar not null,\n"
"OV_URL				varchar,\n"
"PRIMARY KEY (OV_KEY)\n"
")\n"
"create unique index PARENT_OVERVIEW_DOC on OVERVIEW_DOC (OV_PARENT_ID, OV_PARENT_TYPE)\n";

static const char *tbl13 = 
"create table UDDI..INSTANCE_DETAIL  (\n"
"ID_KEY  		varchar not null,\n"
"ID_BINDING_KEY   	varchar,\n"
"ID_TMODEL_KEY    	varchar,\n"
"ID_PARMS  		varchar,\n"
"primary key (ID_KEY)\n"
")\n"
"create index IN_IDPARENT on INSTANCE_DETAIL (ID_BINDING_KEY, ID_TMODEL_KEY)\n";

static const char *proc0 = 
"#line 276 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"LOAD_UDDI_TAXONOMY ()\n"
"{\n"
"\n"
"if (isstring (registry_get (\'UDDI_operator\')))\n"
"return;\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\', \'uddi-org:types\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid (), \'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\', \'tModel\', \'en\', \'UDDI Type Taxonomy\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'1\', \'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'1\', \'overviewDoc\', \'en\', \'Taxonomy used to categorize Service Descriptions.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'categorization\') ;\n"
"\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:4CD7E4BC-648B-426D-9936-443EAAC8AE23\', \'uddi-org:inquiry\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid (), \'UUID:4CD7E4BC-648B-426D-9936-443EAAC8AE23\', \'tModel\', \'en\', \'UDDI Inquiry API - Core Specification\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'2\', \'UUID:4CD7E4BC-648B-426D-9936-443EAAC8AE23\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'2\', \'overviewDoc\', \'en\', \'This tModel defines the inquiry API calls for interacting with the UDDI registry.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:4CD7E4BC-648B-426D-9936-443EAAC8AE23\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'specification\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:4CD7E4BC-648B-426D-9936-443EAAC8AE23\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'xmlSpec\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:4CD7E4BC-648B-426D-9936-443EAAC8AE23\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'soapSpec\') ;\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:64C756D1-3374-4E00-AE83-EE12E38FAE63\', \'uddi-org:publication\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'UUID:64C756D1-3374-4E00-AE83-EE12E38FAE63\', \'tModel\', \'en\', \'UDDI Publication API - Core Specification\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'3\', \'UUID:64C756D1-3374-4E00-AE83-EE12E38FAE63\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'3\', \'overviewDoc\', \'en\', \'This tModel defines the publication API calls for interacting with the UDDI registry.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:64C756D1-3374-4E00-AE83-EE12E38FAE63\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'specification\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:64C756D1-3374-4E00-AE83-EE12E38FAE63\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'xmlSpec\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:64C756D1-3374-4E00-AE83-EE12E38FAE63\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'soapSpec\') ;\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:3FB66FB7-5FC3-462F-A351-C140D9BD8304\', \'uddi-org:taxonomy\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'UUID:3FB66FB7-5FC3-462F-A351-C140D9BD8304\', \'tModel\', \'en\', \'UDDI Taxonomy API\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'4\', \'UUID:3FB66FB7-5FC3-462F-A351-C140D9BD8304\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'4\', \'overviewDoc\', \'en\', \'This tModel defines the taxonomy maintenance API calls for interacting with the UDDI registry.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:3FB66FB7-5FC3-462F-A351-C140D9BD8304\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'specification\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:3FB66FB7-5FC3-462F-A351-C140D9BD8304\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'xmlSpec\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:3FB66FB7-5FC3-462F-A351-C140D9BD8304\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'soapSpec\') ;\n"
"\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:DB77450D-9FA8-45D4-A7BC-04411D14E384\', \'unspsc-org:unspsc:3-1\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'UUID:DB77450D-9FA8-45D4-A7BC-04411D14E384\', \'tModel\', \'en\', \'Product Taxonomy: UNSPSC (Version 3.1)\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'5\',\'UUID:DB77450D-9FA8-45D4-A7BC-04411D14E384\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'5\', \'overviewDoc\', \'en\', \'This tModel defines the UNSPSC product taxonomy.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:DB77450D-9FA8-45D4-A7BC-04411D14E384\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'categorization\') ;\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2\', \'ntis-gov:naics:1997\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'UUID:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2\', \'tModel\', \'en\', \'Business Taxonomy: NAICS (1997 Release)\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'6\',\'UUID:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'6\', \'overviewDoc\', \'en\', \'This tModel defines the NAICS industry taxonomy.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'categorization\') ;\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:A035A07C-F362-44DD-8F95-E2B134BF43B4\', \'uddi-org:misc-taxonomy\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(),\'UUID:A035A07C-F362-44DD-8F95-E2B134BF43B4\', \'tModel\', \'en\', \'Other Taxonomy\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'7\',\'UUID:A035A07C-F362-44DD-8F95-E2B134BF43B4\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'7\', \'overviewDoc\', \'en\', \'This tModel defines an unidentified taxonomy.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:A035A07C-F362-44DD-8F95-E2B134BF43B4\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'categorization\') ;\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:8609C81E-EE1F-4D5A-B202-3EB13AD01823\', \'dnb-com:D-U-N-S\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'UUID:8609C81E-EE1F-4D5A-B202-3EB13AD01823\', \'tModel\', \'en\', \'Dun & Bradstreet D-U-N-S Number\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'8\', \'UUID:8609C81E-EE1F-4D5A-B202-3EB13AD01823\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid (), \'8\', \'overviewDoc\', \'en\', \'This tModel is used for the Dun & Bradstreet  D-U-N-S Number identifier.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:8609C81E-EE1F-4D5A-B202-3EB13AD01823\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'identifier\') ;\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:B1B1BAF5-2329-43E6-AE13-BA8E97195039\', \'thomasregister-com:supplierID\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'UUID:B1B1BAF5-2329-43E6-AE13-BA8E97195039\', \'tModel\', \'en\', \'Thomas Registry Suppliers\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'9\',\'UUID:B1B1BAF5-2329-43E6-AE13-BA8E97195039\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'9\', \'overviewDoc\', \'en\', \'This tModel is used for the Thomas Register supplier identifier codes.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:B1B1BAF5-2329-43E6-AE13-BA8E97195039\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'types\',\'identifier\') ;\n"
"\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:68DE9E80-AD09-469D-8A37-088422BFBC36\', \'uddi-org:http\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(),\'UUID:68DE9E80-AD09-469D-8A37-088422BFBC36\', \'tModel\', \'en\', \'An http or web browser based web service\') ;\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'10\', \'UUID:68DE9E80-AD09-469D-8A37-088422BFBC36\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY,UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'10\', \'overviewDoc\', \'en\', \'This tModel is used to describe a web service that is invoked through a web browser and/or the http protocol.\') ;\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:68DE9E80-AD09-469D-8A37-088422BFBC36\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'tModelType\',\'transport\') ;\n"
"\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:93335D49-3EFB-48A0-ACEA-EA102B60DDC6\', \'uddi-org:smtp\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(),\'UUID:93335D49-3EFB-48A0-ACEA-EA102B60DDC6\', \'tModel\', \'en\', \'E-mail based web service\') ;\n"
"\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'11\', \'UUID:93335D49-3EFB-48A0-ACEA-EA102B60DDC6\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid (), \'11\', \'overviewDoc\', \'en\', \'This tModel is used to describe a web service that is invoked through SMTP email transmissions. These transmissions may be either between people or applications.\') ;\n"
"\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:93335D49-3EFB-48A0-ACEA-EA102B60DDC6\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'tModelType\',\'transport\') ;\n"
"\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:1A2B00BE-6E2C-42F5-875B-56F32686E0E7\', \'uddi-org:fax\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'UUID:1A2B00BE-6E2C-42F5-875B-56F32686E0E7\', \'tModel\', \'en\', \'Fax based web service\') ;\n"
"\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'12\',\'UUID:1A2B00BE-6E2C-42F5-875B-56F32686E0E7\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'12\', \'overviewDoc\', \'en\', \'This tModel is used to describe a web service that is invoked through fax transmissions.  These transmissions may be either between people or applications.\') ;\n"
"\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:1A2B00BE-6E2C-42F5-875B-56F32686E0E7\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'tModelType\',\'protocol\') ;\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:5FCF5CD0-629A-4C50-8B16-F94E9CF2A674\', \'uddi-org:ftp\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'UUID:5FCF5CD0-629A-4C50-8B16-F94E9CF2A674\', \'tModel\', \'en\', \'File transfer protocol (ftp) based web service\') ;\n"
"\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'13\',\'UUID:5FCF5CD0-629A-4C50-8B16-F94E9CF2A674\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'13\', \'overviewDoc\', \'en\', \'This tModel is used to describe a web service that is invoked through file transfers via the ftp protocol.\') ;\n"
"\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:5FCF5CD0-629A-4C50-8B16-F94E9CF2A674\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'tModelType\',\'transport\') ;\n"
"\n"
"\n"
"\n"
"insert soft TMODEL (TM_TMODEL_KEY,TM_NAME,TM_AUTHORIZED_NAME,TM_OPERATOR) values (\'UUID:38E12427-5536-4260-A6F9-B5B530E63A07\', \'uddi-org:telephone\', \'UDDI Admin\', \'www.openlinksw.com/services/uddi\') ;\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'UUID:38E12427-5536-4260-A6F9-B5B530E63A07\', \'tModel\', \'en\', \'Telephone based web service\') ;\n"
"\n"
"\n"
"insert soft OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL) values (\'14\',\'UUID:38E12427-5536-4260-A6F9-B5B530E63A07\', \'tModel\', \'http://www.uddi.org/specification.html\') ;\n"
"\n"
"\n"
"insert soft DESCRIPTION (UD_DESCRIPTION_KEY, UD_PARENT_ID, UD_TYPE, UD_LANG, UD_DESC) values (uuid(), \'14\', \'overviewDoc\', \'en\', \'This tModel is used to describe a web service that is invoked through a telephone call and interaction by voice and/or touch-tone.\') ;\n"
"\n"
"\n"
"insert soft CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE, CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE) values (uuid(), \'UUID:38E12427-5536-4260-A6F9-B5B530E63A07\',\'tModel\',\'UUID:C1ACF26D-9672-4404-9D70-39B756E62AB4\',\'tModelType\',\'specification\') ;\n"
"\n"
"registry_set (\'UDDI_operator\', \'OpenLink Software\');\n"
"\n"
"}\n"
"--src uddi.sql:274\n";


static const char *other0 = 
" LOAD_UDDI_TAXONOMY ()\n";
static const char *proc1 = 
"#line 489 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_BUSINESS_ENTITY (inout req any)\n"
"{\n"
"declare bk varchar;\n"
"declare operator varchar;\n"
"declare name varchar;\n"
"declare a_name varchar;\n"
"declare token varchar;\n"
"declare owner integer;\n"
"declare next any;\n"
"\n"
"\n"
"\n"
"\n"
"name := cast (xpath_eval (\'/businessEntity/name\', req, 1) as varchar);\n"
"bk := ucase (cast (xpath_eval (\'/businessEntity/@businessKey\', req, 1) as varchar));\n"
"operator := cast (xpath_eval (\'/businessEntity/@operator\', req, 1) as varchar);\n"
"a_name := cast (xpath_eval (\'/businessEntity/@authorizedName\', req, 1) as varchar);\n"
"\n"
"\n"
"if (name is NULL)\n"
"signal (\'10050\', \'The name element is empty\');\n"
"\n"
"if (bk is null)\n"
"bk := uuid ();\n"
"\n"
"if (exists (select 1 from UDDI.DBA.BUSINESS_ENTITY where BE_BUSINESS_KEY = bk))\n"
"{\n"
"\n"
"\n"
"\n"
"DELETE_BUSINESS_BK (bk);\n"
"\n"
"}\n"
"\n"
"\n"
"insert into UDDI.DBA.BUSINESS_ENTITY (BE_BUSINESS_KEY, BE_AUTHORIZED_NAME,\n"
"BE_OPERATOR, BE_NAME, BE_CREATED, BE_OWNER)\n"
"values (bk, a_name, operator, name, now(), owner);\n"
"\n"
"\n"
"next := xpath_eval (\'/businessEntity/discoveryURLs\', req, 1);\n"
"if (not next is NULL)\n"
"SAVE_DISCOVERY_URLS (bk, \'businessEntity\', next);\n"
"\n"
"next := xpath_eval (\'/businessEntity/description\', req, 0);\n"
"if (not next is NULL)\n"
"SAVE_DESCRIPRIONS (bk, \'businessEntity\', next);\n"
"\n"
"next := xpath_eval (\'/businessEntity/businessServices\', req, 1);\n"
"if (not next is NULL)\n"
"SAVE_BUSINESS_SERVICES (bk, \'businessEntity\', next, owner);\n"
"\n"
"next := xpath_eval (\'/businessEntity/contacts\', req, 1);\n"
"if (not next is NULL)\n"
"SAVE_CONTACTS (bk, \'businessEntity\', next);\n"
"\n"
"next := xpath_eval (\'/businessEntity/identifierBag\', req, 1);\n"
"if (not next is NULL)\n"
"SAVE_IDENTIFIER_BAG (bk, \'businessEntity\', next);\n"
"\n"
"next := xpath_eval (\'/businessEntity/categoryBag\', req, 1);\n"
"if (not next is NULL)\n"
"SAVE_CATEGORY_BAG (bk, \'businessEntity\', next);\n"
"\n"
"\n"
"\n"
"return bk;\n"
"\n"
"}\n"
"--src uddi.sql:487\n";

static const char *proc2 = 
"#line 562 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_SAVE_BUSINESS (in uddi_req any)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"declare req any;\n"
"declare ses any;\n"
"declare ans any;\n"
"declare ress any;\n"
"declare token, owner varchar;\n"
"\n"
"if (__tag (uddi_req) <> 230)\n"
"req := xml_tree_doc (uddi_req);\n"
"else\n"
"req := uddi_req;\n"
"\n"
"token := cast (xpath_eval (\'/save_business/authInfo\', req, 1) as varchar);\n"
"owner := VERIFY_AUTH_INFO (token);\n"
"\n"
"idx := 0;\n"
"ans := vector ();\n"
"\n"
"_all := xpath_eval (\'/save_business/businessEntity\', req, 0);\n"
"len := length (_all);\n"
"\n"
"if (_all is NULL)\n"
"_all := GET_FROM_UPLOAD_REGISTER (uddi_req);\n"
"\n"
"while (idx < len)\n"
"{\n"
"ress := kluc (aref (_all, idx));\n"
"ress := SAVE_BUSINESS_ENTITY (ress);\n"
"ans := vector_concat (ans, vector (ress));\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"ses := string_output ();\n"
"BUSINESS_DETAIL (ans, ses);\n"
"\n"
"return (string_output_string(ses));\n"
"\n"
"}\n"
"--src uddi.sql:560\n";

static const char *proc3 = 
"#line 610 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_DESCRIPRIONS (in id any, in type varchar, inout desc_s any)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare line any;\n"
"\n"
"idx := 0;\n"
"len := length (desc_s);\n"
"\n"
"delete from UDDI.DBA.DESCRIPTION where UD_PARENT_ID = id and UD_TYPE = type;\n"
"\n"
"while (idx < len)\n"
"{\n"
"line := aref (desc_s, idx);\n"
"insert into UDDI.DBA.DESCRIPTION (UD_DESCRIPTION_KEY, UD_DESC, UD_LANG, UD_PARENT_ID, UD_TYPE)\n"
"values (uuid (), coalesce (cast (line as varchar), \'\'),\n"
"coalesce (cast (xpath_eval (\'@lang\', line, 1) as varchar), \'\'), id, type);\n"
"idx := idx + 1;\n"
"}\n"
"}\n"
"--src uddi.sql:608\n";

static const char *proc4 = 
"#line 636 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_BUSINESS_SERVICES (in id varchar, in type varchar, inout services any, in owner integer)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"\n"
"idx := 0;\n"
"_all := xpath_eval (\'businessService\', services, 0);\n"
"len := length (_all);\n"
"\n"
"for (select BS_SERVICE_KEY from BUSINESS_SERVICE where BS_BUSINESS_KEY = id) do\n"
"DELETE_SERVICE_SK (BS_SERVICE_KEY);\n"
"\n"
"while (idx < len)\n"
"{\n"
"SAVE_BUSINESS_SERVICE (id, type, aref (_all, idx), owner);\n"
"idx := idx + 1;\n"
"}\n"
"}\n"
"--src uddi.sql:634\n";

static const char *proc5 = 
"#line 661 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_BUSINESS_SERVICE (in id varchar, in type varchar, inout service any, in owner integer)\n"
"{\n"
"\n"
"declare sk varchar;\n"
"declare bk varchar;\n"
"declare name varchar;\n"
"declare next any;\n"
"\n"
"name := cast (xpath_eval (\'name\', service, 1) as varchar);\n"
"\n"
"bk := ucase (cast (xpath_eval (\'@businessKey\', service, 1) as varchar));\n"
"sk := cast (xpath_eval (\'@serviceKey\', service, 1) as varchar);\n"
"\n"
"if (id is NULL)\n"
"{\n"
"id := ((select BE_BUSINESS_KEY from UDDI.DBA.BUSINESS_ENTITY where BE_BUSINESS_KEY = bk));\n"
"\n"
"if (id is NULL)\n"
"signal (\'10050\', sprintf (\'No Business Entity with Business key %s\', bk));\n"
"}\n"
"\n"
"if (isstring (sk))\n"
"sk := ucase (sk);\n"
"else\n"
"sk := uuid ();\n"
"\n"
"if (bk <> id)\n"
"signal (\'10050\', sprintf (\'Invalid Business Key Passed %s in Business Service %s\', bk, name));\n"
"else if (bk is NULL)\n"
"bk := id;\n"
"\n"
"if (exists (select DELETE_SERVICE_SK (BS_SERVICE_KEY) from UDDI.DBA.BUSINESS_SERVICE\n"
"where BS_BUSINESS_KEY = bk and BS_SERVICE_KEY = sk))\n"
"{\n"
"DELETE_SERVICE_SK (sk);\n"
"}\n"
"\n"
"insert into UDDI.DBA.BUSINESS_SERVICE (BS_BUSINESS_KEY, BS_SERVICE_KEY, BS_NAME, BS_CREATED, BS_OWNER)\n"
"values (bk, sk, name, now(), owner);\n"
"\n"
"next := xpath_eval (\'description\', service, 0);\n"
"SAVE_DESCRIPRIONS (sk, \'businessService\', next);\n"
"\n"
"next := xpath_eval (\'bindingTemplates\', service, 1);\n"
"if (next is not null)\n"
"SAVE_BINDING_TEMPLATES (sk, \'businessService\', next, owner);\n"
"\n"
"next := xpath_eval (\'categoryBag\', service, 1);\n"
"\n"
"if (not next is null)\n"
"SAVE_CATEGORY_BAG (sk, \'businessService\', next);\n"
"\n"
"return sk;\n"
"}\n"
"--src uddi.sql:659\n";

static const char *proc6 = 
"#line 720 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_BINDING_TEMPLATES (in id varchar, in type varchar, inout templates any, in owner integer)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"declare res any;\n"
"\n"
"idx := 0;\n"
"res := vector ();\n"
"\n"
"_all := xpath_eval (\'bindingTemplate\', templates, 0);\n"
"len := length (_all);\n"
"\n"
"while (idx < len)\n"
"{\n"
"res := vector_concat (res, vector (SAVE_BINDING_TEMPLATE (id, type, aref (_all, idx), owner)));\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"return res;\n"
"\n"
"}\n"
"--src uddi.sql:718\n";

static const char *proc7 = 
"#line 748 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_BINDING_TEMPLATE (in id varchar, in type varchar, inout template any, in owner integer)\n"
"{\n"
"\n"
"declare sk varchar;\n"
"declare bin_k varchar;\n"
"declare acc_p varchar;\n"
"declare host_red varchar;\n"
"declare url_t varchar;\n"
"declare next any;\n"
"\n"
"bin_k := ucase (cast (xpath_eval (\'@bindingKey\', template, 1) as varchar));\n"
"sk := ucase (cast (xpath_eval (\'@serviceKey\', template, 1) as varchar));\n"
"acc_p := cast (xpath_eval (\'accessPoint\', template, 1) as varchar);\n"
"host_red := coalesce (cast (xpath_eval (\'hostingRedirector\', template, 1) as varchar), \'\');\n"
"url_t := coalesce (cast (xpath_eval (\'@URLType\', template, 1) as varchar), \'\');\n"
"\n"
"if (bin_k is null)\n"
"bin_k := uuid ();\n"
"\n"
"if (exists (select 1 from UDDI.DBA.BINDING_TEMPLATE where BT_BINDING_KEY = bin_k and BT_SERVICE_KEY = sk))\n"
"{\n"
"update UDDI.DBA.BINDING_TEMPLATE set BT_ACCESS_POINT = acc_p,\n"
"BT_HOSTING_REDIRECTOR = host_red, BT_URL_TYPE = url_t, BT_OWNER = owner\n"
"where BT_BINDING_KEY = bin_k and BT_SERVICE_KEY = sk;\n"
"}\n"
"else\n"
"{\n"
"insert into UDDI.DBA.BINDING_TEMPLATE (BT_BINDING_KEY, BT_SERVICE_KEY,\n"
"BT_ACCESS_POINT, BT_HOSTING_REDIRECTOR, BT_URL_TYPE, BT_CREATED, BT_OWNER)\n"
"values (bin_k, sk, acc_p, host_red, url_t, now(), owner);\n"
"}\n"
"\n"
"next := xpath_eval (\'description\', template, 0);\n"
"SAVE_DESCRIPRIONS (bin_k, \'bindingTemplate\', next);\n"
"\n"
"next := xpath_eval (\'tModelInstanceDetails\', template, 1);\n"
"if (next is not null)\n"
"SAVE_TMODEL_INSTANCE_DETAILS (id, bin_k, \'businessService\', next);\n"
"\n"
"return bin_k;\n"
"}\n"
"--src uddi.sql:746\n";

static const char *proc8 = 
"#line 794 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_TMODEL_INSTANCE_DETAILS (in id varchar, in bin_k varchar, in type varchar, inout i_det any)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"\n"
"idx := 0;\n"
"\n"
"_all := xpath_eval (\'tModelInstanceInfo\', i_det, 0);\n"
"len := length (_all);\n"
"\n"
"while (idx < len)\n"
"{\n"
"SAVE_TMODEL_INSTANCE_INFOS_1 (id, bin_k, type, aref (_all, idx));\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"}\n"
"--src uddi.sql:792\n";

static const char *proc9 = 
"#line 817 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_TMODEL_INSTANCE_INFOS_1 (in id varchar, in bin_k varchar, in type varchar, inout i_det any)\n"
"{\n"
"\n"
"declare t_k any;\n"
"declare in_k varchar;\n"
"declare inst_param any;\n"
"\n"
"t_k := cast (xpath_eval (\'@tModelKey\', i_det, 1) as varchar);\n"
"inst_param := coalesce (cast (xpath_eval (\'instanceDetails/instanceParms\', i_det, 1) as varchar), \'\');\n"
"in_k := sequence_next (\'instance_id\');\n"
"\n"
"if (t_k is null or t_k = 0)\n"
"t_k := concat (\'UDDI:\', uuid ());\n"
"else\n"
"{\n"
"t_k := ucase (t_k);\n"
"delete from INSTANCE_DETAIL where ID_BINDING_KEY = bin_k and ID_TMODEL_KEY = t_k;\n"
"}\n"
"\n"
"insert into INSTANCE_DETAIL (ID_KEY, ID_BINDING_KEY, ID_TMODEL_KEY, ID_PARMS)\n"
"values (in_k, bin_k, t_k, inst_param);\n"
"\n"
"SAVE_DESCRIPRIONS (in_k, \'instanceDetails\', xpath_eval (\'instanceDetails/description\', i_det, 0));\n"
"SAVE_DESCRIPRIONS (in_k, \'tModelInstanceInfo\', xpath_eval (\'description\', i_det, 0));\n"
"SAVE_OVERVIEW_DOC (in_k, \'tModelInstanceInfo\', xpath_eval (\'instanceDetails/overviewDoc\', i_det, 1));\n"
"\n"
"}\n"
"--src uddi.sql:815\n";

static const char *proc10 = 
"#line 849 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_IDENTIFIER_BAG (in id varchar, in type varchar, inout i_bag any)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"declare line any;\n"
"declare k_name varchar;\n"
"declare k_val varchar;\n"
"declare t_key varchar;\n"
"\n"
"idx := 0;\n"
"_all := xpath_eval (\'keyedReference\', i_bag, 0);\n"
"\n"
"len := length (_all);\n"
"delete from UDDI.DBA.IDENTIFIER_BAG where IB_PARENT_ID = id and IB_PARENT_TYPE = type;\n"
"\n"
"while (idx < len)\n"
"{\n"
"line := aref (_all, idx);\n"
"k_name := cast (xpath_eval (\'@keyName\', line, 1) as varchar);\n"
"k_val := cast (xpath_eval (\'@keyValue\', line, 1) as varchar);\n"
"t_key := ucase (cast (xpath_eval (\'@tModelKey\', line, 1) as varchar));\n"
"\n"
"\n"
"insert into UDDI.DBA.IDENTIFIER_BAG (IB_IDENTIFIER_KEY, IB_PARENT_ID, IB_PARENT_TYPE,\n"
"IB_TMODEL_KEY_ID, IB_KEY_NAME, IB_KEY_VALUE)\n"
"values (uuid(), id, type, coalesce (t_key, \'\'), k_name, k_val);\n"
"\n"
"idx := idx + 1;\n"
"}\n"
"}\n"
"--src uddi.sql:847\n";

static const char *proc11 = 
"#line 886 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_CATEGORY_BAG (in id varchar, in type varchar, inout c_bag any)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"declare line any;\n"
"declare k_name varchar;\n"
"declare k_val varchar;\n"
"declare t_key varchar;\n"
"\n"
"if (c_bag is null)\n"
"return;\n"
"\n"
"idx := 0;\n"
"_all := xpath_eval (\'keyedReference\', c_bag, 0);\n"
"len := length (_all);\n"
"\n"
"delete from UDDI.DBA.CATEGORY_BAG where CB_PARENT_ID = id and CB_PARENT_TYPE = type;\n"
"\n"
"while (idx < len)\n"
"{\n"
"line := aref (_all, idx);\n"
"k_name := cast (xpath_eval (\'@keyName\', line, 1) as varchar);\n"
"k_val := cast (xpath_eval (\'@keyValue\', line, 1) as varchar);\n"
"t_key := ucase (cast (xpath_eval (\'@tModelKey\', line, 1) as varchar));\n"
"\n"
"insert into UDDI.DBA.CATEGORY_BAG (CB_CATEGORY_KEY, CB_PARENT_ID, CB_PARENT_TYPE,\n"
"CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE)\n"
"values (uuid(), id, type, t_key, k_name, k_val);\n"
"\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"}\n"
"--src uddi.sql:884\n";

static const char *proc12 = 
"#line 926 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_OVERVIEW_DOC (in id varchar, in type varchar, inout ov_doc any)\n"
"{\n"
"\n"
"declare o_url varchar;\n"
"declare ov_key any;\n"
"\n"
"if (ov_doc is NULL)\n"
"return;\n"
"\n"
"o_url := cast (xpath_eval (\'overviewURL\', ov_doc, 1) as varchar);\n"
"ov_key := sequence_next (\'overviewDoc_key\');\n"
"ov_key := ov_key + 17;\n"
"\n"
"delete from UDDI.DBA.OVERVIEW_DOC where OV_PARENT_ID = id and OV_PARENT_TYPE = type;\n"
"\n"
"insert into UDDI.DBA.OVERVIEW_DOC (OV_KEY, OV_PARENT_ID, OV_PARENT_TYPE, OV_URL)\n"
"values (ov_key, id, type, o_url);\n"
"\n"
"SAVE_DESCRIPRIONS (ov_key, \'overviewDoc\', xpath_eval (\'description\', ov_doc, 0));\n"
"\n"
"}\n"
"--src uddi.sql:924\n";

static const char *proc13 = 
"#line 952 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_SAVE_TMODEL (in uddi_req any)\n"
"{\n"
"declare req any;\n"
"declare tm_key varchar;\n"
"declare name varchar;\n"
"declare operator varchar;\n"
"declare token varchar;\n"
"declare owner integer;\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"declare line any;\n"
"declare a_name any;\n"
"declare tm_keys any;\n"
"declare ses any;\n"
"\n"
"ses := string_output ();\n"
"tm_keys := vector ();\n"
"\n"
"req := xml_tree_doc (uddi_req);\n"
"\n"
"token := cast (xpath_eval (\'/save_tModel/authInfo\', req, 1) as varchar);\n"
"owner := VERIFY_AUTH_INFO (token);\n"
"\n"
"\n"
"\n"
"_all := xpath_eval (\'/save_tModel/tModel\', req, 0);\n"
"\n"
"idx := 0;\n"
"len := length (_all);\n"
"\n"
"while (idx < len)\n"
"{\n"
"line := aref (_all, idx);\n"
"name := cast (xpath_eval (\'name\', line, 1) as varchar);\n"
"operator := cast (xpath_eval (\'@operator\', line, 1) as varchar);\n"
"a_name := cast (xpath_eval (\'@authorizedName\', line, 1) as varchar);\n"
"tm_key := ucase (cast (xpath_eval (\'@tModelKey\', line, 1) as varchar));\n"
"\n"
"if (tm_key is null)\n"
"tm_key := uuid ();\n"
"\n"
"if (exists (select 1 from UDDI.DBA.TMODEL where TM_TMODEL_KEY = tm_key))\n"
"{\n"
"update UDDI.DBA.TMODEL set TM_AUTHORIZED_NAME = a_name, TM_OPERATOR = operator,\n"
"TM_NAME = name, TM_OWNER = owner where TM_TMODEL_KEY = tm_key;\n"
"}\n"
"else\n"
"{\n"
"insert into TMODEL (TM_TMODEL_KEY, TM_AUTHORIZED_NAME, TM_OPERATOR, TM_NAME, TM_CREATED, TM_OWNER)\n"
"values (tm_key, a_name, operator, name, now(), owner);\n"
"}\n"
"\n"
"SAVE_DESCRIPRIONS (tm_key, \'tModel\', xpath_eval (\'description\', line, 0));\n"
"SAVE_CATEGORY_BAG (tm_key, \'tModel\', xpath_eval (\'categoryBag\', line, 1));\n"
"SAVE_OVERVIEW_DOC (tm_key, \'tModel\', xpath_eval (\'overviewDoc\', line, 1));\n"
"\n"
"tm_keys := vector_concat (tm_keys, vector (tm_key));\n"
"\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"\n"
"TMODEL_DETAIL (tm_keys, ses);\n"
"return (string_output_string(ses));\n"
"}\n"
"--src uddi.sql:950\n";

static const char *proc14 = 
"#line 1023 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_DISCOVERY_URLS (in id varchar, in type varchar, inout urls any)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare pos integer;\n"
"declare _all any;\n"
"declare line any;\n"
"declare url varchar;\n"
"declare url_t any;\n"
"\n"
"idx := 0;\n"
"_all := xpath_eval (\'discoveryURL\', urls, 0);\n"
"len := length (_all);\n"
"\n"
"delete from UDDI.DBA.DISCOVERY_URL where DU_PARENT_ID = id and DU_PARENT_TYPE = type;\n"
"\n"
"if (len = 0)\n"
"{\n"
"insert into UDDI.DBA.DISCOVERY_URL (DU_DISCOVERY_KEY, DU_PARENT_ID, DU_PARENT_TYPE, DU_URL, DU_USE_TYPE)\n"
"values (uuid(), id, type, \'http://. . . .\', \'http\');\n"
"}\n"
"else\n"
"{\n"
"while (idx < len)\n"
"{\n"
"line := aref (_all, idx);\n"
"\n"
"url := cast (line as varchar);\n"
"url_t := cast (xpath_eval (\'@useType\', line, 1) as varchar);\n"
"\n"
"if (url_t = 0)\n"
"{\n"
"pos := strstr (url, \':\');\n"
"\n"
"if (pos is NULL)\n"
"url_t := \'\';\n"
"else\n"
"url_t := \"LEFT\" (url, pos);\n"
"}\n"
"\n"
"insert into UDDI.DBA.DISCOVERY_URL (DU_DISCOVERY_KEY, DU_PARENT_ID, DU_PARENT_TYPE, DU_URL, DU_USE_TYPE)\n"
"values (uuid (), id, type, url, url_t);\n"
"\n"
"idx := idx + 1;\n"
"}\n"
"}\n"
"}\n"
"--src uddi.sql:1021\n";

static const char *proc15 = 
"#line 1076 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_CONTACTS (in id varchar, in type varchar, inout contacts any)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"declare line any;\n"
"declare per_name varchar;\n"
"declare con_t varchar;\n"
"declare con_k varchar;\n"
"\n"
"idx := 0;\n"
"_all := xpath_eval (\'contact\', contacts, 0);\n"
"len := length (_all);\n"
"\n"
"delete from UDDI.DBA.CONTACTS where CO_BUSINESS_ID = id;\n"
"\n"
"while (idx < len)\n"
"{\n"
"line := aref (_all, idx);\n"
"per_name := cast (xpath_eval (\'personName\', line, 1) as varchar);\n"
"con_t := cast (xpath_eval (\'@useType\', line, 1) as varchar);\n"
"con_k := concat (\'c\', uuid());\n"
"SAVE_DESCRIPRIONS (con_k, \'contacts\', xpath_eval (\'description\', line, 0));\n"
"SAVE_PHONES (id, con_k, xpath_eval (\'phone\', line, 0));\n"
"SAVE_EMAILS (id, con_k, xpath_eval (\'email\', line, 0));\n"
"SAVE_ADDRESS (id, con_k, xpath_eval (\'address\', line, 0));\n"
"\n"
"insert into UDDI.DBA.CONTACTS (CO_BUSINESS_ID, CO_USE_TYPE, CO_PERSONAL_NAME, CO_CONTACT_KEY)\n"
"values (id, con_t, per_name, con_k);\n"
"\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"}\n"
"--src uddi.sql:1074\n";

static const char *proc16 = 
"#line 1115 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_EMAILS (in id varchar, in c_k varchar, inout email_s any)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare line any;\n"
"\n"
"idx := 0;\n"
"len := length (email_s);\n"
"\n"
"delete from UDDI.DBA.EMAIL where EM_CONTACT_KEY= c_k;\n"
"\n"
"while (idx < len)\n"
"{\n"
"line := aref (email_s, idx);\n"
"insert into UDDI.DBA.EMAIL (EM_EMAIL_KEY, EM_CONTACT_KEY, EM_ADDR, EM_USE_TYPE)\n"
"values (uuid(), c_k, coalesce (cast (line as varchar), \'\'),\n"
"coalesce (cast (xpath_eval (\'@useType\', line, 1) as varchar), \'\'));\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"}\n"
"--src uddi.sql:1113\n";

static const char *proc17 = 
"#line 1141 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_PHONES (in id varchar, in c_k varchar, inout phones_s any)\n"
"{\n"
"\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare line any;\n"
"\n"
"idx := 0;\n"
"len := length (phones_s);\n"
"\n"
"delete from UDDI.DBA.PHONE where PH_CONTACT_KEY = c_k;\n"
"\n"
"while (idx < len)\n"
"{\n"
"line := aref (phones_s, idx);\n"
"insert into UDDI.DBA.PHONE (PH_PHONE_KEY, PH_CONTACT_KEY, PH_PHONE, PH_USE_TYPE)\n"
"values (uuid(), c_k, coalesce (cast (line as varchar), \'\'),\n"
"coalesce (cast (xpath_eval (\'@useType\', line, 1) as varchar), \'\'));\n"
"\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"}\n"
"--src uddi.sql:1139\n";

static const char *proc18 = 
"#line 1168 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_ADDRESS (in id varchar, in c_k varchar, inout address_s any)\n"
"{\n"
"\n"
"declare idx_1, idx_2 integer;\n"
"declare len_1, len_2 integer;\n"
"declare sort_code, use_type varchar;\n"
"declare lines any;\n"
"declare line any;\n"
"\n"
"idx_1 := 0;\n"
"len_1 := length (address_s);\n"
"\n"
"delete from UDDI.DBA.ADDRESS_LINE where AL_PARENT_ID = c_k;\n"
"\n"
"while (idx_1 < len_1)\n"
"{\n"
"line := aref (address_s, idx_1);\n"
"lines := xpath_eval (\'addressLine\', line, 0);\n"
"idx_2 := 0;\n"
"len_2 := length (lines);\n"
"sort_code := cast (xpath_eval (\'@sortCode\', line, 1) as varchar);\n"
"use_type := cast (xpath_eval (\'@useType\', line, 1) as varchar);\n"
"while (idx_2 < len_2)\n"
"{\n"
"insert into UDDI.DBA.ADDRESS_LINE (AL_ADDRESS_KEY, AL_PARENT_ID, AL_PARENT_TYPE, AL_USE_TYPE, AL_SORT_CODE, AL_LINE)\n"
"values (uuid(), c_k, \'contacts\', use_type, sort_code,\n"
"coalesce (cast (aref (lines, idx_2) as varchar), \'\'));\n"
"\n"
"idx_2 := idx_2 + 1;\n"
"}\n"
"idx_1 := idx_1 + 1;\n"
"}\n"
"}\n"
"--src uddi.sql:1166\n";

static const char *proc19 = 
"#line 1205 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"DELETE_BUSINESS_BK (in bk varchar)\n"
"{\n"
"\n"
"if (exists (select 1 from UDDI.DBA.BUSINESS_ENTITY where BE_BUSINESS_KEY = bk))\n"
"{\n"
"delete from IDENTIFIER_BAG where IB_PARENT_ID = bk;\n"
"delete from CATEGORY_BAG where CB_PARENT_ID = bk and CB_PARENT_TYPE = \'businessEntity\';\n"
"delete from DESCRIPTION where UD_PARENT_ID = bk and UD_TYPE = \'businessEntity\';\n"
"\n"
"for (select CO_CONTACT_KEY from CONTACTS where CO_BUSINESS_ID = bk) do\n"
"{\n"
"delete from EMAIL where EM_CONTACT_KEY = CO_CONTACT_KEY;\n"
"delete from PHONE where PH_CONTACT_KEY = CO_CONTACT_KEY;\n"
"delete from DESCRIPTION where UD_PARENT_ID = CO_CONTACT_KEY and UD_TYPE = \'contacts\';\n"
"delete from ADDRESS_LINE where AL_PARENT_ID = CO_CONTACT_KEY;\n"
"}\n"
"\n"
"delete from CONTACTS where CO_BUSINESS_ID = bk;\n"
"delete from ADDRESS_LINE where AL_PARENT_ID = bk;\n"
"\n"
"for (select BS_SERVICE_KEY from BUSINESS_SERVICE where BS_BUSINESS_KEY = bk) do\n"
"DELETE_SERVICE_SK (BS_SERVICE_KEY);\n"
"\n"
"delete from BUSINESS_SERVICE where BS_BUSINESS_KEY = bk;\n"
"delete from DISCOVERY_URL where DU_PARENT_ID = bk;\n"
"delete from BUSINESS_ENTITY where BE_BUSINESS_KEY = bk;\n"
"}\n"
"else\n"
"{\n"
"signal (\'10050\', sprintf (\'Invalid Business KeyPassed %s\', bk));\n"
"}\n"
"}\n"
"--src uddi.sql:1203\n";

static const char *proc20 = 
"#line 1240 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_SAVE_SERVICE (in uddi_req any)\n"
"{\n"
"\n"
"declare req varchar;\n"
"declare token varchar;\n"
"declare owner integer;\n"
"declare ser_key varchar;\n"
"declare ses any;\n"
"\n"
"ses := string_output ();\n"
"req := xml_tree_doc (uddi_req);\n"
"\n"
"token := cast (xpath_eval (\'/save_service/authInfo\', req, 1) as varchar);\n"
"owner := VERIFY_AUTH_INFO (token);\n"
"\n"
"req := xpath_eval (\'/save_service/businessService\', req, 0);\n"
"\n"
"if (req is NULL)\n"
"signal (\'10050\', \'Bad request save service\');\n"
"\n"
"ser_key := SAVE_BUSINESS_SERVICE (NULL, NULL, aref (req, 0), owner);\n"
"\n"
"SERVICE_DETAIL (vector (ser_key), ses);\n"
"return (string_output_string(ses));\n"
"\n"
"}\n"
"--src uddi.sql:1238\n";

static const char *proc21 = 
"#line 1270 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"DELETE_SERVICE_SK (in sk varchar)\n"
"{\n"
"\n"
"declare temp varchar;\n"
"\n"
"if (exists (select 1 from UDDI.DBA.BUSINESS_SERVICE where BS_SERVICE_KEY = sk))\n"
"{\n"
"for (select BT_BINDING_KEY from BINDING_TEMPLATE where BT_SERVICE_KEY = sk) do\n"
"DELETE_BINDING_BK (BT_BINDING_KEY);\n"
"\n"
"delete from DESCRIPTION where UD_PARENT_ID = sk and UD_TYPE = \'businessService\';\n"
"delete from BINDING_TEMPLATE where BT_SERVICE_KEY = sk;\n"
"delete from CATEGORY_BAG where CB_PARENT_ID = sk and CB_PARENT_TYPE = \'businessService\';\n"
"\n"
"delete from BUSINESS_SERVICE where BS_SERVICE_KEY = sk;\n"
"}\n"
"else\n"
"{\n"
"signal (\'10050\', sprintf (\'Invalid Service Key Passed %s\', sk));\n"
"}\n"
"}\n"
"--src uddi.sql:1268\n";

static const char *proc22 = 
"#line 1295 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"DELETE_BINDING_BK (in bin_k varchar)\n"
"{\n"
"if (exists (select 1 from UDDI.DBA.BINDING_TEMPLATE where BT_BINDING_KEY = bin_k))\n"
"{\n"
"for (select ID_KEY from INSTANCE_DETAIL where ID_BINDING_KEY = bin_k) do\n"
"{\n"
"delete from DESCRIPTION where UD_PARENT_ID = ID_KEY and UD_TYPE = \'tModelInstanceInfo\';\n"
"delete from DESCRIPTION where UD_PARENT_ID = ID_KEY and UD_TYPE = \'instanceDetails\';\n"
"delete from OVERVIEW_DOC where OV_PARENT_ID = ID_KEY and OV_PARENT_TYPE = \'tModelInstanceInfo\';\n"
"}\n"
"delete from DESCRIPTION where UD_PARENT_ID = bin_k and UD_TYPE = \'bindingTemplate\';\n"
"delete from INSTANCE_DETAIL where ID_BINDING_KEY = bin_k;\n"
"}\n"
"else\n"
"{\n"
"signal (\'10050\', sprintf (\'Invalid Binding Key Passed %s\', bin_k));\n"
"}\n"
"}\n"
"--src uddi.sql:1293\n";

static const char *proc23 = 
"#line 1317 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"DELETE_TMODEL_TK (in tm_key varchar)\n"
"{\n"
"\n"
"if (exists (select 1 from UDDI.DBA.TMODEL where TM_TMODEL_KEY = tm_key))\n"
"{\n"
"delete from TMODEL where TM_TMODEL_KEY = tm_key;\n"
"delete from CATEGORY_BAG where CB_PARENT_ID = tm_key and CB_PARENT_TYPE = \'tModel\';\n"
"for (select OV_KEY from OVERVIEW_DOC where OV_PARENT_ID = tm_key and OV_PARENT_TYPE = \'tModel\') do\n"
"delete from DESCRIPTION where UD_PARENT_ID = OV_KEY and UD_TYPE = \'overviewDoc\';\n"
"delete from DESCRIPTION where UD_PARENT_ID = tm_key and UD_TYPE = \'tModel\';\n"
"delete from OVERVIEW_DOC where OV_PARENT_ID = tm_key and OV_PARENT_TYPE = \'tModel\';\n"
"}\n"
"else\n"
"{\n"
"signal (\'10050\', sprintf (\'Invalid tModel Key Passed %s\', tm_key));\n"
"}\n"
"\n"
"}\n"
"--src uddi.sql:1315\n";

static const char *proc24 = 
"#line 1339 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_SAVE_BINDING (in uddi_req any)\n"
"{\n"
"\n"
"declare req any;\n"
"declare token varchar;\n"
"declare owner integer;\n"
"declare ses any;\n"
"declare resp any;\n"
"\n"
"ses := string_output ();\n"
"req := xml_tree_doc (uddi_req);\n"
"\n"
"token := cast (xpath_eval (\'/save_binding/authInfo\', req, 1) as varchar);\n"
"owner := VERIFY_AUTH_INFO (token);\n"
"\n"
"req := xpath_eval (\'/save_binding\', req, 0);\n"
"\n"
"if (length (req) = 0)\n"
"{\n"
"signal (\'10050\', \'Bad request Save Binding \');\n"
"}\n"
"\n"
"resp := SAVE_BINDING_TEMPLATES (NULL, NULL, aref (req, 0), owner);\n"
"\n"
"BINDING_DETAIL (resp, ses);\n"
"return (string_output_string(ses));\n"
"\n"
"}\n"
"--src uddi.sql:1337\n";

static const char *proc25 = 
"#line 1370 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_DELETE_BUSINESS (in uddi_req any)\n"
"{\n"
"declare req any;\n"
"declare bk varchar;\n"
"declare token varchar;\n"
"declare owner integer;\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"\n"
"req := xml_tree_doc (uddi_req);\n"
"\n"
"token := cast (xpath_eval (\'/delete_business/authInfo\', req, 1) as varchar);\n"
"owner := VERIFY_AUTH_INFO (token);\n"
"\n"
"_all := xpath_eval (\'/delete_business/businessKey\', req, 0);\n"
"idx := 0;\n"
"len := length (_all);\n"
"\n"
"if (_all is NULL)\n"
"{\n"
"signal (\'10050\', \'Delete Business No business key \');\n"
"}\n"
"\n"
"while (idx < len)\n"
"{\n"
"bk := cast (aref (_all, idx) as varchar);\n"
"DELETE_BUSINESS_BK (bk);\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"return OK_DISPOSITION_REPORT ();\n"
"\n"
"}\n"
"--src uddi.sql:1368\n";

static const char *proc26 = 
"#line 1408 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_DELETE_SERVICE (in uddi_req any)\n"
"{\n"
"declare req any;\n"
"declare sk varchar;\n"
"declare token varchar;\n"
"declare owner integer;\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"\n"
"req := xml_tree_doc (uddi_req);\n"
"\n"
"token := cast (xpath_eval (\'/delete_service/authInfo\', req, 1) as varchar);\n"
"owner := VERIFY_AUTH_INFO (token);\n"
"\n"
"_all := xpath_eval (\'/delete_service/serviceKey\', req, 0);\n"
"idx := 0;\n"
"len := length (_all);\n"
"\n"
"if (_all is NULL)\n"
"{\n"
"signal (\'10050\', \'Delete Service No service key \');\n"
"}\n"
"\n"
"while (idx < len)\n"
"{\n"
"sk := cast (aref (_all, idx) as varchar);\n"
"DELETE_SERVICE_SK (sk);\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"return OK_DISPOSITION_REPORT ();\n"
"\n"
"}\n"
"--src uddi.sql:1406\n";

static const char *proc27 = 
"#line 1446 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_DELETE_BINDING (in uddi_req any)\n"
"{\n"
"declare req any;\n"
"declare bin_k varchar;\n"
"declare token varchar;\n"
"declare owner integer;\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"\n"
"req := xml_tree_doc (uddi_req);\n"
"\n"
"token := cast (xpath_eval (\'/delete_binding/authInfo\', req, 1) as varchar);\n"
"owner := VERIFY_AUTH_INFO (token);\n"
"\n"
"_all := xpath_eval (\'/delete_binding/bindingKey\', req, 0);\n"
"idx := 0;\n"
"len := length (_all);\n"
"\n"
"if (len = 0)\n"
"{\n"
"signal (\'10050\', \'Bad request Delete Binding \');\n"
"}\n"
"\n"
"while (idx < len)\n"
"{\n"
"bin_k := cast (aref (_all, idx) as varchar);\n"
"DELETE_BINDING_BK (bin_k);\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"return OK_DISPOSITION_REPORT ();\n"
"\n"
"}\n"
"--src uddi.sql:1444\n";

static const char *proc28 = 
"#line 1484 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_DELETE_TMODEL (in uddi_req any)\n"
"{\n"
"declare req any;\n"
"declare tm_key varchar;\n"
"declare token varchar;\n"
"declare owner integer;\n"
"declare idx integer;\n"
"declare len integer;\n"
"declare _all any;\n"
"\n"
"req := xml_tree_doc (uddi_req);\n"
"\n"
"token := cast (xpath_eval (\'/delete_tModel/authInfo\', req, 1) as varchar);\n"
"owner := VERIFY_AUTH_INFO (token);\n"
"\n"
"_all := xpath_eval (\'/delete_tModel/tModelKey\', req, 0);\n"
"idx := 0;\n"
"len := length (_all);\n"
"\n"
"while (idx < len)\n"
"{\n"
"tm_key := cast (aref (_all, idx) as varchar);\n"
"DELETE_TMODEL_TK (tm_key);\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"return OK_DISPOSITION_REPORT ();\n"
"\n"
"}\n"
"--src uddi.sql:1482\n";

static const char *proc29 = 
"#line 1517 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"GET_FROM_UPLOAD_REGISTER (in req any)\n"
"{\n"
"\n"
"declare idx, len integer;\n"
"declare _all any;\n"
"declare temp any;\n"
"declare temp1 any;\n"
"declare line any;\n"
"declare list any;\n"
"declare ses any;\n"
"\n"
"ses := string_output ();\n"
"\n"
"_all := xpath_eval (\'/uploadRegister\', req, 0);\n"
"\n"
"idx := 0;\n"
"len := length (_all);\n"
"\n"
"while (idx < len)\n"
"{\n"
"line := cast (aref (list, idx) as varchar);\n"
"temp := http_get(line, \'GET\');\n"
"temp := xml_tree_doc (temp);\n"
"\n"
"temp1 := xpath_eval (\'/Envelope/Body/businessDetail/businessEntity\', temp, 1);\n"
"\n"
"http_value (temp1, NULL, ses);\n"
"\n"
"idx := idx + 1;\n"
"}\n"
"\n"
"return string_output_string (ses);\n"
"}\n"
"--src uddi.sql:1515\n";

static const char *proc30 = 
"#line 1554 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SAVE_BUSINESS_FROM_FILE (in file_name varchar)\n"
"{\n"
"declare read, req any;\n"
"\n"
"read := file_to_string (file_name);\n"
"read := concat (\'<save_business>\', read ,\'</save_business>\');\n"
"\n"
"\n"
"save_business (read);\n"
"\n"
"return;\n"
"}\n"
"--src uddi.sql:1552\n";

static const char *proc31 = 
"#line 1571 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_GET_AUTHTOKEN (in uddi_req any)\n"
"{\n"
"declare ent any;\n"
"declare userID, cred varchar;\n"
"declare ses any;\n"
"declare own integer;\n"
"ses := string_output ();\n"
"ent := xml_tree_doc (uddi_req);\n"
"userID := cast (xpath_eval (\'/get_authToken/@userID\', ent, 1) as varchar);\n"
"cred := cast (xpath_eval (\'/get_authToken/@cred\', ent, 1) as varchar);\n"
"\n"
"\n"
"own := coalesce ((select U_ID from WS.WS.SYS_DAV_USER where U_NAME = userID and U_PWD = cred), NULL);\n"
"if (own is not null)\n"
"signal (\'10150\', sprintf (\'The user \"%s\" is not valid, or password is incorrect\', userID));\n"
"\n"
"declare ses_id varchar;\n"
"\n"
"ses_id := md5 (concat (datestring (now ()), http_client_ip (), http_path ()));\n"
"\n"
"insert into WS.WS.SESSION (S_ID, S_EXPIRE,S_DOMAIN, S_OPAQUE, S_VARS, S_REALM)\n"
"values (ses_id, dateadd (\'minute\', 10, now ()), \'UDDI\', ses_id, own, \'UDDI service\');\n"
"\n"
"http (sprintf (\'<authToken generic=\"1.0\" operator=\"%s\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"http (sprintf (\'<authInfo>%s</authInfo>\', ses_id), ses);\n"
"\n"
"http (\'</authToken>\', ses);\n"
"\n"
"\n"
"return (string_output_string(ses));\n"
"}\n"
"--src uddi.sql:1569\n";

static const char *proc32 = 
"#line 1605 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_DISCARD_AUTHTOKEN (in uddi_req any)\n"
"{\n"
"declare ent any;\n"
"declare token varchar;\n"
"ent := xml_tree_doc (uddi_req);\n"
"token := cast (xpath_eval (\'/discard_authToken/authInfo\', ent, 1) as varchar);\n"
"if (not length (token))\n"
"signal (\'10120\', \'Authentication token required upon discard_authToken call\');\n"
"delete from  WS.WS.SESSION where S_OPAQUE = token;\n"
"return OK_DISPOSITION_REPORT ();\n"
"}\n"
"--src uddi.sql:1603\n";

static const char *proc33 = 
"#line 1619 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"OK_DISPOSITION_REPORT ()\n"
"{\n"
"return (sprintf (\'<dispositionReport generic=\"1.0\" operator=\"%s\"  xmlns=\"urn:uddi-org:api\" ><result errno=\"0\" ><errInfo errCode=\"E_success\" /></result></dispositionReport>\', registry_get (\'UDDI_operator\')));\n"
"}\n"
"--src uddi.sql:1617\n";

static const char *proc34 = 
"#line 1626 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_GET_REGISTEREDINFO (in uddi_req any)\n"
"{\n"
"declare ent any;\n"
"declare token varchar;\n"
"declare ses any;\n"
"declare own integer;\n"
"ses := string_output ();\n"
"ent := xml_tree_doc (uddi_req);\n"
"token := cast (xpath_eval (\'/discard_authToken/authInfo\', ent, 1) as varchar);\n"
"if (not length (token))\n"
"signal (\'10120\', \'Authentication token required upon get_registeredInfo call\');\n"
"own := coalesce ((select S_VARS from WS.WS.SESSION where S_OPAQUE = token), NULL);\n"
"if (own is not null)\n"
"signal (\'10110\', \'The passed authentication token has been expired\');\n"
"\n"
"http (sprintf (\'<registeredInfo generic=\"1.0\" operator=\"%s\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"\n"
"declare fnd integer;\n"
"fnd := 0;\n"
"\n"
"for select BE_NAME, BE_OPERATOR, BE_AUTHORIZED_NAME, BE_BUSINESS_KEY\n"
"from UDDI..BUSINESS_ENTITY where BE_OWNER = own do\n"
"{\n"
"if (not fnd)\n"
"{\n"
"http (\'<businessInfos>\', ses);\n"
"fnd := 1;\n"
"}\n"
"http (sprintf (\'<businessInfo businessKey=\"%s\">\', BE_BUSINESS_KEY), ses);\n"
"http_value (BE_NAME, \'name\', ses);\n"
"DESCRIPTIONS (BE_BUSINESS_KEY, \'businessEntity\', ses);\n"
"SERVICE_INFOS (BE_BUSINESS_KEY, \'businessEntity\', ses);\n"
"http (\'</businessInfo>\', ses);\n"
"}\n"
"\n"
"if (fnd)\n"
"http (\'</businessInfos>\', ses);\n"
"else\n"
"http (\'<businessInfos/>\', ses);\n"
"\n"
"fnd := 0;\n"
"for select TM_TMODEL_KEY, TM_NAME from\n"
"TMODEL where TM_OWNER = own do\n"
"{\n"
"if (not fnd)\n"
"{\n"
"http (\'<tModelInfos>\', ses);\n"
"fnd := 1;\n"
"}\n"
"http (sprintf (\'<tModelInfo tModelKey=\"%s\">\', TM_TMODEL_KEY), ses);\n"
"http_value (TM_NAME, \'name\', ses);\n"
"http (\'</tModelInfo>\', ses);\n"
"}\n"
"if (fnd)\n"
"http (\'</tModelInfos>\', ses);\n"
"else\n"
"http (\'<tModelInfos/>\', ses);\n"
"\n"
"http (\'</registeredInfo>\', ses);\n"
"return (string_output_string(ses));\n"
"}\n"
"--src uddi.sql:1624\n";

static const char *proc35 = 
"#line 1691 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"VERIFY_AUTH_INFO (in token varchar)\n"
"{\n"
"\n"
"return 1;\n"
"declare own integer;\n"
"if (not length (token))\n"
"signal (\'10120\', \'Authentication token required in the call\');\n"
"own := coalesce ((select S_VARS from WS.WS.SESSION where S_OPAQUE = token), NULL);\n"
"if (own is not null)\n"
"signal (\'10110\', \'The passed authentication token has been expired\');\n"
"return own;\n"
"}\n"
"--src uddi.sql:1689\n";

static const char *proc36 = 
"#line 1708 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_GET_BUSINESSDETAILEXT (in uddi_req any)\n"
"{\n"
"return get_businessDetail (uddi_req);\n"
"}\n"
"--src uddi.sql:1706\n";

static const char *proc37 = 
"#line 1715 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_GET_BUSINESSDETAIL (in uddi_req any)\n"
"{\n"
"declare ret, ent, ses, bk_arr any;\n"
"ent := xml_tree_doc (uddi_req);\n"
"ses := string_output ();\n"
"bk_arr := xpath_eval (\'/get_businessDetail/businessKey\', ent, 0);\n"
"\n"
"if (not isarray(bk_arr))\n"
"bk_arr := vector ();\n"
"\n"
"BUSINESS_DETAIL (bk_arr, ses);\n"
"\n"
"ses :=  string_output_string (ses);\n"
"return (ses);\n"
"}\n"
"--src uddi.sql:1713\n";

static const char *proc38 = 
"#line 1733 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"BUSINESS_DETAIL (in bk_arr any, inout ses any)\n"
"{\n"
"declare ix, len, fnd integer;\n"
"declare bk varchar;\n"
"ix := 0; len := length (bk_arr);\n"
"\n"
"while (ix < len)\n"
"{\n"
"bk := aref (bk_arr, ix);\n"
"ix := ix + 1;\n"
"\n"
"if (bk is not null)\n"
"bk := cast (bk as varchar);\n"
"else\n"
"signal (\'10500\', \'The businessKey passed is not a string value\');\n"
"\n"
"fnd := 0;\n"
"for select BE_NAME, BE_OPERATOR, BE_AUTHORIZED_NAME from BUSINESS_ENTITY where BE_BUSINESS_KEY = bk do\n"
"{\n"
"if (ix = 1)\n"
"http (sprintf (\'<businessDetail generic=\"1.0\" operator=\"%s\" truncated=\"false\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"\n"
"http (sprintf (\'<businessEntity businessKey=\"%s\" operator=\"%s\" authorizedName=\"%s\">\', bk, BE_OPERATOR, BE_AUTHORIZED_NAME), ses);\n"
"http_value (BE_NAME, \'name\', ses);\n"
"DISCOVERY_URLS (bk, \'businessEntity\', ses);\n"
"DESCRIPTIONS (bk, \'businessEntity\', ses);\n"
"CONTACTS (bk, \'businessEntity\', ses);\n"
"BUSINESS_SERVICES (bk, \'businessEntity\', ses);\n"
"IDENTIFIER_BAG (bk, \'businessEntity\', ses);\n"
"CATEGORY_BAG (bk,\'businessEntity\',ses);\n"
"\n"
"http (\'</businessEntity>\', ses);\n"
"fnd := 1;\n"
"}\n"
"if (not fnd)\n"
"signal (\'10210\', sprintf (\'The passed businessKey (%s) value do match any record\', bk));\n"
"}\n"
"if (ix)\n"
"http (\'</businessDetail>\', ses);\n"
"}\n"
"--src uddi.sql:1731\n";

static const char *proc39 = 
"#line 1777 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_GET_BINDINGDETAIL (in uddi_req any)\n"
"{\n"
"declare ret, ent, ses, bk_arr any;\n"
"declare bk varchar;\n"
"ent := xml_tree_doc (uddi_req);\n"
"ses := string_output ();\n"
"bk_arr := xpath_eval (\'/get_bindingDetail/bindingKey\', ent, 0);\n"
"if (not isarray(bk_arr))\n"
"bk_arr := vector ();\n"
"\n"
"BINDING_DETAIL (bk_arr, ses);\n"
"\n"
"ses :=  string_output_string (ses);\n"
"\n"
"return (ses);\n"
"}\n"
"--src uddi.sql:1775\n";

static const char *proc40 = 
"#line 1797 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"BINDING_DETAIL (in bk_arr any, inout ses any)\n"
"{\n"
"declare ix, len, fnd integer;\n"
"declare bk varchar;\n"
"ix := 0; len := length (bk_arr);\n"
"\n"
"while (ix < len)\n"
"{\n"
"bk := aref (bk_arr, ix);\n"
"ix := ix + 1;\n"
"if (bk is not null)\n"
"bk := cast (bk as varchar);\n"
"else\n"
"signal (\'10500\', \'The bindingKey passed is not a string value\');\n"
"\n"
"fnd := 0;\n"
"for select BT_SERVICE_KEY, BT_ACCESS_POINT, BT_HOSTING_REDIRECTOR, BT_URL_TYPE, BT_BINDING_KEY\n"
"from BINDING_TEMPLATE where BT_BINDING_KEY = bk do\n"
"{\n"
"if (ix = 1)\n"
"http (sprintf (\'<bindingDetail generic=\"1.0\" operator=\"%s\" truncated=\"false\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"http (sprintf (\'<bindingTemplate bindingKey=\"%s\" serviceKey=\"%s\">\', BT_BINDING_KEY, BT_SERVICE_KEY), ses);\n"
"DESCRIPTIONS (BT_BINDING_KEY, \'bindingTemplate\', ses);\n"
"\n"
"if (BT_ACCESS_POINT is not null)\n"
"{\n"
"\n"
"http (sprintf (\'<accessPoint URLType=\"%s\">\', BT_URL_TYPE), ses);\n"
"http_value (BT_ACCESS_POINT, NULL , ses);\n"
"http (\'</accessPoint>\', ses);\n"
"}\n"
"else\n"
"http (sprintf (\'<hostingRedirector bindingKey=\"%s\"/>\', BT_BINDING_KEY), ses);\n"
"\n"
"TMODEL_INSTANCE_DETAILS (BT_BINDING_KEY, \'bindingTemplate\', ses);\n"
"\n"
"http (\'</bindingTemplate>\', ses);\n"
"fnd := 1;\n"
"}\n"
"if (not fnd)\n"
"signal (\'10210\', sprintf (\'The passed bindingKey (%s) value do match any record\', bk));\n"
"}\n"
"if (ix)\n"
"http (\'</bindingDetail>\', ses);\n"
"}\n"
"--src uddi.sql:1795\n";

static const char *proc41 = 
"#line 1846 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_GET_TMODELDETAIL (in uddi_req any)\n"
"{\n"
"\n"
"declare ret, ent, ses, bk_arr any;\n"
"declare bk varchar;\n"
"declare ix, len, fnd integer;\n"
"ent := xml_tree_doc (uddi_req);\n"
"ses := string_output ();\n"
"bk_arr := xpath_eval (\'/get_tModelDetail/tModelKey\', ent, 0);\n"
"if (not isarray(bk_arr))\n"
"bk_arr := vector ();\n"
"\n"
"TMODEL_DETAIL (bk_arr, ses);\n"
"ses :=  string_output_string (ses);\n"
"return (ses);\n"
"\n"
"}\n"
"--src uddi.sql:1844\n";

static const char *proc42 = 
"#line 1866 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"TMODEL_DETAIL (in bk_arr any, inout ses any)\n"
"{\n"
"declare ix, len, fnd integer;\n"
"declare bk varchar;\n"
"ix := 0; len := length (bk_arr);\n"
"\n"
"while (ix < len)\n"
"{\n"
"bk := aref (bk_arr, ix);\n"
"ix := ix + 1;\n"
"if (bk is not null)\n"
"bk := cast (bk as varchar);\n"
"else\n"
"signal (\'10500\', \'The tModelKey passed is not a string value\');\n"
"\n"
"fnd := 0;\n"
"for select TM_TMODEL_KEY, TM_AUTHORIZED_NAME, TM_OPERATOR, TM_NAME\n"
"from TMODEL where TM_TMODEL_KEY = bk do\n"
"{\n"
"if (ix = 1)\n"
"http (sprintf (\'<tModelDetail generic=\"1.0\" operator=\"%s\" truncated=\"false\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"\n"
"http (sprintf (\'<tModel tModelKey=\"%s\" operator=\"%s\" authorizedName=\"%s\">\', TM_TMODEL_KEY, TM_OPERATOR, TM_AUTHORIZED_NAME), ses);\n"
"http_value (TM_NAME, \'name\', ses);\n"
"\n"
"OVERVIEW_DOC (TM_TMODEL_KEY, \'tModel\', ses);\n"
"IDENTIFIER_BAG (TM_TMODEL_KEY, \'tModel\', ses);\n"
"CATEGORY_BAG (TM_TMODEL_KEY, \'tModel\', ses);\n"
"http (\'</tModel>\', ses);\n"
"fnd := 1;\n"
"}\n"
"if (not fnd)\n"
"signal (\'10210\', sprintf (\'The passed tModelKey (%s) value do match any record\', bk));\n"
"}\n"
"if (ix)\n"
"http (\'</tModelDetail>\', ses);\n"
"}\n"
"--src uddi.sql:1864\n";

static const char *proc43 = 
"#line 1907 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_GET_SERVICEDETAIL (in uddi_req any)\n"
"{\n"
"declare ret, ent, ses, bk_arr any;\n"
"declare bk varchar;\n"
"declare ix, len, fnd integer;\n"
"ent := xml_tree_doc (uddi_req);\n"
"ses := string_output ();\n"
"bk_arr := xpath_eval (\'/get_serviceDetail/serviceKey\', ent, 0);\n"
"if (not isarray(bk_arr))\n"
"bk_arr := vector ();\n"
"\n"
"SERVICE_DETAIL (bk_arr, ses);\n"
"ses :=  string_output_string (ses);\n"
"return (ses);\n"
"}\n"
"--src uddi.sql:1905\n";

static const char *proc44 = 
"#line 1925 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SERVICE_DETAIL (in bk_arr any, inout ses any)\n"
"{\n"
"declare ix, len, fnd integer;\n"
"declare bk varchar;\n"
"ix := 0; len := length (bk_arr);\n"
"\n"
"while (ix < len)\n"
"{\n"
"bk := aref (bk_arr, ix);\n"
"ix := ix + 1;\n"
"if (bk is not null)\n"
"bk := cast (bk as varchar);\n"
"else\n"
"signal (\'10500\', \'The serviceKey passed is not a string value\');\n"
"\n"
"fnd := 0;\n"
"for select BS_BUSINESS_KEY, BS_NAME, BS_SERVICE_KEY\n"
"from BUSINESS_SERVICE where BS_SERVICE_KEY = bk do\n"
"{\n"
"if (ix = 1)\n"
"http (sprintf (\'<serviceDetail generic=\"1.0\" operator=\"%s\" truncated=\"false\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"http (sprintf (\'<businessService serviceKey=\"%s\" businessKey=\"%s\">\', BS_SERVICE_KEY, BS_BUSINESS_KEY), ses);\n"
"DESCRIPTIONS (BS_SERVICE_KEY,\'businessService\',ses);\n"
"http_value (BS_NAME, \'name\', ses);\n"
"BINDING_TEMPLATES (BS_SERVICE_KEY,\'businessService\',ses);\n"
"CATEGORY_BAG (BS_SERVICE_KEY,\'businessService\',ses);\n"
"http (\'</businessService>\', ses);\n"
"fnd := 1;\n"
"}\n"
"if (not fnd)\n"
"signal (\'10210\', sprintf (\'The passed serviceKey (%s) value do match any record\', bk));\n"
"}\n"
"if (ix)\n"
"http (\'</serviceDetail>\', ses);\n"
"}\n"
"--src uddi.sql:1923\n";

static const char *proc45 = 
"#line 1965 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"TMODEL_INSTANCE_DETAILS (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"for select ID_KEY, ID_BINDING_KEY, ID_TMODEL_KEY, ID_PARMS from INSTANCE_DETAIL\n"
"where ID_BINDING_KEY = id do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"http (\'<tModelInstanceDetails>\', ses);\n"
"http ( sprintf (\'<tModelInstanceInfo tModelKey=\"%s\">\', ID_TMODEL_KEY), ses);\n"
"DESCRIPTIONS (ID_KEY, \'tModelInstanceInfo\', ses);\n"
"http (\'<instanceDetails>\', ses);\n"
"DESCRIPTIONS (ID_KEY, \'instanceDetails\', ses);\n"
"OVERVIEW_DOC (ID_KEY, \'tModelInstanceInfo\', ses);\n"
"if (ID_PARMS <> \'\')\n"
"http (sprintf (\'<instanceParms>%s</instanceParms>\', ID_PARMS), ses);\n"
"http (\'</instanceDetails>\', ses);\n"
"http (\'</tModelInstanceInfo>\', ses);\n"
"}\n"
"if (ix)\n"
"http (\'</tModelInstanceDetails>\', ses);\n"
"else\n"
"http (\'<tModelInstanceDetails/>\', ses);\n"
"}\n"
"--src uddi.sql:1963\n";

static const char *proc46 = 
"#line 1994 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"OVERVIEW_DOC (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"\n"
"for select OV_KEY, OV_URL from OVERVIEW_DOC\n"
"where OV_PARENT_ID  = id and OV_PARENT_TYPE = elm do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"http (\'<overviewDoc>\', ses);\n"
"DESCRIPTIONS (OV_KEY, \'overviewDoc\', ses);\n"
"http (sprintf (\'<overviewURL>%s</overviewURL>\', OV_URL), ses);\n"
"}\n"
"\n"
"if (ix)\n"
"http (\'</overviewDoc>\', ses);\n"
"\n"
"}\n"
"--src uddi.sql:1992\n";

static const char *proc47 = 
"#line 2018 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"DISCOVERY_URLS (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"for select DU_URL, DU_USE_TYPE from DISCOVERY_URL\n"
"where DU_PARENT_ID = id and DU_PARENT_TYPE = elm do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"http (\'<discoveryURLs>\', ses);\n"
"http (sprintf (\'<discoveryURL useType=\"%s\">%s</discoveryURL>\', DU_USE_TYPE, DU_URL), ses);\n"
"}\n"
"if (ix)\n"
"http (\'</discoveryURLs>\', ses);\n"
"}\n"
"--src uddi.sql:2016\n";

static const char *proc48 = 
"#line 2037 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"BUSINESS_SERVICES (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"for select BS_SERVICE_KEY, BS_NAME from BUSINESS_SERVICE where BS_BUSINESS_KEY = id do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"http (\'<businessServices>\', ses);\n"
"http (sprintf (\'<businessService serviceKey=\"%s\" businessKey=\"%s\">\', BS_SERVICE_KEY, id), ses);\n"
"DESCRIPTIONS (BS_SERVICE_KEY,\'businessService\',ses);\n"
"http_value (BS_NAME, \'name\', ses);\n"
"BINDING_TEMPLATES (BS_SERVICE_KEY,\'businessService\',ses);\n"
"CATEGORY_BAG (BS_SERVICE_KEY,\'businessService\',ses);\n"
"http (\'</businessService>\', ses);\n"
"}\n"
"if (ix)\n"
"http (\'</businessServices>\', ses);\n"
"\n"
"}\n"
"--src uddi.sql:2035\n";

static const char *proc49 = 
"#line 2061 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"BINDING_TEMPLATES (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"\n"
"for select BT_BINDING_KEY, BT_ACCESS_POINT, BT_HOSTING_REDIRECTOR, BT_URL_TYPE from BINDING_TEMPLATE\n"
"where BT_SERVICE_KEY = id do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"http (\'<bindingTemplates>\', ses);\n"
"http (sprintf (\'<bindingTemplate bindingKey=\"%s\" serviceKey=\"%s\">\', BT_BINDING_KEY, id), ses);\n"
"DESCRIPTIONS (BT_BINDING_KEY, \'bindingTemplate\', ses);\n"
"\n"
"if (BT_ACCESS_POINT is not null)\n"
"{\n"
"\n"
"http (sprintf (\'<accessPoint URLType=\"%s\">\', BT_URL_TYPE), ses);\n"
"http_value (BT_ACCESS_POINT, NULL, ses);\n"
"http (\'</accessPoint>\', ses);\n"
"}\n"
"else\n"
"http (sprintf (\'<hostingRedirector bindingKey=\"%s\"/>\', BT_BINDING_KEY), ses);\n"
"\n"
"TMODEL_INSTANCE_DETAILS (BT_BINDING_KEY, \'bindingTemplate\', ses);\n"
"\n"
"http (\'</bindingTemplate>\', ses);\n"
"}\n"
"if (ix)\n"
"http (\'</bindingTemplates>\', ses);\n"
"else\n"
"http (\'<bindingTemplates/>\', ses);\n"
"\n"
"}\n"
"--src uddi.sql:2059\n";

static const char *proc50 = 
"#line 2099 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"CATEGORY_BAG (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"for select CB_TMODEL_KEY_ID, CB_KEY_NAME, CB_KEY_VALUE from CATEGORY_BAG\n"
"where CB_PARENT_ID = id and CB_PARENT_TYPE = elm do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"http (\'<categoryBag>\', ses);\n"
"http (sprintf (\'<keyedReference tModelKey=\"%s\" keyName=\"%s\" keyValue=\"%s\"/>\',CB_TMODEL_KEY_ID,CB_KEY_NAME,CB_KEY_VALUE), ses);\n"
"}\n"
"if (ix)\n"
"http (\'</categoryBag>\', ses);\n"
"}\n"
"--src uddi.sql:2097\n";

static const char *proc51 = 
"#line 2118 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"IDENTIFIER_BAG (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"for select IB_TMODEL_KEY_ID, IB_KEY_NAME, IB_KEY_VALUE from IDENTIFIER_BAG\n"
"where IB_PARENT_ID = id and IB_PARENT_TYPE = elm do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"http (\'<identifierBag>\', ses);\n"
"if (IB_TMODEL_KEY_ID = \'\')\n"
"http (sprintf (\'<keyedReference keyName=\"%s\" keyValue=\"%s\"/>\', IB_KEY_NAME, IB_KEY_VALUE), ses);\n"
"else\n"
"http (sprintf (\'<keyedReference tModelKey=\"%s\" keyName=\"%s\" keyValue=\"%s\"/>\',IB_TMODEL_KEY_ID,IB_KEY_NAME,IB_KEY_VALUE), ses);\n"
"}\n"
"if (ix)\n"
"http (\'</identifierBag>\', ses);\n"
"}\n"
"--src uddi.sql:2116\n";

static const char *proc52 = 
"#line 2141 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"DESCRIPTIONS (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"for select UD_DESC, UD_LANG from DESCRIPTION where UD_PARENT_ID = id and UD_TYPE = elm do\n"
"{\n"
"http_value (UD_DESC, \'description\',  ses);\n"
"\n"
"\n"
"\n"
"\n"
"}\n"
"}\n"
"--src uddi.sql:2139\n";

static const char *proc53 = 
"#line 2157 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"CONTACTS (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"\n"
"for select CO_CONTACT_KEY, CO_USE_TYPE, CO_PERSONAL_NAME from CONTACTS where CO_BUSINESS_ID = id do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"http (\'<contacts>\', ses);\n"
"if (CO_USE_TYPE is not null)\n"
"http (sprintf (\'<contact useType=\"%s\">\', CO_USE_TYPE), ses);\n"
"else\n"
"http (sprintf (\'<contact>\'), ses);\n"
"DESCRIPTIONS (CO_CONTACT_KEY, \'contacts\', ses);\n"
"PHONE (CO_CONTACT_KEY, \'contacts\', ses);\n"
"EMAIL (CO_CONTACT_KEY, \'contacts\', ses);\n"
"ADDRESS (CO_CONTACT_KEY, \'contacts\', ses);\n"
"http_value (CO_PERSONAL_NAME, \'personName\', ses);\n"
"http (\'</contact>\', ses);\n"
"}\n"
"\n"
"if (ix)\n"
"http (\'</contacts>\', ses);\n"
"\n"
"}\n"
"--src uddi.sql:2155\n";

static const char *proc54 = 
"#line 2187 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"PHONE (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"for select PH_PHONE, PH_USE_TYPE from PHONE where PH_CONTACT_KEY = id do\n"
"{\n"
"http (sprintf (\'<phone useType=\"%s\">%s</phone>\', PH_USE_TYPE, PH_PHONE), ses);\n"
"}\n"
"}\n"
"--src uddi.sql:2185\n";

static const char *proc55 = 
"#line 2198 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"EMAIL (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"for select EM_ADDR, EM_USE_TYPE from EMAIL where EM_CONTACT_KEY = id do\n"
"{\n"
"http (sprintf (\'<email useType=\"%s\">%s</email>\', EM_USE_TYPE, EM_ADDR), ses);\n"
"}\n"
"}\n"
"--src uddi.sql:2196\n";

static const char *proc56 = 
"#line 2210 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"ADDRESS (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"for select distinct AL_USE_TYPE from ADDRESS_LINE\n"
"where AL_PARENT_ID = id and AL_PARENT_TYPE = elm do\n"
"{\n"
"ADDRESS_2 (id, elm, ses, AL_USE_TYPE);\n"
"}\n"
"}\n"
"--src uddi.sql:2208\n";

static const char *proc57 = 
"#line 2224 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"ADDRESS_2 (in id varchar, in elm varchar, inout ses any, in _use varchar)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"for select AL_USE_TYPE, AL_SORT_CODE, AL_LINE from ADDRESS_LINE\n"
"where AL_PARENT_ID = id and AL_PARENT_TYPE = elm and (AL_USE_TYPE = _use or AL_USE_TYPE is NULL) do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"{\n"
"http (\'<address\', ses);\n"
"if (AL_USE_TYPE is not null)\n"
"http (sprintf (\' useType=\"%s\"\', AL_USE_TYPE), ses);\n"
"if (AL_SORT_CODE is not null)\n"
"http (sprintf (\' sortCode=\"%s\"\', AL_SORT_CODE), ses);\n"
"http (\'>\', ses);\n"
"}\n"
"http_value (AL_LINE, \'addressLine\' , ses);\n"
"}\n"
"\n"
"if (ix)\n"
"http (\'</address>\', ses);\n"
"\n"
"}\n"
"--src uddi.sql:2222\n";

static const char *proc58 = 
"#line 2252 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"QUAL_MATCH (in s1 varchar, in s2 varchar, in ex integer, in ca integer)\n"
"{\n"
"if (length (s2) > 128)\n"
"signal (\'10020\', sprintf (\'The search name is too long (%d)\', length (s2)));\n"
"if (ca)\n"
"{\n"
"s1 := upper (cast (s1 as varchar));\n"
"s2 := upper (cast (s2 as varchar));\n"
"}\n"
"\n"
"if (ex and s1 = s2)\n"
"return 1;\n"
"else if (not ex and s1 like concat (s2, \'%\'))\n"
"return 1;\n"
"return 0;\n"
"}\n"
"--src uddi.sql:2250\n";

static const char *proc59 = 
"#line 2272 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_FIND_BUSINESS (in uddi_req any)\n"
"{\n"
"declare ret, ent, ses, bk_arr, names, cat, idn, url, tmd any;\n"
"declare bk, saved_bs varchar;\n"
"declare ix, len, fnd, st integer;\n"
"declare max_rows integer;\n"
"declare ordering varchar;\n"
"declare exact, nocase, sn_asc, sn_desc, sd_asc, sd_desc integer;\n"
"declare criteria integer;\n"
"declare dta, elm any;\n"
"declare qry varchar;\n"
"declare rx, rlen integer;\n"
"declare sorts varchar;\n"
"\n"
"\n"
"\n"
"\n"
"ent := xml_tree_doc (uddi_req);\n"
"ses := string_output ();\n"
"\n"
"st := 1; saved_bs := \'\'; criteria := 0;\n"
"\n"
"\n"
"\n"
"names := xpath_eval (\'/find_business/name\', ent, 0);\n"
"cat := xpath_eval (\'/find_business/categoryBag/keyedReference\', ent, 0);\n"
"idn := xpath_eval (\'/find_business/identifierBag/keyedReference\', ent, 0);\n"
"tmd := xpath_eval (\'/find_business/tModelBag/tModelKey\', ent, 0);\n"
"url := xpath_eval (\'/find_business/discoveryURLs/discoveryURL\', ent, 0);\n"
"max_rows := coalesce (atoi (cast (xpath_eval (\'/find_business/@maxRows\', ent, 1) as varchar)), 100);\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"ordering := xpath_eval (\'/find_business/findQualifiers/findQualifier\', ent, 0);\n"
"exact := 0; nocase := 1; sn_asc := 0; sn_desc := 0; sd_asc := 0; sd_desc := 0;\n"
"if (isarray (ordering))\n"
"{\n"
"declare sq varchar;\n"
"len := length (ordering); ix := 0;\n"
"while (ix < len)\n"
"{\n"
"sq := cast (aref (ordering, ix) as varchar);\n"
"if (sq = \'exactNameMatch\')\n"
"exact := 1;\n"
"else if (sq = \'caseSensitiveMatch\')\n"
"nocase := 0;\n"
"else if (sq = \'sortByNameAsc\')\n"
"sn_asc := 1;\n"
"else if (sq = \'sortByNameDesc\')\n"
"sn_desc := 1;\n"
"else if (sq = \'sortByDateAsc\')\n"
"sd_asc := 1;\n"
"else if (sq = \'sortByDateDesc\')\n"
"sd_desc := 1;\n"
"ix := ix + 1;\n"
"}\n"
"}\n"
"\n"
"if ((sn_asc and sn_desc) or (sd_asc and sd_desc))\n"
"signal (\'10030\', \'Mutual exclusive sort options supplied\');\n"
"\n"
"sorts := sprintf (\' %s %s \',\n"
"case sn_asc + (sn_desc * 2)\n"
"when 0 then \'\'\n"
"when 1 then \'ORDER BY BE_NAME\'\n"
"else \'ORDER BY BE_NAME DESC\' end,\n"
"case sd_asc + (sd_desc * 2) + ((sn_asc + sn_desc) * 3)\n"
"when 0 then \'\'\n"
"when 1 then \'ORDER BY BE_CHANGED\'\n"
"when 2 then \'ORDER BY BE_CHANGED DESC\'\n"
"when 3 then \'\'\n"
"when 4 then  \', BE_CHANGED\'\n"
"else \', BE_CHANGED DESC\'\n"
"end);\n"
"\n"
"if (length(names))\n"
"{\n"
"\n"
"bk_arr := names;\n"
"st := 1;\n"
"criteria := criteria + 1;\n"
"}\n"
"\n"
"if (length(idn))\n"
"{\n"
"\n"
"bk_arr := idn;\n"
"st := 2;\n"
"criteria := criteria + 1;\n"
"}\n"
"\n"
"if (length(cat))\n"
"{\n"
"\n"
"bk_arr := cat;\n"
"st := 3;\n"
"criteria := criteria + 1;\n"
"}\n"
"\n"
"if (length(tmd))\n"
"{\n"
"\n"
"bk_arr := tmd;\n"
"st := 4;\n"
"criteria := criteria + 1;\n"
"}\n"
"\n"
"if (length(url))\n"
"{\n"
"\n"
"bk_arr := url;\n"
"st := 5;\n"
"criteria := criteria + 1;\n"
"}\n"
"\n"
"if (criteria <> 1)\n"
"signal (\'10030\', \'Too many options for find_business request\');\n"
"\n"
"if (not isarray(bk_arr))\n"
"signal (\'10050\', \'The search criteria not passed\');\n"
"\n"
"ix := 0; len := length (bk_arr); fnd := 0;\n"
"http (sprintf (\'<businessList generic=\"1.0\" operator=\"%s\" truncated=\"false\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"while (ix < len)\n"
"{\n"
"bk := aref (bk_arr, ix);\n"
"ix := ix + 1;\n"
"if (bk is null)\n"
"signal (\'10500\', \'Passed an un-recognizable value\');\n"
"\n"
"if (st = 1)\n"
"{\n"
"bk := cast (bk as varchar);\n"
"qry := sprintf (\'select BE_NAME, BE_OPERATOR, BE_AUTHORIZED_NAME, BE_BUSINESS_KEY\n"
"from UDDI..BUSINESS_ENTITY where 1 = UDDI..QUAL_MATCH (BE_NAME, ?, ?, ?) %s \', sorts);\n"
"\n"
"exec (qry, null, null, vector (bk, exact, nocase), 100, null, dta);\n"
"}\n"
"else if (st = 2)\n"
"{\n"
"\n"
"declare ikey, ival, tkid varchar;\n"
"ikey := upper (cast (xpath_eval (\'@keyName\',  bk, 1) as varchar));\n"
"ival := upper (cast (xpath_eval (\'@keyValue\', bk, 1) as varchar));\n"
"tkid := upper (cast (xpath_eval (\'@tModelKey\', bk, 1) as varchar));\n"
"qry := sprintf (\'select distinct  BE_NAME, BE_OPERATOR, BE_AUTHORIZED_NAME, BE_BUSINESS_KEY\n"
"from UDDI..IDENTIFIER_BAG, UDDI..BUSINESS_ENTITY\n"
"where IB_KEY_NAME = ? and IB_KEY_VALUE = ? and IB_TMODEL_KEY_ID = ?\n"
"and IB_PARENT_TYPE = \\\'businessEntity\\\' and IB_PARENT_ID = BE_BUSINESS_KEY %s\', sorts);\n"
"exec (qry, null, null, vector (ikey, ival, tkid), 100, null, dta);\n"
"}\n"
"else if (st = 3)\n"
"{\n"
"\n"
"\n"
"declare ckey, cval varchar;\n"
"ckey := cast (xpath_eval (\'@keyName\',  bk, 1) as varchar);\n"
"cval := cast (xpath_eval (\'@keyValue\', bk, 1) as varchar);\n"
"\n"
"qry := sprintf (\'select distinct BE_NAME, BE_OPERATOR, BE_AUTHORIZED_NAME, BE_BUSINESS_KEY\n"
"from UDDI..CATEGORY_BAG, UDDI..BUSINESS_ENTITY\n"
"where CB_KEY_NAME = ? and CB_KEY_VALUE = ?\n"
"and CB_PARENT_TYPE = \\\'businessEntity\\\' and CB_PARENT_ID = BE_BUSINESS_KEY %s\', sorts);\n"
"exec (qry, null, null, vector (ckey, cval), 100, null, dta);\n"
"}\n"
"else if (st = 4)\n"
"{\n"
"\n"
"bk := cast (bk as varchar);\n"
"if (not exists (select 1 from TMODEL where TM_TMODEL_KEY = bk))\n"
"signal (\'10210\', \'The specified binding key cannot be found in any tModel\');\n"
"qry := sprintf (\'select distinct  BE_NAME, BE_OPERATOR, BE_AUTHORIZED_NAME, BE_BUSINESS_KEY\n"
"from  UDDI..INSTANCE_DETAIL, UDDI..BINDING_TEMPLATE, UDDI..BUSINESS_SERVICE, UDDI..BUSINESS_ENTITY\n"
"where ID_TMODEL_KEY = ?\n"
"and ID_BINDING_KEY = BT_BINDING_KEY\n"
"and BT_SERVICE_KEY = BS_SERVICE_KEY\n"
"and BS_BUSINESS_KEY = BE_BUSINESS_KEY %s \', sorts);\n"
"exec (qry, null, null, vector (bk), 100, null, dta);\n"
"}\n"
"else if (st = 5)\n"
"{\n"
"\n"
"bk := cast (bk as varchar);\n"
"qry := sprintf (\'select distinct BE_NAME, BE_OPERATOR, BE_AUTHORIZED_NAME, BE_BUSINESS_KEY\n"
"from  UDDI..DISCOVERY_URL, UDDI..BUSINESS_ENTITY\n"
"where DU_URL = ? and DU_PARENT_TYPE = \\\'businessEntity\\\' and DU_PARENT_ID = BE_BUSINESS_KEY %s\',sorts);\n"
"exec (qry, null, null, vector (bk), 100, null, dta);\n"
"}\n"
"else\n"
"signal (\'10050\', \'The search condition is not supported\');\n"
"\n"
"\n"
"rx := 0; rlen := length (dta);\n"
"while (rx < rlen)\n"
"{\n"
"elm := aref (dta, rx);\n"
"if (not fnd)\n"
"{\n"
"saved_bs := aref (elm ,3);\n"
"\n"
"http (\'<businessInfos>\', ses);\n"
"fnd := 1;\n"
"}\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"http (sprintf (\'<businessInfo businessKey=\"%s\">\', aref (elm ,3)), ses);\n"
"http_value (aref (elm, 0), \'name\', ses);\n"
"DESCRIPTIONS (aref (elm, 3), \'businessEntity\', ses);\n"
"SERVICE_INFOS (aref (elm, 3), \'businessEntity\', ses);\n"
"\n"
"http (\'</businessInfo>\', ses);\n"
"\n"
"rx := rx + 1;\n"
"}\n"
"\n"
"\n"
"}\n"
"not_match:\n"
"if (fnd)\n"
"http (\'</businessInfos>\', ses);\n"
"else\n"
"http (\'<businessInfos/>\', ses);\n"
"http (\'</businessList>\', ses);\n"
"ses :=  string_output_string (ses);\n"
"return (ses);\n"
"}\n"
"--src uddi.sql:2270\n";

static const char *proc60 = 
"#line 2512 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"SERVICE_INFOS (in id varchar, in elm varchar, inout ses any)\n"
"{\n"
"declare ix integer;\n"
"ix := 0;\n"
"for select BS_SERVICE_KEY, BS_NAME from BUSINESS_SERVICE where BS_BUSINESS_KEY = id do\n"
"{\n"
"ix := ix + 1;\n"
"if (ix = 1)\n"
"http (\'<serviceInfos>\', ses);\n"
"http (sprintf (\'<serviceInfo serviceKey=\"%s\" businessKey=\"%s\">\', BS_SERVICE_KEY, id), ses);\n"
"http_value (BS_NAME, \'name\', ses);\n"
"http (\'</serviceInfo>\', ses);\n"
"}\n"
"if (ix)\n"
"http (\'</serviceInfos>\', ses);\n"
"else\n"
"http (\'<serviceInfos/>\', ses);\n"
"\n"
"}\n"
"--src uddi.sql:2510\n";

static const char *proc61 = 
"#line 2536 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_FIND_BINDING (in uddi_req any)\n"
"{\n"
"declare ret, ent, ses, bk_arr any;\n"
"declare bk, saved_bs, serv_key varchar;\n"
"declare ix, len, fnd, st integer;\n"
"declare max_rows integer;\n"
"declare ordering varchar;\n"
"declare exact, mcase, sn_asc, sn_desc, sd_asc, sd_desc integer;\n"
"declare criteria integer;\n"
"declare dta, elm any;\n"
"declare qry varchar;\n"
"declare rx, rlen integer;\n"
"\n"
"ent := xml_tree_doc (uddi_req);\n"
"ses := string_output ();\n"
"\n"
"st := 1; saved_bs := \'\';\n"
"\n"
"\n"
"\n"
"bk_arr := xpath_eval (\'/find_binding/tModelBag/tModelKey\', ent, 0);\n"
"\n"
"serv_key := cast (xpath_eval (\'/find_binding/@serviceKey\', ent, 1) as varchar);\n"
"\n"
"max_rows := coalesce (atoi (cast (xpath_eval (\'/find_binding/@maxRows\', ent, 1) as varchar)), 100);\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"ordering := xpath_eval (\'/find_binding/findQualifiers/findQualifier\', ent, 0);\n"
"exact := 0; mcase := 0; sn_asc := 0; sn_desc := 0; sd_asc := 0; sd_desc := 0;\n"
"if (isarray (ordering))\n"
"{\n"
"declare sq varchar;\n"
"len := length (ordering); ix := 0;\n"
"while (ix < len)\n"
"{\n"
"sq := cast (aref (ordering, ix) as varchar);\n"
"if (sq = \'exactNameMatch\')\n"
"exact := 1;\n"
"else if (sq = \'caseSensitiveMatch\')\n"
"mcase := 1;\n"
"else if (sq = \'sortByNameAsc\')\n"
"sn_asc := 1;\n"
"else if (sq = \'sortByNameDesc\')\n"
"sn_desc := 1;\n"
"else if (sq = \'sortByDateAsc\')\n"
"sd_asc := 1;\n"
"else if (sq = \'sortByDateDesc\')\n"
"sd_desc := 1;\n"
"ix := ix + 1;\n"
"}\n"
"}\n"
"\n"
"if (sd_asc and sd_desc)\n"
"signal (\'10030\', \'Mutual exclusive sort options supplied\');\n"
"if (exact or mcase or sn_asc or sn_desc)\n"
"signal (\'10050\', \'Search options caseSensitiveMatch, exactNameMatch , sortByNameAsc and  sortByNameDesc is not supported in this request\');\n"
"\n"
"if (not isarray(bk_arr))\n"
"signal (\'10050\', \'The search criteria not passed\');\n"
"\n"
"ix := 0; len := length (bk_arr); fnd := 0;\n"
"\n"
"http (sprintf (\'<bindingDetail generic=\"1.0\" operator=\"%s\" truncated=\"false\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"while (ix < len)\n"
"{\n"
"bk := aref (bk_arr, ix);\n"
"ix := ix + 1;\n"
"bk := cast (bk as varchar);\n"
"\n"
"\n"
"if (not exists (select 1 from BUSINESS_SERVICE where BS_SERVICE_KEY = serv_key))\n"
"signal (\'10210\', \'The specified service key cannot be found in any service\');\n"
"if (not exists (select 1 from TMODEL where TM_TMODEL_KEY = bk))\n"
"signal (\'10210\', \'The specified binding key cannot be found in any tModel\');\n"
"\n"
"qry := sprintf (\n"
"\'select distinct BT_SERVICE_KEY, BT_ACCESS_POINT, BT_HOSTING_REDIRECTOR, BT_URL_TYPE, BT_BINDING_KEY\n"
"from UDDI..INSTANCE_DETAIL, UDDI..BINDING_TEMPLATE where\n"
"ID_TMODEL_KEY = ?\n"
"and ID_BINDING_KEY = BT_BINDING_KEY\n"
"and BT_SERVICE_KEY = ? %s\',\n"
"case sd_asc + (sd_desc * 2)\n"
"when 0 then \'\'\n"
"when 1 then \'ORDER BY BT_CHANGED\'\n"
"else \'ORDER BY BT_CHANGED DESC\' end\n"
");\n"
"exec (qry, null, null, vector (bk, serv_key), 100, null, dta);\n"
"\n"
"rx := 0; rlen := length (dta);\n"
"while (rx < rlen)\n"
"{\n"
"elm := aref (dta, rx);\n"
"fnd := 1;\n"
"http (sprintf (\'<bindingTemplate bindingKey=\"%s\" serviceKey=\"%s\">\',\n"
"aref (elm, 4), aref (elm, 0)), ses);\n"
"DESCRIPTIONS (aref (elm, 4), \'bindingTemplate\', ses);\n"
"\n"
"if (aref (elm, 1) is not null)\n"
"http (sprintf (\'<accessPoint URLType=\"%s\">%s</accessPoint>\', aref (elm, 3), aref (elm, 1)), ses);\n"
"else\n"
"http (sprintf (\'<hostingRedirector bindingKey=\"%s\"/>\', aref (elm, 4)), ses);\n"
"\n"
"TMODEL_INSTANCE_DETAILS (aref (elm, 4), \'bindingTemplate\', ses);\n"
"http (\'</bindingTemplate>\', ses);\n"
"rx := rx + 1;\n"
"}\n"
"}\n"
"not_match:\n"
"if (not fnd)\n"
"http (\'<bindingTemplate/>\', ses);\n"
"http (\'</bindingDetail>\', ses);\n"
"ses :=  string_output_string (ses);\n"
"return (ses);\n"
"}\n"
"--src uddi.sql:2534\n";

static const char *proc62 = 
"#line 2657 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_FIND_SERVICE (in uddi_req any)\n"
"{\n"
"declare ret, ent, ses, bk_arr, names, cbag, tbag any;\n"
"declare bk, saved_bs, bs_key varchar;\n"
"declare ix, len, fnd, st integer;\n"
"declare max_rows integer;\n"
"declare ordering varchar;\n"
"declare exact, nocase, sn_asc, sn_desc, sd_asc, sd_desc integer;\n"
"declare criteria integer;\n"
"declare dta, elm any;\n"
"declare qry varchar;\n"
"declare rx, rlen integer;\n"
"declare sorts varchar;\n"
"\n"
"\n"
"ent := xml_tree_doc (uddi_req);\n"
"ses := string_output ();\n"
"\n"
"st := 1; saved_bs := \'\';  criteria := 0;\n"
"\n"
"\n"
"\n"
"names := xpath_eval (\'/find_service/name\', ent, 0);\n"
"cbag  := xpath_eval (\'/find_service/categoryBag/keyedReference\', ent, 0);\n"
"tbag  := xpath_eval (\'/find_service/tModelBag/tModelKey\', ent, 0);\n"
"bs_key := cast (xpath_eval (\'/find_service/@businessKey\', ent, 1) as varchar);\n"
"\n"
"if (not exists (select 1 from BUSINESS_ENTITY where BE_BUSINESS_KEY  = bs_key))\n"
"signal (\'10210\', \'The specified businessKey cannot be found in any businessEntity\');\n"
"\n"
"max_rows := coalesce (atoi (cast (xpath_eval (\'/find_service/@maxRows\', ent, 1) as varchar)), 100);\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"ordering := xpath_eval (\'/find_service/findQualifiers/findQualifier\', ent, 0);\n"
"exact := 0; nocase := 1; sn_asc := 0; sn_desc := 0; sd_asc := 0; sd_desc := 0;\n"
"if (isarray (ordering))\n"
"{\n"
"declare sq varchar;\n"
"len := length (ordering); ix := 0;\n"
"while (ix < len)\n"
"{\n"
"sq := cast (aref (ordering, ix) as varchar);\n"
"if (sq = \'exactNameMatch\')\n"
"exact := 1;\n"
"else if (sq = \'caseSensitiveMatch\')\n"
"nocase := 0;\n"
"else if (sq = \'sortByNameAsc\')\n"
"sn_asc := 1;\n"
"else if (sq = \'sortByNameDesc\')\n"
"sn_desc := 1;\n"
"else if (sq = \'sortByDateAsc\')\n"
"sd_asc := 1;\n"
"else if (sq = \'sortByDateDesc\')\n"
"sd_desc := 1;\n"
"ix := ix + 1;\n"
"}\n"
"}\n"
"\n"
"if ((sd_asc and sd_desc) or (sn_desc and sn_asc))\n"
"signal (\'10030\', \'Mutual exclusive sort options supplied\');\n"
"sorts := sprintf (\' %s %s \',\n"
"case sn_asc + (sn_desc * 2)\n"
"when 0 then \'\'\n"
"when 1 then \'ORDER BY BS_NAME\'\n"
"else \'ORDER BY BS_NAME DESC\' end,\n"
"case sd_asc + (sd_desc * 2) + ((sn_asc + sn_desc) * 3)\n"
"when 0 then \'\'\n"
"when 1 then \'ORDER BY BS_CHANGED\'\n"
"when 2 then \'ORDER BY BS_CHANGED DESC\'\n"
"when 3 then \'\'\n"
"when 4 then  \', BS_CHANGED\'\n"
"else \', BS_CHANGED DESC\'\n"
"end);\n"
"\n"
"\n"
"\n"
"if (length (names))\n"
"{\n"
"bk_arr := names;\n"
"st := 1;\n"
"criteria := criteria + 1;\n"
"}\n"
"if (length (cbag))\n"
"{\n"
"bk_arr := cbag;\n"
"st := 2;\n"
"criteria := criteria + 1;\n"
"}\n"
"if (length (tbag))\n"
"{\n"
"bk_arr := tbag;\n"
"st := 3;\n"
"criteria := criteria + 1;\n"
"}\n"
"\n"
"if (criteria <> 1)\n"
"signal (\'10030\', \'Too many options for find_business request\');\n"
"\n"
"if (not isarray(bk_arr))\n"
"signal (\'10050\', \'The search criteria not passed\');\n"
"\n"
"ix := 0; len := length (bk_arr); fnd := 0;\n"
"\n"
"http (sprintf (\'<serviceList generic=\"1.0\" operator=\"%s\" truncated=\"false\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"bs_key := cast (bs_key as varchar);\n"
"while (ix < len)\n"
"{\n"
"\n"
"bk := aref (bk_arr, ix);\n"
"ix := ix + 1;\n"
"\n"
"if (bk is null)\n"
"signal (\'10500\', \'The search name condition is not a string\');\n"
"\n"
"if (st = 1)\n"
"{\n"
"bk := cast (bk as varchar);\n"
"\n"
"qry := sprintf (\'select BS_SERVICE_KEY, BS_NAME, BS_BUSINESS_KEY\n"
"from UDDI..BUSINESS_SERVICE\n"
"where 1 = UDDI..QUAL_MATCH (BS_NAME, ?, ?, ?) and BS_BUSINESS_KEY = ? %s\', sorts);\n"
"exec (qry, null, null, vector (bk, exact, nocase, bs_key), 100, null, dta);\n"
"\n"
"}\n"
"else if (st = 2)\n"
"{\n"
"\n"
"declare ckey, cval varchar;\n"
"ckey := cast (xpath_eval (\'@keyName\',  bk, 1) as varchar);\n"
"cval := cast (xpath_eval (\'@keyValue\', bk, 1) as varchar);\n"
"qry := sprintf (\'select distinct BS_SERVICE_KEY, BS_NAME, BS_BUSINESS_KEY\n"
"from UDDI..CATEGORY_BAG, UDDI..BUSINESS_SERVICE\n"
"where CB_KEY_NAME = ? and CB_KEY_VALUE = ? and CB_PARENT_TYPE = \\\'businessService\\\'\n"
"and CB_PARENT_ID = BS_SERVICE_KEY and BS_BUSINESS_KEY = ? %s\', sorts);\n"
"exec (qry, null, null, vector (ckey, cval, bs_key), 100, null, dta);\n"
"\n"
"}\n"
"else if (st = 3)\n"
"{\n"
"\n"
"bk := cast (bk as varchar);\n"
"if (not exists (select 1 from TMODEL where TM_TMODEL_KEY = bk))\n"
"signal (\'10210\', \'The specified binding key cannot be found in any tModel\');\n"
"qry := sprintf (\'select distinct BS_SERVICE_KEY, BS_NAME, BS_BUSINESS_KEY\n"
"from UDDI..INSTANCE_DETAIL, UDDI..BINDING_TEMPLATE, UDDI..BUSINESS_SERVICE\n"
"where ID_TMODEL_KEY = ? and ID_BINDING_KEY = BT_BINDING_KEY\n"
"and BT_SERVICE_KEY = BS_SERVICE_KEY and BS_BUSINESS_KEY = ? %s \', sorts);\n"
"exec (qry, null, null, vector (bk, bs_key), 100, null, dta);\n"
"}\n"
"else\n"
"signal (\'10050\', \'The search condition is not supported\');\n"
"\n"
"rx := 0; rlen := length (dta);\n"
"while (rx < rlen)\n"
"{\n"
"elm := aref (dta, rx);\n"
"if (not fnd)\n"
"{\n"
"\n"
"http (\'<serviceInfos>\', ses);\n"
"fnd := 1;\n"
"\n"
"}\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"http (sprintf (\'<serviceInfo serviceKey=\"%s\" businessKey=\"%s\">\', aref (elm, 0), aref (elm, 2)),ses);\n"
"http_value (aref (elm, 1), \'name\', ses);\n"
"http (\'</serviceInfo>\', ses);\n"
"\n"
"rx := rx + 1;\n"
"}\n"
"}\n"
"not_match:\n"
"if (fnd)\n"
"http (\'</serviceInfos>\', ses);\n"
"else\n"
"http (\'<serviceInfos/>\', ses);\n"
"http (\'</serviceList>\', ses);\n"
"ses :=  string_output_string (ses);\n"
"\n"
"return (ses);\n"
"}\n"
"--src uddi.sql:2655\n";

static const char *proc63 = 
"#line 2853 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_FIND_TMODEL (in uddi_req any)\n"
"{\n"
"declare ret, ent, ses, bk_arr, names, cbag, ibag any;\n"
"declare bk, saved_bs, bs_key varchar;\n"
"declare ix, len, fnd, st integer;\n"
"declare max_rows integer;\n"
"declare ordering, saved_key varchar;\n"
"declare exact, nocase, sn_asc, sn_desc, sd_asc, sd_desc integer;\n"
"declare criteria integer;\n"
"declare dta, elm any;\n"
"declare qry varchar;\n"
"declare rx, rlen integer;\n"
"declare sorts varchar;\n"
"\n"
"ent := xml_tree_doc (uddi_req);\n"
"ses := string_output ();\n"
"\n"
"st := 1; saved_bs := \'\';\n"
"\n"
"\n"
"\n"
"names := xpath_eval (\'/find_tModel/name\', ent, 0);\n"
"cbag  := xpath_eval (\'/find_tModel/categoryBag/keyedReference\', ent, 0);\n"
"ibag  := xpath_eval (\'/find_tModel/identifierBag/keyedReference\', ent, 0);\n"
"\n"
"\n"
"\n"
"\n"
"ordering := xpath_eval (\'/find_service/findQualifiers/findQualifier\', ent, 0);\n"
"exact := 0; nocase := 1; sn_asc := 0; sn_desc := 0; sd_asc := 0; sd_desc := 0;\n"
"if (isarray (ordering))\n"
"{\n"
"declare sq varchar;\n"
"len := length (ordering); ix := 0;\n"
"while (ix < len)\n"
"{\n"
"sq := cast (aref (ordering, ix) as varchar);\n"
"if (sq = \'exactNameMatch\')\n"
"exact := 1;\n"
"else if (sq = \'caseSensitiveMatch\')\n"
"nocase := 0;\n"
"else if (sq = \'sortByNameAsc\')\n"
"sn_asc := 1;\n"
"else if (sq = \'sortByNameDesc\')\n"
"sn_desc := 1;\n"
"else if (sq = \'sortByDateAsc\')\n"
"sd_asc := 1;\n"
"else if (sq = \'sortByDateDesc\')\n"
"sd_desc := 1;\n"
"ix := ix + 1;\n"
"}\n"
"}\n"
"\n"
"if ((sd_asc and sd_desc) or (sn_desc and sn_asc))\n"
"signal (\'10030\', \'Mutual exclusive sort options supplied\');\n"
"\n"
"sorts := sprintf (\' %s %s \',\n"
"case sn_asc + (sn_desc * 2)\n"
"when 0 then \'\'\n"
"when 1 then \'ORDER BY TM_NAME\'\n"
"else \'ORDER BY TM_NAME DESC\' end,\n"
"case sd_asc + (sd_desc * 2) + ((sn_asc + sn_desc) * 3)\n"
"when 0 then \'\'\n"
"when 1 then \'ORDER BY TM_CHANGED\'\n"
"when 2 then \'ORDER BY TM_CHANGED DESC\'\n"
"when 3 then \'\'\n"
"when 4 then  \', TM_CHANGED\'\n"
"else \', TM_CHANGED DESC\'\n"
"end);\n"
"\n"
"\n"
"if (length (names))\n"
"{\n"
"bk_arr := names;\n"
"st := 1;\n"
"criteria := criteria + 1;\n"
"}\n"
"if (length (cbag))\n"
"{\n"
"bk_arr := cbag;\n"
"st := 2;\n"
"criteria := criteria + 1;\n"
"}\n"
"if (length (ibag))\n"
"{\n"
"bk_arr := ibag;\n"
"st := 3;\n"
"criteria := criteria + 1;\n"
"}\n"
"\n"
"if (criteria <> 1)\n"
"signal (\'10030\', \'Too many options for find_tModel request\');\n"
"\n"
"if (not isarray(bk_arr))\n"
"signal (\'10050\', \'The search criteria not passed\');\n"
"\n"
"ix := 0; len := length (bk_arr); fnd := 0;\n"
"\n"
"http (sprintf (\'<tModelList generic=\"1.0\" operator=\"%s\" truncated=\"false\" xmlns=\"urn:uddi-org:api\">\', registry_get (\'UDDI_operator\')), ses);\n"
"\n"
"while (ix < len)\n"
"{\n"
"\n"
"bk := aref (bk_arr, ix);\n"
"ix := ix + 1;\n"
"\n"
"if (bk is null)\n"
"signal (\'10500\', \'The search name condition is not a string value\');\n"
"\n"
"if (st = 1)\n"
"{\n"
"bk := cast (bk as varchar);\n"
"qry := sprintf (\'select TM_TMODEL_KEY, TM_NAME\n"
"from UDDI..TMODEL where UDDI..QUAL_MATCH (TM_NAME, ?, ?, ?) %s \', sorts);\n"
"exec (qry, null, null, vector (bk, exact, nocase), 100, null, dta);\n"
"}\n"
"else if (st = 2)\n"
"{\n"
"declare ikey, ival, tkid varchar;\n"
"ikey := upper (cast (xpath_eval (\'@keyName\',  bk, 1) as varchar));\n"
"ival := upper (cast (xpath_eval (\'@keyValue\', bk, 1) as varchar));\n"
"qry := sprintf (\'select distinct TM_TMODEL_KEY, TM_NAME from\n"
"UDDI..IDENTIFIER_BAG, UDDI..TMODEL where IB_KEY_NAME = ? and IB_KEY_VALUE = ?\n"
"and IB_TMODEL_KEY_ID = TM_TMODEL_KEY %s \', sorts);\n"
"exec (qry, null, null, vector (ikey, ival), 100, null, dta);\n"
"}\n"
"else if (st = 3)\n"
"{\n"
"declare ckey, cval varchar;\n"
"ckey := cast (xpath_eval (\'@keyName\',  bk, 1) as varchar);\n"
"cval := cast (xpath_eval (\'@keyValue\', bk, 1) as varchar);\n"
"qry := sprintf (\'select distinct TM_TMODEL_KEY, TM_NAME from\n"
"UDDI..CATEGORY_BAG, UDDI..TMODEL where CB_KEY_NAME = ? and CB_KEY_VALUE = ?\n"
"and CB_TMODEL_KEY_ID = TM_TMODEL_KEY %s\', sorts);\n"
"exec (qry, null, null, vector (ckey, cval), 100, null, dta);\n"
"}\n"
"else\n"
"signal (\'10050\', \'The search condition is not supported\');\n"
"\n"
"rx := 0; rlen := length (dta);\n"
"while (rx < rlen)\n"
"{\n"
"elm := aref (dta, rx);\n"
"if (not fnd)\n"
"{\n"
"\n"
"http (\'<tModelInfos>\', ses);\n"
"fnd := 1;\n"
"\n"
"}\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"\n"
"http (sprintf (\'<tModelInfo tModelKey=\"%s\">\', aref (elm, 0)), ses);\n"
"http_value (aref (elm, 1), \'name\', ses);\n"
"http (\'</tModelInfo>\', ses);\n"
"\n"
"rx := rx + 1;\n"
"}\n"
"}\n"
"not_match:\n"
"if (fnd)\n"
"http (\'</tModelInfos>\', ses);\n"
"else\n"
"http (\'<tModelInfos/>\', ses);\n"
"http (\'</tModelList>\', ses);\n"
"ses :=  string_output_string (ses);\n"
"\n"
"return (ses);\n"
"}\n"
"--src uddi.sql:2851\n";

static const char *proc64 = 
"#line 3036 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_STR_GET2 (in uri varchar, in req any)\n"
"{\n"
"return http_get(uri , NULL, \'POST\', \'Content-Type: text/xml\\r\\nSOAPAction: \"\"\', req);\n"
"}\n"
"--src uddi.sql:3034\n";

static const char *proc65 = 
"#line 3044 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_ADD_ENVELOPE (in str varchar)\n"
"{\n"
"return concat (\'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\r\\n<Envelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\">\\r\\n\\<Body>\', str, \'</Body>\\r\\n</Envelope>\');\n"
"}\n"
"--src uddi.sql:3042\n";

static const char *proc66 = 
"#line 3052 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_STR_GET (in uri varchar, in req any)\n"
"{\n"
"if (req is null)\n"
"signal (\'42000\', \'The UDDI_STR_GET needs a string as request not a null\');\n"
"return http_get(uri , NULL, \'POST\', \'Content-Type: text/xml\\r\\nSOAPAction: \"\"\', UDDI_ADD_ENVELOPE (req));\n"
"}\n"
"--src uddi.sql:3050\n";

static const char *proc67 = 
"#line 3062 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_REMOVE_ENVELOPE (in str varchar)\n"
"{\n"
"declare next varchar;\n"
"declare res any;\n"
"\n"
"res := xml_tree_doc (str);\n"
"next := cast (xpath_eval (\'local-name(/*/*/*[position()=1])\', res, 1) as varchar);\n"
"\n"
"res := xpath_eval (concat (\'/Envelope/Body/\', next), res, 1);\n"
"return res;\n"
"}\n"
"--src uddi.sql:3060\n";

static const char *proc68 = 
"#line 3077 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_GET (in uri varchar, in req any)\n"
"{\n"
"return UDDI_REMOVE_ENVELOPE (http_get (uri , NULL, \'POST\', \'Content-Type: text/xml\\r\\nSOAPAction: \"\"\',\n"
"UDDI_ADD_ENVELOPE (req)));\n"
"}\n"
"--src uddi.sql:3075\n";

static const char *proc69 = 
"#line 3086 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"UDDI_LOCAL (in req_l any)\n"
"{\n"
"declare req any;\n"
"declare action, state, msg, res varchar;\n"
"\n"
"if (isstring (req_l))\n"
"req := xml_tree_doc (req_l);\n"
"else if (__tag (req_l) = 230)\n"
"{\n"
"declare temp any;\n"
"req := req_l;\n"
"temp := string_output ();\n"
"http_value (req_l, NULL, temp);\n"
"req_l := string_output_string (temp);\n"
"}\n"
"\n"
"action := upper (cast (xpath_eval (\'local-name(/*[position()=1])\', req) as varchar));\n"
"\n"
"if (not action in (\'SAVE_BUSINESS\', \'SAVE_TMODEL\', \'SAVE_SERVICE\', \'SAVE_BINDING\',\n"
"\'DELETE_BUSINESS\', \'DELETE_SERVICE\', \'DELETE_BINDING\', \'DELETE_TMODEL\',\n"
"\'GET_AUTHTOKEN\', \'DISCARD_AUTHTOKEN\', \'GET_REGISTEREDINFO\', \'GET_BUSINESSDETAIL\',\n"
"\'GET_BUSINESSDETAILEXT\', \'GET_BINDINGDETAIL\', \'GET_TMODELDETAIL\', \'GET_SERVICEDETAIL\',\n"
"\'FIND_BUSINESS\', \'FIND_BINDING\', \'FIND_SERVICE\', \'FIND_TMODEL\'))\n"
"signal (\'10050\', sprintf (\'Invalid UDDI action %s\', action));\n"
"\n"
"if (exec (concat (\'select (UDDI.DBA.UDDI_\', action, \' (?))\'), state, msg, vector (req_l), 100, NULL, res) = 0)\n"
"return aref (aref (res, 0), 0);\n"
"\n"
"return msg;\n"
"}\n"
"--src uddi.sql:3084\n";

static const char *proc70 = 
"#line 3119 \"[executable]/uddi.sql\"\n"
"create procedure\n"
"kluc (in to_kluc any)\n"
"{\n"
"declare ses any;\n"
"\n"
"ses := string_output ();\n"
"http_value (to_kluc, NULL, ses);\n"
"\n"
"return (xml_tree_doc (string_output_string (ses)));\n"
"}\n"
"--src uddi.sql:3117\n";

static int
sch_proc_def_exists (client_connection_t *cli, const char *proc_name, const int report)
{
  query_t *proc = NULL;
  char *full_name = sch_full_proc_name (isp_schema(NULL), proc_name,
	cli->cli_qualifier, CLI_OWNER (cli));
  if (full_name)
    proc = sch_proc_def (isp_schema(NULL), full_name);
  if (report && proc != NULL)
     log_debug ("built-in procedure \"%s\" overruled by the RDBMS", proc_name);
  return (proc != NULL);
}

#define DEFINE_PROC(name, proc) \
   if (!sch_proc_def_exists (bootstrap_cli, (name), log_proc_overwrite)) \
     ddl_std_proc_1 (proc, 0x0, 1)


#define DEFINE_PUBLIC_PROC(name, proc) \
   if (!sch_proc_def_exists (bootstrap_cli, (name), log_proc_overwrite)) \
     ddl_std_proc_1 (proc, 0x1, 1)


#define DEFINE_OVERWRITE_PROC(name, proc) \
   ddl_std_proc_1 (proc, 0x1, 1)


void
sqls_define_uddi (void)
{
  caddr_t saved_qualifier = bootstrap_cli->cli_qualifier;

  /* uddi.sql */
  bootstrap_cli->cli_qualifier = box_string ("UDDI");

  ddl_ensure_table ("UDDI..BUSINESS_ENTITY", tbl0);
  ddl_ensure_table ("UDDI..BUSINESS_SERVICE", tbl1);
  ddl_ensure_table ("UDDI..BINDING_TEMPLATE", tbl2);
  ddl_ensure_table ("UDDI..TMODEL", tbl3);
  ddl_ensure_table ("UDDI..DESCRIPTION", tbl4);
  ddl_ensure_table ("UDDI..DISCOVERY_URL", tbl5);
  ddl_ensure_table ("UDDI..ADDRESS_LINE", tbl6);
  ddl_ensure_table ("UDDI..CONTACTS", tbl7);
  ddl_ensure_table ("UDDI..EMAIL", tbl8);
  ddl_ensure_table ("UDDI..PHONE", tbl9);
  ddl_ensure_table ("UDDI..IDENTIFIER_BAG", tbl10);
  ddl_ensure_table ("UDDI..CATEGORY_BAG", tbl11);
  ddl_ensure_table ("UDDI..OVERVIEW_DOC", tbl12);
  ddl_ensure_table ("UDDI..INSTANCE_DETAIL", tbl13);
  DEFINE_PROC ("LOAD_UDDI_TAXONOMY", proc0);
  DEFINE_PROC ("SAVE_BUSINESS_ENTITY", proc1);
  DEFINE_PROC ("UDDI_SAVE_BUSINESS", proc2);
  DEFINE_PROC ("SAVE_DESCRIPRIONS", proc3);
  DEFINE_PROC ("SAVE_BUSINESS_SERVICES", proc4);
  DEFINE_PROC ("SAVE_BUSINESS_SERVICE", proc5);
  DEFINE_PROC ("SAVE_BINDING_TEMPLATES", proc6);
  DEFINE_PROC ("SAVE_BINDING_TEMPLATE", proc7);
  DEFINE_PROC ("SAVE_TMODEL_INSTANCE_DETAILS", proc8);
  DEFINE_PROC ("SAVE_TMODEL_INSTANCE_INFOS_1", proc9);
  DEFINE_PROC ("SAVE_IDENTIFIER_BAG", proc10);
  DEFINE_PROC ("SAVE_CATEGORY_BAG", proc11);
  DEFINE_PROC ("SAVE_OVERVIEW_DOC", proc12);
  DEFINE_PROC ("UDDI_SAVE_TMODEL", proc13);
  DEFINE_PROC ("SAVE_DISCOVERY_URLS", proc14);
  DEFINE_PROC ("SAVE_CONTACTS", proc15);
  DEFINE_PROC ("SAVE_EMAILS", proc16);
  DEFINE_PROC ("SAVE_PHONES", proc17);
  DEFINE_PROC ("SAVE_ADDRESS", proc18);
  DEFINE_PROC ("DELETE_BUSINESS_BK", proc19);
  DEFINE_PROC ("UDDI_SAVE_SERVICE", proc20);
  DEFINE_PROC ("DELETE_SERVICE_SK", proc21);
  DEFINE_PROC ("DELETE_BINDING_BK", proc22);
  DEFINE_PROC ("DELETE_TMODEL_TK", proc23);
  DEFINE_PROC ("UDDI_SAVE_BINDING", proc24);
  DEFINE_PROC ("UDDI_DELETE_BUSINESS", proc25);
  DEFINE_PROC ("UDDI_DELETE_SERVICE", proc26);
  DEFINE_PROC ("UDDI_DELETE_BINDING", proc27);
  DEFINE_PROC ("UDDI_DELETE_TMODEL", proc28);
  DEFINE_PROC ("GET_FROM_UPLOAD_REGISTER", proc29);
  DEFINE_PROC ("SAVE_BUSINESS_FROM_FILE", proc30);
  DEFINE_PROC ("UDDI_GET_AUTHTOKEN", proc31);
  DEFINE_PROC ("UDDI_DISCARD_AUTHTOKEN", proc32);
  DEFINE_PROC ("OK_DISPOSITION_REPORT", proc33);
  DEFINE_PROC ("UDDI_GET_REGISTEREDINFO", proc34);
  DEFINE_PROC ("VERIFY_AUTH_INFO", proc35);
  DEFINE_PROC ("UDDI_GET_BUSINESSDETAILEXT", proc36);
  DEFINE_PROC ("UDDI_GET_BUSINESSDETAIL", proc37);
  DEFINE_PROC ("BUSINESS_DETAIL", proc38);
  DEFINE_PROC ("UDDI_GET_BINDINGDETAIL", proc39);
  DEFINE_PROC ("BINDING_DETAIL", proc40);
  DEFINE_PROC ("UDDI_GET_TMODELDETAIL", proc41);
  DEFINE_PROC ("TMODEL_DETAIL", proc42);
  DEFINE_PROC ("UDDI_GET_SERVICEDETAIL", proc43);
  DEFINE_PROC ("SERVICE_DETAIL", proc44);
  DEFINE_PROC ("TMODEL_INSTANCE_DETAILS", proc45);
  DEFINE_PROC ("OVERVIEW_DOC", proc46);
  DEFINE_PROC ("DISCOVERY_URLS", proc47);
  DEFINE_PROC ("BUSINESS_SERVICES", proc48);
  DEFINE_PROC ("BINDING_TEMPLATES", proc49);
  DEFINE_PROC ("CATEGORY_BAG", proc50);
  DEFINE_PROC ("IDENTIFIER_BAG", proc51);
  DEFINE_PROC ("DESCRIPTIONS", proc52);
  DEFINE_PROC ("CONTACTS", proc53);
  DEFINE_PROC ("PHONE", proc54);
  DEFINE_PROC ("EMAIL", proc55);
  DEFINE_PROC ("ADDRESS", proc56);
  DEFINE_PROC ("ADDRESS_2", proc57);
  DEFINE_PROC ("QUAL_MATCH", proc58);
  DEFINE_PROC ("UDDI_FIND_BUSINESS", proc59);
  DEFINE_PROC ("SERVICE_INFOS", proc60);
  DEFINE_PROC ("UDDI_FIND_BINDING", proc61);
  DEFINE_PROC ("UDDI_FIND_SERVICE", proc62);
  DEFINE_PROC ("UDDI_FIND_TMODEL", proc63);
  DEFINE_PROC ("UDDI_STR_GET2", proc64);
  DEFINE_PROC ("UDDI_ADD_ENVELOPE", proc65);
  DEFINE_PROC ("UDDI_STR_GET", proc66);
  DEFINE_PROC ("UDDI_REMOVE_ENVELOPE", proc67);
  DEFINE_PROC ("UDDI_GET", proc68);
  DEFINE_PROC ("UDDI_LOCAL", proc69);
  DEFINE_PROC ("kluc", proc70);

  dk_free_box (bootstrap_cli->cli_qualifier);
  bootstrap_cli->cli_qualifier =  saved_qualifier;
}


void
sqls_arfw_define_uddi (void)
{
  caddr_t saved_qualifier = bootstrap_cli->cli_qualifier;

  /* ./uddi.sql */
  bootstrap_cli->cli_qualifier = box_string ("UDDI");

  ddl_ensure_table ("do this always", other0);

  dk_free_box (bootstrap_cli->cli_qualifier);
  bootstrap_cli->cli_qualifier =  saved_qualifier;
}