Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r8490]: docs / trunk / publican / oosqlite / en-US / oosqliteConnection.xml Maximize Restore History

Download this file

oosqliteConnection.xml    4177 lines (3939 with data), 188.9 kB

   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
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "oosqlite.ent">
%BOOK_ENTITIES;
]>
<!--#########################################################################
#
# Description: Open Object Rexx: ooSqlite XML file.
#
# Copyright (c) 2012-2012 Rexx Language Association. All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Common Public License v1.0 which accompanies this
# distribution. A copy is also available at the following address:
# http://www.oorexx.org/license.html
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the distribution.
#
# Neither the name of Rexx Language Association nor the names
# of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#########################################################################
-->
<section id="clsOOSQLiteConnection"><title>The ooSQLiteConnection Class</title>
<indexterm><primary>ooSQLiteConnection class</primary></indexterm>
<para>
An <computeroutput>ooSQLiteConnection</computeroutput> object represents a SQLite database, or to be more precise a
connection to a SQLite database file. Each database in SQLite is contained in a single file. The files are platform
independent, that is a database created and used on a Windows system can be moved to a Linux or Mac OS X system and will
work unchanged.
</para>
<para>
Instantiating a connection object implicitly opens the SQLite database. SQLite supports multiple open connections to the
same database. The Rexx programmer can open up multiple connections by instantiating multiple
<computeroutput>ooSQLiteConnection</computeroutput> objects using the same database file name. The ooSQLite native
extension builds the SQLite database engine in <emphasis role="italic">serialized multi-threading</emphasis> mode. In this
mode the database engine can be safely used by multiple threads with no restriction. Therefore a connection object can be
used in any thread in the Rexx program.
</para>
<para>
The <link linkend="mthClose">close</link> method should always be invoked when the connection object is no longer needed.
This frees up the system resources used by the connection. The <emphasis role="italic">close</emphasis> method should be
invoked even if an error ocurred during instantiation. Once <emphasis role="italic">close</emphasis> is invoked,
the object can no longer be used to work with the database. It is an error to inovke database methods with a closed
connection object. However, the <emphasis role="italic">close</emphasis> method can always be invoked. The method is a
harmless nop if the connection has already been closed.
</para>
<section id="sctMethodsOOSQLiteConnection"><title>Method Table</title>
<para>
The following table provides links to the documentation for the primary methods and attributes used in working
with database connection objects using the <computeroutput>ooSQLiteConnection</computeroutput> class.
</para>
<table id="tblOOSQLiteConnectionMethods" frame="all">
<title>ooSQLiteConnection Methods and Attributes</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="3*" />
<thead>
<row>
<entry>Method</entry>
<entry>Documentation</entry>
</row>
</thead>
<tbody>
<row>
<entry align="center"><emphasis role="bold">Class Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><link linkend="mthNewClsOOSQLiteConnection">new</link></entry>
<entry>Instantiates a new ooSQLite database connection</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Attribute Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><link linkend="atrBackupDestination">backupDestination</link></entry>
<entry>Reflects whether this database connection is currently in use as the destination for an online <link linkend="clsOOSQLiteBackup">backup</link>.</entry>
</row>
<row>
<entry><link linkend="atrClosedClsConn">closed</link></entry>
<entry>Reflects the open or closed state of this database connection.</entry>
</row>
<row>
<entry><link linkend="atrFileName">fileName</link></entry>
<entry>Reflects the database file name used to instantiate this connection.</entry>
</row>
<row>
<entry><link linkend="atrInitCodeClsConn">initCode</link></entry>
<entry>Reflects the status of the initialization of the database connection.</entry>
</row>
<row>
<entry><link linkend="atrLastErrCodeClsConn">lastErrCode</link></entry>
<entry>Reflects the last error code set by for the <computeroutput>ooSQLiteConnection</computeroutput> object.</entry>
</row>
<row>
<entry><link linkend="atrLastErrMsgClsConn">lastErrMsg</link></entry>
<entry>Reflects a human readable explanation, a message, of the last error code recorded by the connection object.</entry>
</row>
<row>
<entry><link linkend="atrRecordFormatClsConn">recordFormat</link></entry>
<entry>Sets or queries the default format for result sets returned through this database connection.</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
<entry align="center"><emphasis role="bold"></emphasis></entry>
</row>
<row>
<entry><link linkend="mthBusyHandler">busyHandler</link></entry>
<entry>Installs a user defined busy handler.</entry>
</row>
<row>
<entry><link linkend="mthBusyTimeOut">busyTimeOut</link></entry>
<entry>Sets a busy handler that sleeps for the specified amount of time when a table is locked.</entry>
</row>
<row>
<entry><link linkend="mthChanges">changes</link></entry>
<entry>Returns the number of database rows that were changed or inserted or deleted by the most recently completed SQL statement on this database connection.</entry>
</row>
<row>
<entry><link linkend="mthClose">close</link></entry>
<entry>Releases all systems resources that have been allocated for the database connection.</entry>
</row>
<row>
<entry><link linkend="mthCommitHook">commitHook</link></entry>
<entry>Registers a callback method to be invoked whenever a transaction is committed.</entry>
</row>
<row>
<entry><link linkend="mthDbFileName">dbFileName</link></entry>
<entry>Returns the database file name of the database specified by the <emphasis role="italic">name</emphasis> argument.</entry>
</row>
<row>
<entry><link linkend="mthDbMutex">dbMutex</link></entry>
<entry>Retrieves an <link linkend="clsOOSQLiteMutex">ooSQLitMutex</link> object that represents the SQLite mutex that serializes access to this database connection.</entry>
</row>
<row>
<entry><link linkend="mthDbReadOnly">dbReadOnly</link></entry>
<entry>Determines if the named database on this connection is read only.</entry>
</row>
<row>
<entry><link linkend="mthDbReleaseMemory">dbReleaseMemory</link></entry>
<entry>Causes the SQLite database engine to attempt to free as much heap memory as possible from this database connection.</entry>
</row>
<row>
<entry><link linkend="mthDbStatus">dbStatus</link></entry>
<entry>Retrieves runtime status information about this database connection.</entry>
</row>
<row>
<entry><link linkend="mthErrCode">errCode</link></entry>
<entry>Returns the numeric result <link linkend="sctResultCode">code</link> for the most recent failed SQLite API call associated with this database connection.</entry>
</row>
<row>
<entry><link linkend="mthErrMsg">errMsg</link></entry>
<entry>Returns the English-language text that describes the current<link linkend="mthErrCode">errCode</link> value.</entry>
</row>
<row>
<entry><link linkend="mthExec">exec</link></entry>
<entry>Executes the specified SQL statement(s). A callback is invoked for each result row coming out of the evaluated SQL statements.</entry>
</row>
<row>
<entry><link linkend="mthExtendedErrCode">extendedErrCode</link></entry>
<entry>Returns the numeric result <link linkend="sctResultCode">code</link> for the most recent failed SQLite API call associated with this database connection.</entry>
</row>
<row>
<entry><link linkend="mthExtendedResultCodes">extendedResultCodes</link></entry>
<entry>This is a nop in ooSQLite, extended result codes are always on.</entry>
</row>
<row>
<entry><link linkend="mthGetAutocommit">getAutocommit</link></entry>
<entry>Determines if this database connection is, or is not, in autocommit mode.</entry>
</row>
<row>
<entry><link linkend="mthInterrupt">interrupt</link></entry>
<entry>Causes any pending database operation on this database connection to abort and return at the earliest opportunity.</entry>
</row>
<row>
<entry><link linkend="mthLastInsertRowID">lastInsertRowID</link></entry>
<entry>Returns the rowid of the most recent successful INSERT into the database from this database connection.</entry>
</row>
<row>
<entry><link linkend="mthLimit">limit</link></entry>
<entry>Queries or sets the limiting size of various constructs on this database connection.</entry>
</row>
<row>
<entry><link linkend="mthNextStmt">nextStmt</link></entry>
<entry>Returns the next prepared statement <link linkend="clsOOSQLiteStmt">object</link> after the specified statement, or the first prepared statement if <emphasis role="italic">stmt</emphasis> is omitted or the <computeroutput>.nil</computeroutput> object.</entry>
</row>
<row>
<entry><link linkend="mthProfile">profile</link></entry>
<entry>Registers an user callback method that can be used for profiling. The callback method is invoked is invoked as each SQL statement finishes.</entry>
</row>
<row>
<entry><link linkend="mthProgressHandler">progressHandler</link></entry>
<entry>Registers an user callback method that is invoked periodically during long running calls to <emphasis role="italic">exec</emphasis> and <emphasis role="italic">step</emphasis> methods for this database connection.</entry>
</row>
<row>
<entry><link linkend="mthPragma">pragma</link></entry>
<entry>Executes a PRAGMA statement. A <emphasis role="italic">PRAGMA</emphasis> statement is a SQLite specific SQL extension, probably unknown to any other database engine.</entry>
</row>
<row>
<entry><link linkend="mthRollbackHook">rollbackHook</link></entry>
<entry>Registers a callback method to be invoked whenever a transaction is rolled back.</entry>
</row>
<row>
<entry><link linkend="mthSetAuthorizer">setAuthorizer</link></entry>
<entry>Registers an authorizer callback method that is invoked as SQL statements are being compiled by instantiating an <link linkend="clsOOSQLiteStmt">ooSQLiteStmt</link> object.</entry>
</row>
<row>
<entry><link linkend="mthTableColumnMetadata">tableColumnMetadata</link></entry>
<entry>Retrieves metadata about a specific column of a specific table of this database connection.</entry>
</row>
<row>
<entry><link linkend="mthTotalChanges">totalChanges</link></entry>
<entry>Determines the number of row changes caused by INSERT, UPDATE or DELETE statements since the database connection was opened.</entry>
</row>
<row>
<entry><link linkend="mthTrace">trace</link></entry>
<entry>Registers an user callback method that can be used for tracing. The callback method is invoked at various times when an SQL statement is being executed.</entry>
</row>
<row>
<entry><link linkend="mthUpdateHook">updateHook</link></entry>
<entry>Registers a callback method to be invoked whenever a row is updated, inserted, or deleted.</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="mthNewClsOOSQLiteConnection"><title>new (Class method)</title>
<indexterm><primary>new</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>new</secondary></indexterm>
<programlisting>
<![CDATA[
>>--new(--file--+---------+--+-------------+--+------------+--)----------------><
+-,-opts--+ +-,-defFormat-+ +-,-reserved-+
]]>
</programlisting>
<para>
Instantiates a new database connection object and opens the specified database for use.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>file [required]</term>
<listitem>
<para>
The file name of the database to open. The special string <emphasis role="italic">:memory:</emphasis> can be
used to open an in memory database. The <emphasis role="italic">dbFileName</emphasis> argument can also be an
URI. Refer to the SQLite documentation for details.
</para>
</listitem></varlistentry>
<varlistentry><term>opts [optional]</term>
<listitem>
<para>
One or more of the file <link linkend="sctFileOpen">open</link> constants. This argument controls how the
database is opened. Do not use any constant marked as <emphasis role="italic">VFS only</emphasis>. Use the
<link linkend="mthMerge">merge</link> method of the <link
linkend="clsOOSQLiteConstants">ooSQLiteConstants</link> class to combine two or more of the constant values
together, if needed.
</para>
<para>
The 3 common flags are OPEN_READWRITE, OPEN_READONLY, and OPEN_CREATE. If this argument is omitted, the
OPEN_READWRITE combined with OPEN_CREATE flags are used.
</para>
</listitem></varlistentry>
<varlistentry><term>defFormat [optional]</term>
<listitem>
<para>
Specifies one of the ooSQLite Result Set Format <link linkend="sctOOSQLiteSpecific">Constants</link> that define
how a result set is formatted and sets the <link linkend="atrRecordFormatClsConn">recordFormat</link> attribute
for this database connection. This is a convenience argument, the <emphasis
role="italic">recordFormat</emphasis> attribute can always be set directly. If this argument is omitted, then
the <emphasis role="italic">recordFormat</emphasis> attribute is set to the value of the
<computeroutput>ooSQLite</computeroutput> class <link linkend="atrRecordFormatClsOOSQLite">recordFormat</link>
attribute.
</para>
</listitem></varlistentry>
<varlistentry><term>reserved [optional]</term>
<listitem>
<para>
Reserved for future use. This argument is completely ignored in the current implementation.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns a newly instantiated <computeroutput>ooSQLiteConnection</computeroutput> object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Errors can occur when opening the uderlying database, in which case the returned
<computeroutput>ooSQLiteConnection</computeroutput> object can not be used to interact with the database. The
<link linkend="atrInitCodeClsConn">initCode</link> attribute is used to check for errors. The <emphasis
role="italic">initCode</emphasis> attribute will be set to one of ooSQLite <link
linkend="sctResultCode">result</link> code constants. If it is the OK constant there were no errors and the
database can be used. Otherwise, the database can not be use and the <link
linkend="atrLastErrCodeClsConn">lastErrCode</link> and <link linkend="atrLastErrMsgClsConn">lastErrMsg</link>
attributes can be used to determine the exact nature of the failure.
</para>
<para>
When an error has occurred, the resources used by the database engine for a connection are released automatically.
Otherwise, every successful open of the database through the instantiation of a
<computeroutput>ooSQLiteConnection</computeroutput> object must be matched by an invocation of the <link
linkend="mthClose">close</link> method to free the resources. Once the database is closed, other methods of the
<computeroutput>ooSQLiteConnection</computeroutput> object can not be used. Note that this does not apply to the
attrbute methods of the object, which are always accessible. As noted, if an error with the database engine happens
during <emphasis role="italic">new</emphasis>, the database engine resources are freed. This is an implicit close of
the database.
</para>
<para>
Do not invoke the methods of the <computeroutput>ooSQLiteConnection</computeroutput> object when an error occurs
during <emphasis role="italic">new</emphasis>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">new</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/open.html">sqlite3_open_v2</ulink> API.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example opens up a connection to the <computeroutput>phoneBook</computeroutput> database, located in the
current directory of the application, and checks for error:
<programlisting>
<![CDATA[
db = .ooSQLiteConnection~new('phoneBook.rdbx')
if db~initCode <> 0 then do
-- handle error in some fashion
...
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::new() -->
<section id="atrBackupDestination"><title>backupDestination (Attribute)</title>
<indexterm><primary>backupDestination</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>backupDestination</secondary></indexterm>
<programlisting>
<![CDATA[
>>--backupDestination----------------------------><
>>--backupDestination = varName------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">backupDestination</emphasis> attribute reflects whether this database connection is
currently in use as the destination for an online backup.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">backupDestination get:</emphasis></term>
<listitem>
<para>
When the value of this attribute is true, this database connection is currently in use as the destination database
of an online backup. At al other times, the value is false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">backupDestination set:</emphasis></term>
<listitem>
<para>
The programmer can not set the value of this attribute. Its value is set internally by ooSQLite.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The destination database connection can not be used, by any thread, after the backup is initialized and before the
backup is <link linkend="mthFinish">finished</link>. Becasue SQLite does not currently check to see if the
application incorrectly accesses the destination database connection, no error code is reported, but the operations
may malfunction nevertheless. Use of the destination database connection while a backup is in progress might also
cause a mutex deadlock.
</para>
<para>
To prevent this situation, if this database connection is currently in use as the destination for an online backup,
this object is locked. Any invocation of any <emphasis role="bold">method</emphasis> of this object will raise an
error condition. Note that all <emphasis role="bold">attributes</emphasis> of this object are still accessible.
</para>
<para>
Normally, the programmer would be fully aware of which database connection is currently in use as a destionation
database. However, in the event the programmer is not sure of the state of this database connection, the <emphasis
role="italic">backupDestination</emphasis> attribute can be used to determine the state.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
This attribute is provided by ooSQLite, there is no applicable API provided by SQLite.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::backupDestination() [attribute] -->
<section id="atrClosedClsConn"><title>closed (Attribute)</title>
<indexterm><primary>closed</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>closed</secondary></indexterm>
<programlisting>
<![CDATA[
>>--closed---------------------------------------><
>>--closed = varName-----------------------------><
]]>
</programlisting>
<para>
Reflects the open or closed state of this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">closed get:</emphasis></term>
<listitem>
<para>
If the database connection has been closed the value of the <emphasis role="italic">closed</emphasis> attribute is true,
otherwise it is false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">closed set:</emphasis></term>
<listitem>
<para>
The Rexx programmer can not set the value of this attribute. It is set internally by the ooSQLite framework.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
It is an error to invoke most methods of the connection object once the connection is closed. The only exceptions to this
are the attributes of the <computeroutput>ooSQLiteConnection</computeroutput> object and the <link
linkend="mthClose">close</link> method. The <emphasis role="italic">closed</emphasis> attribute can be used to check if
the connection has already been closed.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::closed() [attribute] -->
<section id="atrFileName"><title>fileName (Attribute)</title>
<indexterm><primary>fileName</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>fileName</secondary></indexterm>
<programlisting>
<![CDATA[
>>--fileName-------------------------------------><
>>--fileName = varName---------------------------><
]]>
</programlisting>
<para>
Reflects the database file name used to instantiate this connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">fileName get:</emphasis></term>
<listitem>
<para>
Returns the file name used to open up the database connection in the <link
linkend="mthNewClsOOSQLiteConnection">new</link> method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">fileName set:</emphasis></term>
<listitem>
<para>
The programmer can not set this attribute, it is set internally by the ooSQLite framework.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The file name is set during initialization of the connection object. It never changed after that.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::fileName() [attribute] -->
<section id="atrInitCodeClsConn"><title>initCode (Attribute)</title>
<indexterm><primary>initCode</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>initCode</secondary></indexterm>
<programlisting>
<![CDATA[
>>--initCode-------------------------------------><
>>--initCode = varName---------------------------><
]]>
</programlisting>
<para>
Reflects the status of the initialization of the database connection. Any value other than 0, (<emphasis
role="italic">.ooSQLite~OK</emphasis>,) indicates that an error ocurred during intialization and that the connection is not
open.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">initCode get:</emphasis></term>
<listitem>
<para>
The value of the <emphasis role="italic">initCode</emphasis> is one of the result <link
linkend="sctResultCode">code</link> constants and indicates the status of the attempt to open the connection to the
database.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">initCode set:</emphasis></term>
<listitem>
<para>
The Rexx programmer can not set the value of this attribute, it is set internally by the ooSQLite framework.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Errors can ocurr during instantiation of a database connection object. The <emphasis role="italic">initCode</emphasis>
attribute can be checked to determine if an error ocurred. The cautious programmer would always check the init code after
instantiating a connection ojbect to ensure that the connections was opened without error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example attempts to open up a connection to the <computeroutput>ooFoods.rdbx</computeroutput> database and checks
that the connection was opened successfully, aborting if it was not:
<programlisting>
<![CDATA[
dbName = 'ooFotods.rdbx'
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE)
if dbConn~initCode <> 0 then do
errRC = dbConn~lastErrCode
errMsg = dbConn~lastErrMsg
say 'ooSQLiteConnection initialization error:' dbConn~initCode
say ' Error code:' errRC '('errMsg')'
dbConn~close
return errRC
end
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::initCode() [attribute] -->
<section id="atrLastErrCodeClsConn"><title>lastErrCode (Attribute)</title>
<indexterm><primary>lastErrCode</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>lastErrCode</secondary></indexterm>
<programlisting>
<![CDATA[
>>--lastErrCode----------------------------------><
>>--lastErrCode = varName------------------------><
]]>
</programlisting>
<para>
Reflects the last error code set by for the <computeroutput>ooSQLiteConnection</computeroutput> object.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">lastErrCode get:</emphasis></term>
<listitem>
<para>
The value of the <emphasis role="italic">lastErrCode</emphasis> attribute will be a SQLite result <link
linkend="sctResultCode">code</link> or one of the ooSQLite specific result <link
linkend="sctOOSQLiteSpecific">codes</link>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">lastErrCode set:</emphasis></term>
<listitem>
<para>
The programmer can not set the value of this attribute, it is set internally by the ooSQLite framework.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The last error code attribute is similar to the <link linkend="atrLastErrMsgClsConn">lastErrMsg</link> attribute.
Its value is the last status code recorded by ooSQLite. The <emphasis role="italic">lastErrCode</emphasis> and the
<emphasis role="italic">lastErrMsg</emphasis> attributes are always updated together. The error message is always
the message that goes with the error code.
</para>
<para>
Each of the three major ooSQLite objects, an <link linkend="clsOOSQLiteConnection">ooSQLiteConnection</link>, an
<link linkend="clsOOSQLiteStmt">ooSQLiteStmt</link>, and an <link
linkend="clsOOSQLiteBackup">ooSQLiteBackup</link> object have a <emphasis role="italic">lastErrMsg</emphasis> and
a <emphasis role="italic">lastErrCode</emphasis> attribute. These attributes all serve the same basic purpose, to
hold the last error message and code recorded by ooSQLite.
</para>
<para>
The attributes are most useful when the invocation of <emphasis role="italic">new</emphasis> fails to initialize the
object correctly due to an error. The <emphasis role="italic">lastErrMsg</emphasis> and <emphasis
role="italic">lastErrCode</emphasis> attributes are always updated during <emphasis role="italic">new</emphasis>.
In general, these objects do not update the attributes after every method invocation.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example uses the <emphasis role="italic">lastErrCode</emphasis> attribute to produce a meaningful error message when
a database connection fails to open:
<programlisting>
<![CDATA[
dbName = 'ooFotods.rdbx'
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE)
if dbConn~initCode <> 0 then do
errRC = dbConn~lastErrCode
errMsg = dbConn~lastErrMsg
say 'ooSQLiteConnection initialization error:' dbConn~initCode
say ' Error code:' errRC '('errMsg')'
dbConn~close
return errRC
end
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::lastErrCode() [attribute] -->
<section id="atrLastErrMsgClsConn"><title>lastErrMsg (Attribute)</title>
<indexterm><primary>lastErrMsg</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>lastErrMsg</secondary></indexterm>
<programlisting>
<![CDATA[
>>--lastErrMsg-----------------------------------><
>>--lastErrMsg = varName-------------------------><
]]>
</programlisting>
<para>
Reflects a human readable explanation, a message, of the last error code recorded by the connection object.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">lastErrMsg get:</emphasis></term>
<listitem>
<para>
Returns a string message that corresponds to the last error code.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">lastErrMsg set:</emphasis></term>
<listitem>
<para>
The programmer can not set this attribute, it is set internally by the ooSQLite framework.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The last error message attribute is similar to the <link linkend="atrLastErrCodeClsConn">lastErrCode</link>
attribute. Its value is the last status message recorded by ooSQLite. The <emphasis
role="italic">lastErrCode</emphasis> and the <emphasis role="italic">lastErrMsg</emphasis> attributes are always
updated together. The error message is always the message that goes with the error code.
</para>
<para>
Each of the three major ooSQLite objects, an <link linkend="clsOOSQLiteConnection">ooSQLiteConnection</link>, an
<link linkend="clsOOSQLiteStmt">ooSQLiteStmt</link>, and an <link
linkend="clsOOSQLiteBackup">ooSQLiteBackup</link> object have a <emphasis role="italic">lastErrMsg</emphasis> and
a <emphasis role="italic">lastErrCode</emphasis> attribute. These attributes all serve the same basic purpose, to
hold the last error message and code recorded by ooSQLite.
</para>
<para>
The attributes are most useful when the invocation of <emphasis role="italic">new</emphasis> fails to initialize the
object correctly due to an error. The <emphasis role="italic">lastErrMsg</emphasis> and <emphasis
role="italic">lastErrCode</emphasis> attributes are always updated during <emphasis role="italic">new</emphasis>.
In general, these objects do not update the attributes after every method invocation.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example uses the <emphasis role="italic">lastErrMsg</emphasis> attribute to produce a meaningful error message when
a database connection fails to open:
<programlisting>
<![CDATA[
dbName = 'ooFotods.rdbx'
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE)
if dbConn~initCode <> 0 then do
errRC = dbConn~lastErrCode
errMsg = dbConn~lastErrMsg
say 'ooSQLiteConnection initialization error:' dbConn~initCode
say ' Error code:' errRC '('errMsg')'
dbConn~close
return errRC
end
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::lastErrMsg() [attribute] -->
<section id="atrRecordFormatClsConn"><title>recordFormat (Attribute)</title>
<indexterm><primary>recordFormat</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>recordFormat</secondary></indexterm>
<programlisting>
<![CDATA[
>>--recordFormat---------------------------------><
>>--recordFormat = varName-----------------------><
]]>
</programlisting>
<para>
Over-rides the process-wide default record format set through the ooSQLite <link
linkend="atrRecordFormatClsOOSQLite">class</link> for this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">recordFormat get:</emphasis></term>
<listitem>
<para>
The value of this attribute is one of the ooSQLite Result Set Format <link
linkend="sctOOSQLiteSpecific">Constants</link> that define how a result set is formatted. This value defines the format
of all result sets produced by this connection. If the programmer has not changed the value of the attribute explicitly,
its value is the same as the default value set by the <computeroutput>ooSQLite</computeroutput> classes <link
linkend="atrRecordFormatClsOOSQLite">recordFormat</link> attribute.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">recordFormat set:</emphasis></term>
<listitem>
<para>
To over-ride the application-wide record format for result sets, assign one one of the ooSQLite Result Set Format <link
linkend="sctOOSQLiteSpecific">Constants</link> to this attribute. This default can still be over-ridden at <link
linkend="clsOOSQLiteStmt">statment</link> or method level. If not over-ridden, all returned result sets from this
database connection will have the format specified by this attribute.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::recordFormat() [attribute] -->
<section id="mthBusyHandler"><title>busyHandler</title>
<indexterm><primary>busyHandler</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>busyHandler</secondary></indexterm>
<programlisting>
<![CDATA[
>>--busyHandler(--callBackObj--+------------+--+------------+--)---------------><
+-,-mthName--+ +-,-userData-+
]]>
</programlisting>
<para>
Installs a user defined busy handler.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>callBackObj [required]</term>
<listitem>
<para>
An instantiated object with a method that might be invoked whenever an attempt is made to open a database table that
another thread or process has locked.
</para>
<para>
However, this argument can also be .nil to indicate that any installed busy handler is to be removed. When no busy
handler is installed then BUSY or IOERR_BLOCKED is returned immediately upon encountering the lock.
</para>
</listitem></varlistentry>
<varlistentry><term>mthName [optional]</term>
<listitem>
<para>
The method name that will be invoked during a call back. By default, the method invoked will be <emphasis
role="italic">busyCallBack()</emphasis>. However, the user can specify an alternative method if desired. This
argument is ignored when the <emphasis role="italic">callbackObj</emphasis> argument is .nil.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optional]</term>
<listitem>
<para>
This can be any Rexx object the user desires. The object will be sent as the second argument to the busy callback
method when it is invoked. This argument is ignored when the callbackObj argument is .nil.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns a SQLite result <link linkend="sctResultCode">code</link>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
By default, there is no busy handler installed.
</para>
<para>
There can only be one busy handler installed. Setting a new busy handler automatically clears any previously installed
handler. Note that invoking <link linkend="mthBusyTimeOut">busyTimeOut</link> can also set or clear the busy handler.
</para>
<para>
The busy handler should not take any actions which modify the database connection that invoked the busy handler. Any such
actions result in undefined behavior.
</para>
<para>
A busy handler must not close the database connection or prepared statement that invoked the busy handler.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">busyHandler</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/busy_handler.html">sqlite3_busy_handler</ulink> API.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example installs a busy handler with a <emphasis role="italic">onTimeOut</emphasis> method that is to be invoked. It
passes the busy handler object itself as the <emphasis role="italic">userData</emphasis> argument:
<programlisting>
<![CDATA[
helper = .MyHelperClass~new
db = .ooSQLiteConnection~new('phoneBook.rdbx')
if db~initCode <> 0 then return db~lastErrCode
db~busyHandler(helper, onTimeOut, helper)
...
::class 'MyHelperClass
::method onTimeOut unguarded
use arg count, helperObj
if helperObj~query(count) == "ABANDON_TIMEOUT" then return 0
else return 1
::method query private unguarded
use strict arg count
{ code that determines what to return }
...
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
<section id="mthBusyCallBack"><title>busyCallBack</title>
<indexterm><primary>busyCallBack</primary></indexterm>
<indexterm><primary>Callback Methods</primary><secondary>busyCallBack</secondary></indexterm>
<programlisting>
<![CDATA[
>>--busyCallBack(--countInvoked,--userData--)----><
]]>
</programlisting>
<para>
The <emphasis role="italic">busyCallBack</emphasis> method is an example of a user callback method for the <link
linkend="mthBusyHandler">busyHandler</link> method. Here the method name of <emphasis role="italic">busyCallBack</emphasis>
is used, because it is the default method name if the programmer does not specify his own name in the <emphasis
role="italic">busyHandler</emphasis> method. Any method name can be used by specifying it as the second argument to
<emphasis role="italic">busyHandler</emphasis>.
</para>
<para>
<emphasis role="bold">Note:</emphasis> there is no <emphasis role="italic">busyCallBack</emphasis> method in any ooSQLite
class. This method is just used to illustrate how to define a user callback method to be used as a busy handler.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments sent to the callback method are:
</para>
<variablelist>
<varlistentry><term>countInvoked [required]</term>
<listitem>
<para>
The number of times that the busy handler has been invoked for this locking event.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optional]</term>
<listitem>
<para>
The user data object specified by the programmer as the third argument to the <emphasis
role="italic">busyHandler</emphasis> method. If the programmer did not specify a user data argument, this argument is
omitted when the callback is invoked.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The programmer must return a value from the callback. If the method returns 0, then no additional attempts are made to
access the database by the SQLite database engine and SQLITE_BUSY or SQLITE_IOERR_BLOCKED is returned. If the callback
returns non-zero, then another attempt is made to open the database for reading and the cycle repeats.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The implementation of a <emphasis role="italic">busy handler</emphasis> method is is discussed on the SQLite <ulink
url="http://www.sqlite.org/c3ref/busy_handler.html">sqlite3_busy_handler</ulink> page.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::busyCallBack() -->
</section> <!-- End ooSQLiteConnection::busyHandler() -->
<section id="mthBusyTimeOut"><title>busyTimeOut</title>
<indexterm><primary>busyTimeOut</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>busyTimeOut</secondary></indexterm>
<programlisting>
<![CDATA[
>>--busyTimeOut(--milliseconds--)----------------><
]]>
</programlisting>
<para>
Sets a busy handler that sleeps for the specified amount of time when a table is locked. The handler sleeps multiple times
until the specified time has been accumulated. After the specified milliseconds of sleeping, the handler returns 0 which
causes <link linkend="mthStepClsStmt">step</link> to return BUSY or IOERR_BLOCKED.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>milliseconds</term>
<listitem>
<para>
The whole number of milliseconds the busy handler should sleep when a table is locked. If <emphasis
role="italic">milliseconds</emphasis> is less than or equal to zero all busy handlers are turned off.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method will aways return <computeroutput>OK</computeroutput>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
After the specified milliseconds of sleeping, the handler returns 0 which causes <link
linkend="mthStepClsStmt">step</link> to return BUSY or IOERR_BLOCKED. There can only be a single busy handler for a
particular database connection any any given moment. If another busy handler was defined, using <link
linkend="mthBusyHandler">busyHandler</link>, prior to calling this routine, that other busy handler is cleared.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">busyTimeOut</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/busy_timeout.html">sqlite3_busy_timeout</ulink> API.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example sets a busy timeout value of 3 seconds:
<programlisting>
<![CDATA[
db = .ooSQLiteConnection~new('phoneBook.rdbx')
if db~initCode <> 0 then return db~lastErrCode
db~busyTimeout(3000)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::busyTimeOut() -->
<section id="mthChanges"><title>changes</title>
<indexterm><primary>changes</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>changes</secondary></indexterm>
<programlisting>
<![CDATA[
>>--changes--------------------------------------><
]]>
</programlisting>
<para>
Returns the number of database rows that were changed or inserted or deleted by the most recently completed SQL
statement on this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments to this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The number of changed, deleted, or inserted rows.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Only changes that are directly specified by the INSERT, UPDATE, or DELETE statement are counted. Auxiliary changes caused
by triggers or foreign key actions are not counted. Use the <link linkend="mthTotalChanges">totalChanges</link> method to
find the total number of changes including changes caused by triggers and foreign key actions.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">changes</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/changes.html">sqlite3_changes</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::changes() -->
<section id="mthClose"><title>close</title>
<indexterm><primary>close</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>close</secondary></indexterm>
<programlisting>
<![CDATA[
>>--close----------------------------------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">close</emphasis> method releases all systems resources that have been allocated for the
database connection. Once the connection has been closed, it is an error to invoke any method of the
<computeroutput>ooSQLiteConnection</computeroutput> object that interacts with the SQLite database. All connection objects
should be closed when they are no longer needed, even connection objects that were instantiated with an error.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments for this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
An ooSQLite <link linkend="sctResultCode">result</link> code. Returns OK if the connection is successfully closed and
all associated resources are deallocated. Returns BUSY if the connection is associated with unfinalized prepared
statements or unfinished backup objects.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Programs should finalize all prepared statements, close all BLOB handles, and finish all backup objects associated with
the connection object prior to attempting to close the object. It is a harmless nop to invoke <emphasis
role="italic">close</emphasis> on a connection object that has already been closed. The attributes of the object are
still valid after the connection is closed, but invoking other methods of a closed connection object is an error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">close</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/close.html">sqlite3_close</ulink> API.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example opens a database to do some work with it, then closes it. Note that if an error ocurrs trying to open the
database, the connection object is still closed:
<programlisting>
<![CDATA[
dbFile = 'ooFoods.rdbx'
db = .ooSQLiteConnection~new(dbFile, .ooSQLite~OPEN_READWRITE)
if db~initCode <> 0 then do
-- do error stuff
...
db~close
return 99
end
-- work with the database
...
db~close
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::close() -->
<section id="mthCommitHook"><title>commitHook</title>
<indexterm><primary>commitHook</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>commitHook</secondary></indexterm>
<programlisting>
<![CDATA[
>>--commitHook(--callBackObj--+------------+--+------------+--)----------------><
+-,-mthName--+ +-,-userData-+
]]>
</programlisting>
<para>
Registers a callback method to be invoked whenever a transaction is committed.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>callBackObj [required]</term>
<listitem>
<para>
An instantiated object with a method that will be invoked whenever a transaction is committed.
</para>
<para>
However, this argument can also be .nil to indicate that any installed commit hook is to be removed.
</para>
</listitem></varlistentry>
<varlistentry><term>mthName [optional]</term>
<listitem>
<para>
The method name that will be invoked during a call back. By default, the method invoked will be <emphasis
role="italic">commitHookCallBack()</emphasis>. However, the user can specify an alternative method if desired. This
argument is ignored when the <emphasis role="italic">callbackObj</emphasis> argument is .nil.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optional]</term>
<listitem>
<para>
This can be any Rexx object the user desires. The object will be sent as the first and only argument to the commit
hook callback method when it is invoked. This argument is ignored when the callbackObj argument is .nil.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">userData</emphasis> argument to a previous invocation of the <emphasis
role="italic">commitHook</emphasis> method on the same database connection, or .nil if there has not been a previous
invocation or the <emphasis role="italic">userData</emphasis> argument was not used on the previous invocation.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">commitHook</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/commit_hook.html">sqlite3_commit_hook</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
<section id="mthCommitHookCallBack"><title>commitHookCallBack</title>
<indexterm><primary>commitHookCallBack</primary></indexterm>
<indexterm><primary>Callback Methods</primary><secondary>commitHookCallBack</secondary></indexterm>
<programlisting>
<![CDATA[
>>--commitHookCallBack(--userData--)-------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">commitHookCallBack</emphasis> method is an example of a user callback method for the <link
linkend="mthCommitHook">commitHook</link> method. Here the method name of <emphasis
role="italic">commitHookCallBack</emphasis> is used, because it is the default method name if the programmer does not
specify his own name in the <emphasis role="italic">commitHook</emphasis> method. Any method name can be used by
specifying it as the second argument to the <emphasis role="italic">commitHook</emphasis> method.
</para>
<para>
<emphasis role="bold">Note:</emphasis> there is no <emphasis role="italic">commitHookCallBack</emphasis> method in any
ooSQLite class. This method is just used to illustrate how to define a user callback method to be used with the commit
hook.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument sent to the callback method is:
</para>
<variablelist>
<varlistentry><term>userData [required]</term>
<listitem>
<para>
The user data object specified by the programmer as the third argument to the <emphasis
role="italic">commitHook</emphasis> method. If the programmer did not specify a user data argument, this will be the
<computeroutput>.nil</computeroutput> object.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The programmer must return a value from the callback. If the method returns 0, then the commit is allowed to continue
normally. If the callback returns non-zero, then the COMMIT is converted into a ROLLBACK. If a <link
linkend="mthRollbackHook">rollback</link> hook has been installed, it is invoked just as it would be for any other
rollback.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The callback method must not do anything that will modify the database connection that invoked the callback. Any actions
to modify the database connection must be deferred until after the completion of the <link
linkend="mthStepClsStmt">step</link> invocation that triggered the commit hook to begin with. Running any other SQL
statements, including SELECT statements, or merely instantiating a new <link linkend="mthNewClsStmt">statement</link>
object, or executing another <emphasis role="italic">step</emphasis> method will modify the database connection.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The implementation of a <emphasis role="italic">commit hook</emphasis> method is is discussed on the SQLite <ulink
url="http://www.sqlite.org/c3ref/commit_hook.html">sqlite3_commit_hook</ulink> page.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::commitHookCallBack() -->
</section> <!-- End ooSQLiteConnection::commitHook() -->
<section id="mthDbFileName"><title>dbFileName</title>
<indexterm><primary>dbFileName</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>dbFileName</secondary></indexterm>
<programlisting>
<![CDATA[
>>--dbFileName(--name--)-------------------------><
]]>
</programlisting>
<para>
Returns the database file name of the database specified by <emphasis role="italic">name</emphasis>.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>name [required]</term>
<listitem>
<para>
The database <link linkend="defDatabaseName">name</link>, as known internally by the SQLite database engine, of the
database to get the file name for.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The file name of the database specified by <emphasis role="italic">name</emphasis> on success. If there is no <emphasis
role="italic">name</emphasis> database on the database connection, or if <emphasis role="italic">name</emphasis> is a
temporary or in-memory database, then the empty string is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The filename returned will be an absolute pathname, even if the filename used to open the database originally was a URI
or relative pathname.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">dbFileName</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/db_filename.html">sqlite3_db_filename</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::dbFileName() -->
<section id="mthDbMutex"><title>dbMutex</title>
<indexterm><primary>dbMutex</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>dbMutex</secondary></indexterm>
<programlisting>
<![CDATA[
>>--dbMutex--------------------------------------><
]]>
</programlisting>
<para>
Retrieves an <link linkend="clsOOSQLiteMutex">ooSQLitMutex</link> object that represents the SQLite mutex that serializes
access to this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method takes no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
An <computeroutput>ooSQLiteMutex</computeroutput> object that gives access to the underlying SQLite mutex serializing
acces to this database connection. The mutex object could be a <link linkend="atrClosedClsMutex">closed</link> <link
linkend="atrIsNull">null</link> mutex, see the remarks section.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
If the threading <link linkend="defThreadingMode">mode</link> for this database connection is not serialized, then
the returned mutex object will be a closed, null, mutex. This is not likely.
</para>
<para>
The <emphasis role="italic">dbMutex</emphasis> method is provided for completeness. It is expected that Rexx programmers
who do not understand mutexes well and / or do not understand how SQLite itself works with respect to the mutex that
serializes access to the database connection, will not use this method.
</para>
<para>
Since the <computeroutput>ooSQLiteMutex</computeroutput> object returned by the <emphasis
role="italic">dbMutex</emphasis> method represents a mutex in use by the SQLite database engine, invoking <link
linkend="mthFree">free</link> on the object closes the Rexx object, but does not actually close the underlying SQLite
mutex.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">dbMutex</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/db_mutex.html">sqlite3_db_mutex</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::dbMutex() -->
<section id="mthDbReadOnly"><title>dbReadOnly</title>
<indexterm><primary>dbReadOnly</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>dbReadOnly</secondary></indexterm>
<programlisting>
<![CDATA[
>>--dbReadOnly(--name--)-------------------------><
]]>
</programlisting>
<para>
Determines if the named database on this connection is read only.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>name [required]</term>
<listitem>
<para>
The database <link linkend="defDatabaseName">name</link>, as known internally by the SQLite database engine, of the
database to check for read only.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns 1 if the database is read only, 0 if the database is read / write, and -1 if <emphasis
role="italic">name</emphasis> is not an opened database on this connection.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Additional comments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">dbReadOnly</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/db_readonly.html">sqlite3_db_readonly</ulink> API.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example illustrates the <emphasis role="italic">dbReadOnly</emphasis> method:
<programlisting>
<![CDATA[
dbName = 'ooFoods.rdbx'
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READONLY)
if dbConn~initCode <> 0 then do
-- Do error stuff and return
end
dbConn~exec("ATTACH DATABASE 'phonebook.db' AS phone;", .true)
dbConn~exec("ATTACH DATABASE 'ooFoodsCopy.rdbx' AS dupe;", .true)
say 'Read only? main: ' dbConn~dbReadOnly('main')
say 'Read only? phone:' dbConn~dbReadOnly('phone')
say 'Read only? dupe: ' dbConn~dbReadOnly('dupe')
say 'Read only? temp: ' dbConn~dbReadOnly('temp')
ret = dbConn~close
/* Output might be:
Read only? main: 1
Read only? phone: 1
Read only? dupe: 1
Read only? temp: -1
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::dbReadOnly() -->
<section id="mthDbReleaseMemory"><title>dbReleaseMemory</title>
<indexterm><primary>dbReleaseMemory</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>dbReleaseMemory</secondary></indexterm>
<programlisting>
<![CDATA[
>>--dbReleaseMemory------------------------------><
]]>
</programlisting>
<para>
Causes the SQLite database engine to attempt to free as much heap memory as possible from this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method has no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns an ooSQLite <link linkend="sctResultCode">result</link> code. Although the SQLite documentation does not
explicitly state this, it seems likely that OK is always returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
See also the <link linkend="mthReleaseMemory">releaseMemory</link> method of the <link
linkend="clsOOSQLite">ooSQLite</link> class.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">DbReleaseMemoyr</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/db_release_memory.html">sqlite3_db_release_memory</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::dbReleaseMemory() -->
<section id="mthDbStatus"><title>dbStatus</title>
<indexterm><primary>dbStatus</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>dbStatus</secondary></indexterm>
<programlisting>
<![CDATA[
>>--dbStatus(--opt--,--result--+----------+--)---><
+-,-reset--+
]]>
</programlisting>
<para>
Retrieves runtime status information about this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>opt [required]</term>
<listitem>
<para>
A DB status parameter <link linkend="sctDBStatusParameter">constant</link> that specifies what status information is
requested.
</para>
</listitem></varlistentry>
<varlistentry><term>result [required]</term>
<listitem>
<para>
A <computeroutput>Directory</computeroutput> object whose indexes will hold the requestion information on return. On
success the following indexes in the object will be valid:
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">CURRENT</emphasis></term>
<listitem>
<para>
This index will contain the current value for the status information queried.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">HIGHWATER</emphasis></term>
<listitem>
<para>
This index will hold the high water mark for the status information queried.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term>reset [optional]</term>
<listitem>
<para>
Must be true or false to specify whether the high water mark should be reset, or not. The default if this argument is
omitted is false, do not reset the high water mark.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns a SQLite result <link linkend="sctResultCode">code</link>, <computeroutput>OK</computeroutput> on success
otherwise an error code on failure.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
If the high water mark is reset, it is reset to the current value of the status information. The ooSQLite DB status
constants reflect the currently available SQLite DB status options. The set of SQLilte DB status options is likely to
grow in future releases of SQLite. When, or if, those options grow, the ooSQLite constants will be updated to reflect the
new options
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">dbStatus</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/db_status.html">sqlite3_db_status</ulink> API.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example checks the values of the page memory useed by the caches for the database connection and does not reset the
high water mark:
<programlisting>
<![CDATA[
dbName = 'ooFoods.rdbx'
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE)
if dbConn~initCode <> 0 then do
-- do error handling and return
end
values = .directory~new
ret = dbConn~dbStatus(.ooSQLite~DBSTATUS_CACHE_USED, values, .false)
if ret == .dbConn~OK then do
say 'Bytes of page memory used by all caches on this database connection:'
say ' Current:' values~current ' High water:' values~highWater
say
end
else do
say 'Error returned from dbStatus():' ret
say
end
/* Output might be:
Bytes of page memory used by all caches on this database connection:
Current: 16824 High water: 0
*/
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::dbStatus() -->
<section id="mthErrCode"><title>errCode</title>
<indexterm><primary>errCode</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>errCode</secondary></indexterm>
<programlisting>
<![CDATA[
>>--errCode--------------------------------------><
]]>
</programlisting>
<para>
Returns the numeric result <link linkend="sctResultCode">code</link> for the most recent failed SQLite API call associated
with this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method has no arguments
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is a numeric result code.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <link linkend="mthErrMsg">errMsg</link> method provides an English-language description of the current value of
<emphasis role="italic">errCode</emphasis>. If a previous SQLite API call failed, but the most recent call succeeded, the
return from <emphasis role="italic">errCode</emphasis> and <emphasis role="italic">errMsg</emphasis> is undefined. If a
SQLite API fails with a result code of MISUSE, that means the API was invoked incorrectly by the program. In that case,
the error code and message may or may not be set.
</para>
<para>
In SQLite, extended result codes are turned off by default, so the SQLite API provides an extended error code API that
returns the extended result codes even if extended result codes are turned off. In ooSQLite however, the extended result
codes are turned on during compilation. This makes the <emphasis role="italic">errCode</emphasis> method and the <link
linkend="mthExtendedErrCode">extendedErrCode</link> method exactly equivalent. The <emphasis
role="italic">extendedErrCode</emphasis> method is provided for completeness
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">errCode</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/errcode.html">sqlite3_errcode</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::errCode() -->
<section id="mthErrMsg"><title>errMsg</title>
<indexterm><primary>errMsg</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>errMsg</secondary></indexterm>
<programlisting>
<![CDATA[
>>--errMsg---------------------------------------><
]]>
</programlisting>
<para>
Returns the English-language text that describes the current<link linkend="mthErrCode">errCode</link> value.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method has no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
A string describing the current <emphasis role="italic">errCode</emphasis> value.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">errMsg</emphasis> method provides an English-language description of the current value of
<link linkend="mthErrCode">errCode</link>. If a previous SQLite API call failed, but the most recent call succeeded, the
return from <emphasis role="italic">errCode</emphasis> and <emphasis role="italic">errMsg</emphasis> is undefined. If a
SQLite API fails with a result code of MISUSE, that means the API was invoked incorrectly by the program. In that case,
the error code and message may or may not be set.
</para>
<para>
In SQLite, extended result codes are turned off by default, so the SQLite API provides an extended error code API that
returns the extended result codes even if extended result codes are turned off. In ooSQLite however, the extended result
codes are turned on during compilation. This makes the <emphasis role="italic">errCode</emphasis> method and the <link
linkend="mthExtendedErrCode">extendedErrCode</link> method exactly equivalent. The <emphasis
role="italic">extendedErrCode</emphasis> method is provided for completeness
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">errMsg</emphasis> method is similar to that of the SQLite <ulink
url="http://www.sqlite.org/c3ref/errcode.html">sqlite3_errmsg</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::errMsg() -->
<section id="mthExec"><title>exec</title>
<indexterm><primary>exec</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>exec</secondary></indexterm>
<programlisting>
<![CDATA[
>>--exec(--sql-+---------+-+----------+-+---------+-+-----------+-+---------+--)---><
+-,-useCB-+ +-,-format-+ +-,-cbObj-+ +-,-mthName-+ +-,-uData-+
]]>
</programlisting>
<para>
Executes the specified SQL statement(s). A callback is invoked for each result row coming out of the evaluated SQL
statements. This callback can either be a callback internal to the ooSQLite framework, or a callback to a method in an
object supplied by the programmer.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>sql [required]</term>
<listitem>
<para>
A string containing the SQL statement, or statements, to execute. More than 1 statement can be executed by including
semi-colons in the string. Each SQL statement is ended with a semi-colon.
</para>
</listitem></varlistentry>
<varlistentry><term>useCB [optional]</term>
<listitem>
<para>
True or false to indicate if the callback feature should be used or not.
</para>
<para>
If this argument is false, the <emphasis role="italic">sql</emphasis> is simply executed and a result code returned.
The other arguments are ignored. The default if this argument is omitted is false.
</para>
<para>
If this argument is true, then the callback feature is used. If the <emphasis role="italic">cbObj</emphasis> arg is
omitted then an internal callback of the ooSQLite framework is used and a result set is returned. The result set
could be empty if the sql does not produce a result set. The format for the returned result set will the format
specified by the <link linkend="atrRecordFormatClsConn">recordFomat</link> attribute of this database connection.
However, the default format can be overridden for this invocation of exec() through the optional <emphasis
role="italic">format</emphasis> argument.
</para>
<para>
Otherwise, if <emphasis role="italic">cbObj</emphasis> is not omitted, then the call back method of that object is
invoked for each result row coming out of the evaluated SQL statements. In this case the return is the result code
from the database engine's execution.
</para>
</listitem></varlistentry>
<varlistentry><term>format [optional]</term>
<listitem>
<para>
This argument can be used to specify the format of the result row(s) coming out of the evaluated SQL statements. If
this argument is omitted the default <link linkend="atrRecordFormatClsConn">format</link> value for this connection
is used. If specified, it must be one of the ooSQLite Result Set Format <link
linkend="sctOOSQLiteSpecific">Constants</link> that define how a result set is formatted. The format effects the
result set if a result set is returned, and the format of the result row sent to a user defined callback when a user
defined callback is used.
</para>
</listitem></varlistentry>
<varlistentry><term>cbObj [optional]</term>
<listitem>
<para>
Specifies that a user defined callback should be used rather than the ooSQLite internal callback. A callback method
in this object is inovked for each row coming out of the evaluated SQL statement(s). By default the method invoked in
the object will be <computeroutput>execCallBack</computeroutput>. However the optional <emphasis
role="italic">mthName</emphasis> argument can be used to change this.
</para>
<para>
If this argument omitted, the internal ooSQLite callback is used. This argument is ignored if <emphasis
role="italic">useCB</emphasis> is false.
</para>
</listitem></varlistentry>
<varlistentry><term>mthName [optional]</term>
<listitem>
<para>
Names the method to be invoked in <emphasis role="italic">cbObj</emphasis>. This argument is ignored if <emphasis
role="italic">cbObj</emphasis> is omitted, or <emphasis role="italic">useCB</emphasis> is false. By default the
method invoked in <emphasis role="italic">cbObj</emphasis> is <computeroutput>execCallBack</computeroutput>.
</para>
</listitem></varlistentry>
<varlistentry><term>uData [optional]</term>
<listitem>
<para>
User data that is passed to the user defined callback method. This can be any Rexx object the programmer wishes to
use. The object is passed as the third argument to the callback method. This argument is ignored if <emphasis
role="italic">useCB</emphasis> is false, or if <emphasis role="italic">cbObj</emphasis> is omitted.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return value is dependent on whether the internal ooSQLite callback is used or not. When the internal callback is
used, a result set is returned containing all the result rows produced by the SQL statement(s). In all other cases a
result <link linkend="sctResultCode">code</link> is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The easiest approach to using this method is to use the internal callback of the ooSQLite framework. However, it is
possible that more control might be desired in the processing of the result rows than the internal callback provides. In
this case, a user defined callback can be used. The <link linkend="mthExecCallBack">execCallBack</link> method explains
the details of a user defined callback method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">exec</emphasis> method is similar to that of the <ulink
url="http://www.sqlite.org/c3ref/exec.html">sqlite3_exec</ulink> SQLite API.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example shows the <emphasis role="italic">exec</emphasis> method invoction to use the internal callback of the
ooSQLite framework. The format of the returned result set is specified to be an array of arrays:
<programlisting>
<![CDATA[
dbName = 'ooFoods.rdbx'
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE)
sql = 'SELECT * FROM foods ORDER BY name;'
resultSet = dbConn~exec(sql, .true, .ooSQLite~OO_ARRAY_OF_ARRAYS)
z = printResultSet(resultSet)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
<section id="mthExecCallBack"><title>execCallBack</title>
<indexterm><primary>execCallBack</primary></indexterm>
<indexterm><primary>Callback Methods</primary><secondary>execCallBack</secondary></indexterm>
<programlisting>
<![CDATA[
>>--execCallBack(--row--,--rowNum--,--userData--)---------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">execCallBack</emphasis> method is an example of a user callback method for the <link
linkend="mthExec">exec</link> method. Here the method name of <emphasis role="italic">execCallBack</emphasis> is used,
because it is the default method name if the programmer does not specify her own name in the <emphasis
role="italic">exec</emphasis> method. Any method name can be used by specifying it as the fifth argument to <emphasis
role="italic">exec</emphasis>.
</para>
<para>
<emphasis role="bold">Note:</emphasis> there is no <emphasis role="italic">execCallBack</emphasis> method in any ooSQLite
class. This method is just used to illustrate how to define a user callback method.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments sent to the callback method are:
<variablelist>
<varlistentry><term>row</term>
<listitem>
<para>
The current result row produced by executing the SQL statement(s) passed to the <emphasis
role="italic">exec</emphasis> method. The exact format of this argument is dependent on the result set format in use.
See the remarks for details.
</para>
</listitem></varlistentry>
<varlistentry><term>rowNum</term>
<listitem>
<para>
The current result row number.
</para>
</listitem></varlistentry>
<varlistentry><term>userData</term>
<listitem>
<para>
The user data object specified by the programmer as the sixth argument to the <emphasis role="italic">exec</emphasis>
method. If the programmer did not specify a user data argument, this argument is omitted when invoking the callback.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The programmer must return a value from the callback. This value can by any of the ooSQLite result <link
linkend="sctResultCode">code</link> constants, but if it is not the <computeroutput>OK</computeroutput> constant,
then the SQLite database engine aborts without invoking the callback again and without running any subsequent SQL
statements. Note that returning some other result code than <computeroutput>OK</computeroutput> allows the callback to
halt the processing of the result rows at an early stage.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The value of the <emphasis role="italic">row</emphasis> argument is dependent on the default result set format in use for
the invocation of the <link linkend="mthExec">exec</link> method that generates the callback invocation. These are the
possible formats:
</para>
<variablelist>
<varlistentry><term>OO_ARRAY_OF_ARRAYS:</term>
<listitem>
<para>
The <emphasis role="italic">row</emphasis> argume will be an array with exactly 2 indexes. Index 1 will be an array of
the column names for the result row. Index 2 will be an array for the corresponding values of the column.
</para>
</listitem></varlistentry>
<varlistentry><term>OO_ARRAY_OF_DIRECTORIES:</term>
<listitem>
<para>
The <emphasis role="italic">row</emphasis> argument will be a <computeroutput>Directory</computeroutput> object where
the indexes of the directory are the column names and the value of the index is the value of the column.
</para>
</listitem></varlistentry>
<varlistentry><term>OO_STEM_OF_STEMS:</term>
<listitem>
<para>
The <emphasis role="italic">row</emphasis> argument will be a <computeroutput>Stem</computeroutput> object where
the indexes of the stem are the column names and the value of the index is the value of the column.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example is just used to show the principles of a user defined callback. The actual processing has no benefit over
usin the internal callback. A user class is defined with a callback method. This is passed to the <emphasis
role="italic">exec</emphasis> method. The default record format is OO_OO_ARRAY_OF_DIRECTORIES. In the callback method,
each record is added to the user data object, which in this case is an array. On return from the <emphasis
role="italic">exec</emphasis> method, if there were no errors, the <emphasis role="italic">resultObj</emphasis> array
will contain all the result rows produced by executing the SQL statement:
<programlisting>
<![CDATA[
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE)
resultObj = .array~new(500)
cbObj = .UserCallBack~new
sql = 'SELECT * FROM foods ORDER BY name;'
ret = dbConn~exec(sql, .true, , cbObj, , resultObj)
,,,
::class 'UserCallBack' inherit ooSQLiteConstants
::method execCallBack
use arg row, rowNum, userObj
userObj[rowNum] = row
return self~OK
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::execCallBack() -->
</section> <!-- End ooSQLiteConnection::exec() -->
<section id="mthExtendedErrCode"><title>extendedErrCode</title>
<indexterm><primary>extendedErrCode</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>extendedErrCode</secondary></indexterm>
<programlisting>
<![CDATA[
>>--extendedErrCode------------------------------><
]]>
</programlisting>
<para>
Returns the numeric result <link linkend="sctResultCode">code</link> for the most recent failed SQLite API call associated
with this database connection. The <emphasis role="italic">extendedErrCode</emphasis> and the <link
linkend="mthErrCode">errCode</link> methods are functionally equivalent, see the remarks.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method takes no arugments
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns a numeric result code.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The <link linkend="mthErrMsg">errMsg</link> method provides an English-language description of the current value of
<emphasis role="italic">extendedErrCode</emphasis>. If a previous SQLite API call failed, but the most recent call
succeeded, the return from <emphasis role="italic">extendedErrCode</emphasis> and <emphasis
role="italic">errMsg</emphasis> is undefined. If a SQLite API fails with a result code of MISUSE, that means the API was
invoked incorrectly by the program. In that case, the error code and message may or may not be set.
</para>
<para>
In SQLite, extended result codes are turned off by default, so the SQLite API provides an extended error code API that
returns the extended result codes even if extended result codes are turned off. In ooSQLite however, the extended result
codes are turned on during compilation. This makes the <emphasis role="italic">errCode</emphasis> method and the
<emphasis role="italic">extendedErrCode</emphasis> method exactly equivalent. The <emphasis
role="italic">extendedErrCode</emphasis> method is provided for completeness.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">extendedErrCode</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/errcode.html">sqlite3_extended_errcode</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::extendedErrCode() -->
<section id="mthExtendedResultCodes"><title>extendedResultCodes</title>
<indexterm><primary>extendedResultCodes</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>extendedResultCodes</secondary></indexterm>
<programlisting>
<![CDATA[
>>--extendedResultCodes(--onOff--)---------------><
]]>
</programlisting>
<para>
This is a nop in ooSQLite, extended result codes are always on.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>onOff</term>
<listitem>
<para>
True or false to turn extended result codes on or off. However, this arugment is currently ignored, extended result
codes are always on in ooSQLite.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns OK, always.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The method is provided for completeness. In SQLite, extended result code are off by default for historical reasons.
ooSQLite, however, has no history to make this applicable, so extended result code are always on.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">extendedResultCode</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/extended_result_codes.html">sqlite3_extended_result_codes</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::extendedResultCodes() -->
<section id="mthGetAutocommit"><title>getAutocommit</title>
<indexterm><primary>getAutocommit</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>getAutocommit</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getAutocommit--------------------------------><
]]>
</programlisting>
<para>
Determines if this database connection is, or is not, in autocommit mode.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method does not take any arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns true if the connection is in autocommit mode, otherwise false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Autocommit mode is on by default. Autocommit mode is disabled by a BEGIN statement. Autocommit mode is re-enabled by a
COMMIT or ROLLBACK. If certain kinds of errors happen on a statement within a multi-statement transaction then the
transaction might be rolled back automatically. The only way to find out whether SQLite automatically rolled back the
transaction after an error is to use this function.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">getAutoCommit</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/get_autocommit.html">sqlite3_get_autocommit</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::getAutocommit() -->
<section id="mthInterrupt"><title>interrupt</title>
<indexterm><primary>interrupt</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>interrupt</secondary></indexterm>
<programlisting>
<![CDATA[
>>--interrupt------------------------------------><
]]>
</programlisting>
<para>
<emphasis role="italic">Interrupt</emphasis> causes any pending database operation to abort and return at the earliest
opportunity.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments to this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
xx
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
This method is safe to call from a different thread than the thread that is currently running the database
operation. But it is not safe to call this routine with a database connection that might close before <emphasis
role="italic">interrupt</emphasis> returns. If a SQL operation is very nearly finished at the time when <emphasis
role="italic">interrupt</emphasis> is invoked, then it might not have an opportunity to be interrupted and might continue
to completion. A SQL operation that is interrupted will return INTERRUPT result code. If the interrupted SQL operation is
an INSERT, UPDATE, or DELETE that is inside an explicit transaction, then the entire transaction will be rolled back
automatically.
</para>
<para>
The <emphasis role="italic">interrupt</emphasis> call is in effect until all currently running SQL statements on this
database connection complete. Any new SQL statements that are started after the <emphasis
role="italic">interrupt</emphasis> call and before the running statement count reaches zero are interrupted as if they
had been running prior to the <emphasis role="italic">interrupt</emphasis> call. New SQL statements that are started
after the running statement count reaches zero are not effected by the <emphasis role="italic">interrupt</emphasis>. A
call to <emphasis role="italic">interrupt</emphasis> that occurs when there are no running SQL statements is a no-op and
has no effect on SQL statements that are started after the <emphasis role="italic">interrupt</emphasis> call returns.
</para>
<para>
If this database connection closes while <emphasis role="italic">interrupt</emphasis> is running then bad things will
likely happen.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">interrupt</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/interrupt.html">sqlite3_interrupt</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::interrupt() -->
<section id="mthLastInsertRowID"><title>lastInsertRowID</title>
<indexterm><primary>lastInsertRowID</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>lastInsertRowID</secondary></indexterm>
<programlisting>
<![CDATA[
>>--lastInsertRowID------------------------------><
]]>
</programlisting>
<para>
Returns the rowid of the most recent successful INSERT into the database from this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method has no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the unique whole number <emphasis role="italic">rowid</emphasis> of the most recent, successful INSERT statement
on this database connection
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
Every row of every SQLite table has a 64-bit signed integer key that uniquely identifies the row within its table. This
integer is usually called the <emphasis role="italic">rowid</emphasis>. The rowid value can be accessed using one of the
special case-independent names <emphasis role="italic">rowid</emphasis>, <emphasis role="italic">oid</emphasis>, or
<emphasis role="italic">_rowid_</emphasis> in place of a column name. If a table contains a user defined column named
using any of these 3 special names, then that name always refers the explicitly declared column and cannot be used to
retrieve the integer rowid value.
</para>
<para>
The SQLite documentation contains very detailed and complete documentation concerning the <ulink
url="http://www.sqlite.org/c3ref/last_insert_rowid.html">last</ulink> rowid and the <ulink
url="http://www.sqlite.org/lang_createtable.html#rowid">rowid</ulink> itself. That documentation should be consulted to
fully understand the rowid concept.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">lastInsertRowID</emphasis> method is similar to that of the SQLite
<ulink url="">sqlite3_last_insert_rowid</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::lastInsertRowID() -->
<section id="mthLimit"><title>limit</title>
<indexterm><primary>limit</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>limit</secondary></indexterm>
<programlisting>
<![CDATA[
>>--limit(--id--,--value--)----------------------><
]]>
</programlisting>
<para>
Queries or sets the limiting size of various constructs on this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>id [required]</term>
<listitem>
<para>
One of the run time limit<link linkend="sctRunTimeLimit">constants</link>. This identifies the limit construct that
is to be size limited.
</para>
</listitem></varlistentry>
<varlistentry><term>value [required]</term>
<listitem>
<para>
The new value of the limit. If this value is negative, then the limit is unchanged.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the exsiting limit at the time <emphasis role="italic">limit</emphasis> is invoked, even if the invocation does
not change the limit. Because of this, the way to query the current value of a limit is to invoke the method with a
negative number.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
For each limit there is a hard upper bound set when ooSQLite is built. Attempts to increase a limit above its hard upper
bound are silently truncated by the database engine to the hard upper bound. The <emphasis
role="italic">limit</emphasis> method can be used by an application that allows an untrusted source to enter data into
the database to lower the built in limits. Perhaps to prevent denial of service attacks. Programmers may also want to use
the <link linkend="mthSetAuthorizer">setAuthorizer</link> method and / or limiting database size using the <emphasis
role="italic">max_page_count</emphasis> <link linkend="mthPragma">PRAGMA</link> when the application works with
untrusted sources.
</para>
<para>
New run time limits may be introduced by SQLite in the future.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">limit</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/limit.html">sqlite3_limit</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::limit() -->
<section id="mthNextStmt"><title>nextStmt</title>
<indexterm><primary>nextStmt</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>nextStmt</secondary></indexterm>
<programlisting>
<![CDATA[
>>--nextStmt(--+--------+--)---------------------><
+--stmt--+
]]>
</programlisting>
<para>
Returns the next prepared statement <link linkend="clsOOSQLiteStmt">object</link> after the specified statement, or the
first prepared statement if <emphasis role="italic">stmt</emphasis> is omitted or the <computeroutput>.nil</computeroutput>
object.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument is:
<variablelist>
<varlistentry><term>stmt [optional]</term>
<listitem>
<para>
A <computeroutput>ooSQLiteStmt</computeroutput> object specifying the starting point of the search. If this argument
is omitted, or the <computeroutput>.nil</computeroutput> object then the search starts from the beginnging of the
prepared statement list.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the found statement, or <computeroutput>.nil</computeroutput> if no next prepared statement is found.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The search finds the first statement <emphasis role="italic">after</emphasis> the specified <emphasis
role="italic">stmt</emphasis>. It is okay to use a statement that has been <link linkend="mthFinalize">finalized</link>
as the starting point of the search. Omitting the <emphasis role="italic">stmt</emphasis> argument or using
<computeroutput>.nil</computeroutput> essentially finds the <emphasis role="italic">first</emphasis> prepared statement.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">nextStmt</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/next_stmt.html">sqlite3_next_stmt</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::nextStmt() -->
<section id="mthProfile"><title>profile</title>
<indexterm><primary>profile</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>profile</secondary></indexterm>
<programlisting>
<![CDATA[
>>--profile(--callBackObj--+------------+--+------------+--)----><
+-,-mthName--+ +-,-userData-+
]]>
</programlisting>
<para>
Registers an user callback method that can be used for profiling. The callback method is invoked is invoked as each SQL
statement finishes.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>callBackObj [required]</term>
<listitem>
<para>
An instantiated object with a method that will be invoked for profiling.
</para>
<para>
However, this argument can also be .nil to indicate that any installed profile callback is to be removed.
</para>
</listitem></varlistentry>
<varlistentry><term>mthName [optional]</term>
<listitem>
<para>
The method name that will be invoked during a call back. By default, the method invoked will be <emphasis
role="italic">profileCallBack()</emphasis>. However, the user can specify an alternative method if desired. This
argument is ignored when the <emphasis role="italic">callbackObj</emphasis> argument is .nil.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optional]</term>
<listitem>
<para>
This can be any Rexx object the user desires. The object will be sent as the third argument to the profile callback
method when it is invoked. This argument is ignored when the callbackObj argument is .nil.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">userData</emphasis> argument to a previous invocation of the <emphasis
role="italic">trace</emphasis> method on the same database connection, or .nil if there has not been a previous
invocation or the <emphasis role="italic">userData</emphasis> argument was not used on the previous invocation.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
By default, there is no profile callback installed. There can only be one profile callback per database connection.
Setting a new profile callback automatically clears any previously installed callback.
</para>
<para>
The callback method is invoked as each SQL statement finishes. The profile callback contains the original statement text
and an estimate of wall-clock time of how long that statement took to run. The example <link
linkend="mthProfileCallBack">profileCallBack</link> method has complete details.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details;</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">profile</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/profile.html">sqlite3_profile</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
<section id="mthProfileCallBack"><title>profileCallBack</title>
<indexterm><primary>profileCallBack</primary></indexterm>
<indexterm><primary>Callback Methods</primary><secondary>profileCallBack</secondary></indexterm>
<programlisting>
<![CDATA[
>>--profileCallBack(--sql--,--nanoSeconds--,--userData--)--------><
]]>
</programlisting>
<para>
The <emphasis role="italic">profileCallBack</emphasis> method is an example of a user callback method for the <link
linkend="mthProfile">profile</link> method. Here the method name of <emphasis role="italic">profileCallBack</emphasis> is
used, because it is the default method name if the programmer does not specify his own name in the <emphasis
role="italic">profile</emphasis> method. Any method name can be used by specifying it as the second argument to the
<emphasis role="italic">profile</emphasis> method.
</para>
<para>
The profile callback is invoked as each SQL statement finishes executing.
</para>
<para>
<emphasis role="bold">Note:</emphasis> there is no <emphasis role="italic">profileCallBack</emphasis> method in any
ooSQLite class. This method is just used to illustrate how to define a user callback method to be used with when profiling.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments sent to the callback method are:
</para>
<variablelist>
<varlistentry><term>sql [required]</term>
<listitem>
<para>
The original SQL statement text.
</para>
</listitem></varlistentry>
<varlistentry><term>nanoSeconds [required]</term>
<listitem>
<para>
The wall clock time it took to execute the SQL statement. See the remarks section.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [required]</term>
<listitem>
<para>
The user data object specified by the programmer as the third argument to the <emphasis
role="italic">trace</emphasis> method. If the programmer did not specify a user data argument, this will be the
<computeroutput>.nil</computeroutput> object.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The programmer must return a whole number value from the callback, the exact number does not matter.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks;</emphasis></term>
<listitem>
<para>
Although the wall clock time is in nanoseconds, the current SQLite implementation is only capable of millisecond
resolution making the six least significant digits in the time are meaningless. Future versions of SQLite might provide
greater resolution on the profiler callback. The sqlite3_profile() function is considered experimental and is subject to
change in future versions of SQLite.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The implementation of a <emphasis role="italic">profile</emphasis> callback method is is discussed on the SQLite <ulink
url="http://www.sqlite.org/c3ref/profile.html">sqlite3_profile</ulink> page.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::profileCallBack() -->
</section> <!-- End ooSQLiteConnection::profile() -->
<section id="mthProgressHandler"><title>progressHandler</title>
<indexterm><primary>progressHandler</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>progressHandler</secondary></indexterm>
<programlisting>
<![CDATA[
>>--progressHandler(--callBackObj--+-------------+-+----------+--+----------+--)---><
+-,-instrcts-+ +-,-mName--+ +-,-urData-+
]]>
</programlisting>
<para>
Registers an user callback method that is invoked periodically during long running calls to <link
linkend="mthExec">exec</link>, and <link linkend="mthStepClsStmt">step</link> for this database connection. An example use
for this interface is to keep a GUI updated during a large query.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>callBackObj [required]</term>
<listitem>
<para>
An instantiated object with a method that will be invoked during long running <emphasis
role="italic">exec</emphasis> or <emphasis role="italic">step</emphasis> methods.
</para>
<para>
However, this argument can also be .nil to indicate that any installed progress handler is to be removed.
</para>
</listitem></varlistentry>
<varlistentry><term>instrcts [required]</term>
<listitem>
<para>
The number of virtual machine instructions that are evaluated between successive invocations of the callback. If
this argument is less than 1, it also has the effect of removing any installed callback.
</para>
</listitem></varlistentry>
<varlistentry><term>mName [optional]</term>
<listitem>
<para>
The method name that will be invoked during a call back. By default, the method invoked will be <emphasis
role="italic">progressCallBack()</emphasis>. However, the user can specify an alternative method if desired.
This argument is ignored when the <emphasis role="italic">callbackObj</emphasis> argument is .nil.
</para>
</listitem></varlistentry>
<varlistentry><term>uData [optional]</term>
<listitem>
<para>
This can be any Rexx object the user desires. The object will be sent as the first and only argument to the progress
handler callback method when it is invoked. This argument is ignored when the callbackObj argument is .nil.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns a SQLite result <link linkend="sctResultCode">code</link>.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
By default, there is no progress handler installed. There can only be one progress handler per database connection.
Setting a new progress handler automatically clears any previously installed handler.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">progressHandler</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/progress_handler.html">sqlite3_progress_handler</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
<section id="mthProgressCallBack"><title>progressCallBack</title>
<indexterm><primary>progressCallBack</primary></indexterm>
<indexterm><primary>Callback Methods</primary><secondary>progressCallBack</secondary></indexterm>
<programlisting>
<![CDATA[
>>--progressCallBack(--userData--)---------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">progressCallBack</emphasis> method is an example of a user callback method for the <link
linkend="mthProgressHandler">progressHandler</link> method. Here the method name of <emphasis
role="italic">progressCallBack</emphasis> is used, because it is the default method name if the programmer does not specify
his own name in the <emphasis role="italic">progressHandler</emphasis> method. Any method name can be used by specifying it
as the second argument to the <emphasis role="italic">progressHandler</emphasis> method.
</para>
<para>
The progressHandler callback is invoked periodically after a number of virtual machine code instructions are evaluated.
This number is specified by the second argument to the <emphasis role="italic">progressHandler</emphasis> method.
</para>
<para>
<emphasis role="bold">Note:</emphasis> there is no <emphasis role="italic">progressCallBack</emphasis> method in any
ooSQLite class. This method is just used to illustrate how to define a user callback method to be used as a progress
handler.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument sent to the callback method is:
</para>
<variablelist>
<varlistentry><term>userData [required]</term>
<listitem>
<para>
The user data object specified by the programmer as the fourth argument to the <emphasis
role="italic">progressHandler</emphasis> method. If the programmer did not specify a user data argument, this will be
the <computeroutput>.nil</computeroutput> object.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The programmer must return a whole number value from the callback. If the progress handler returns non-zero, the SQLite
operation is interrupted. If 0 is returned the operation continues.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks;</emphasis></term>
<listitem>
<para>
The progress handler must not do anything that will modify the database connection that invoked the progress
handler. Note that both instantiating a new <link linkend="clsOOSQLiteStmt">ooSQLiteStmt</link> and the <link
linkend="mthStepClsStmt">step</link> method modify their database connections.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The implementation of a <emphasis role="italic">progressHandler</emphasis> callback method is is discussed on the SQLite <ulink
url="http://www.sqlite.org/c3ref/progress_handler.html">sqlite3_progress_handler</ulink> page.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::progressCallBack() -->
</section> <!-- End ooSQLiteConnection::progressHandler() -->
<section id="mthPragma"><title>pragma</title>
<indexterm><primary>pragma</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>pragma</secondary></indexterm>
<programlisting>
<![CDATA[
>>--pragma(--name--+----------+--)---------------><
+-,-value--+
]]>
</programlisting>
<para>
Executes a PRAGMA statement. A <emphasis role="italic">PRAGMA</emphasis> statement is a SQLite specific SQL extension,
probably unknown to any other database engine. The <emphasis role="italic">pragma</emphasis> method implements the
functionality of the SQLite <ulink url="http://www.sqlite.org/pragma.html">PRAGMA</ulink> statement. The SQLite
documentation should be read to understand how PRAGMAs work
</para>
<para>
Pragmas can have an optional database name before the pragma name. The form is: the database name, a dot characeter, and
the pragma name. The database name is the name of an <emphasis role="italic">attached</emphasis> database or it can be <emphasis
role="italic">main</emphasis> or <emphasis role="italic">temp</emphasis> for the main and the TEMP databases. If the
optional database name is omitted, <emphasis role="italic">main</emphasis> is assumed. In some pragmas, the database name
is meaningless and is simply ignored. An example for the <emphasis role="italic">secure_delete</emphasis> pragma could be:
<computeroutput>main.secure_delete</computeroutput>
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>name [required]</term>
<listitem>
<para>
The name of the pragma to be executed. The following pragmas are recognized, case is not significant:
</para>
<para>
<simplelist type='vert' columns='3'>
<member>auto_vacuum </member>
<member>automatic_index </member>
<member>cache_size </member>
<member>case_sensitive_like </member>
<member>checkpoint_fullfsync </member>
<member>collation_list </member>
<member>compile_options </member>
<member>database_list </member>
<member>encoding </member>
<member>foreign_key_list </member>
<member>foreign_keys </member>
<member>freelist_count </member>
<member>fullfsync </member>
<member>ignore_check_constraints </member>
<member>incremental_vacuum </member>
<member>index_info </member>
<member>index_list </member>
<member>integrity_check </member>
<member>journal_mode </member>
<member>journal_size_limit </member>
<member>legacy_file_format </member>
<member>locking_mode </member>
<member>max_page_count </member>
<member>page_count </member>
<member>page_size </member>
<member>quick_check </member>
<member>read_uncommitted </member>
<member>recursive_triggers </member>
<member>reverse_unordered_selects</member>
<member>schema_version </member>
<member>secure_delete </member>
<member>shrink_memory </member>
<member>synchronous </member>
<member>table_info </member>
<member>temp_store </member>
<member>user_version </member>
<member>wal_autocheckpoint </member>
<member>wal_checkpoint </member>
<member>writable_schema </member>
</simplelist>
<variablelist>
<varlistentry><term>auto_vacum</term>
<listitem>
<para>
Queries or sets the auto-vacuum status in the database. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_auto_vacuum">auto_vacum</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>automatic_index</term>
<listitem>
<para>
Queries, sets, or clears the automatic indexing capability. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_automatic_index">automatic_index</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>cache_size</term>
<listitem>
<para>
Queries or changes the suggested maximum number of database disk pages that SQLite will hold in memory at once
per open database file. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_cache_size">cache_size</ulink> documentation for complete details.
</para> </listitem></varlistentry>
<varlistentry><term>case_sensitive_like</term>
<listitem>
<para>
Installs a new application-defined LIKE function that is either case sensitive or insensitive depending on the
value of the case_sensitive_like pragma. By default LIKE is case-insensitive. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_case_sensitive_like">case_sensitive_like</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>checkpoint_fullfsync</term>
<listitem>
<para>
Query or change the fullfsync flag for checkpoint operations. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_checkpoint_fullfsync">checkpoint_fullfsync</ulink> documentation
for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>collation_list</term>
<listitem>
<para>
Returns a list of the collating sequences defined for the current database connection. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_collation_list">collation_list</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>compile_options</term>
<listitem>
<para>
Returns the names of compile-time options used when building SQLite, one option per row. The <emphasis
role="italic">SQLITE_</emphasis> prefix is omitted from the returned option names. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_compile_options">compile_options</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>database_list</term>
<listitem>
<para>
Works like a query to return one row for each database attached to the current database connection. Consult the
SQLite <ulink url="http://www.sqlite.org/pragma.html#pragma_database_list">database_list</ulink> documentation
for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>encoding</term>
<listitem>
<para>
When used as a query, if the main database has already been created, then this pragma returns the text encoding
used by the main database, one of "UTF-8", "UTF-16le" (little-endian UTF-16 encoding) or "UTF-16be" (big-endian
UTF-16 encoding). If the main database has not already been created, then the value returned is the text encoding
that will be used to create the main database, if it is created by this session. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_encoding">encoding</ulink> documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>foreign_key_list</term>
<listitem>
<para>
Returns one row for each foreign key that references a column in the argument <emphasis role="italic">table</emphasis>. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_foreign_key_list">foreign_key_list</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>foreign_keys</term>
<listitem>
<para>
Query, set, or clear the enforcement of foreign key constraints. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_foreign_keys">foreign_keys</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>freelist_count</term>
<listitem>
<para>
Returns the number of unused pages in the database file. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_freelist_count">freelist_count</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>fullfsync</term>
<listitem>
<para>
Query or change the fullfsync flag. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_fullfsync">fullfsync</ulink> documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>ignore_check_constraints</term>
<listitem>
<para>
Enables or disables the enforcement of CHECK constraints. The default setting is off, meaning that CHECK
constraints are enforced by default. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_ignore_check_constraints">ignore_check_constraints</ulink>
documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>incremental_vacuum</term>
<listitem>
<para>
Causes up to N pages to be removed from the freelist. The database file is truncated by the same amount. Consult
the SQLite <ulink url="http://www.sqlite.org/pragma.html#pragma_incremental_vacuum">incremental_vacuum</ulink>
documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>index_info</term>
<listitem>
<para>
Returns one row each column in the named index. The first column of the result is the rank of the column within
the index. The second column of the result is the rank of the column within the table. The third column of output
is the name of the column being indexed. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_index_info">index_info</ulink> documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>index_list</term>
<listitem>
<para>
Returns one row for each index associated with the given table. Columns of the result set include the index name
and a flag to indicate whether or not the index is UNIQUE. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_index_list">index_list</ulink> documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>integrity_check</term>
<listitem>
<para>
Does an integrity check of the entire database. It looks for out-of-order records, missing pages, malformed
records, and corrupt indices. If any problems are found, then strings are returned (as multiple rows with a
single column per row) which describe the problems. At most integer errors will be reported before the analysis
quits. The default value for integer is 100. If no errors are found, a single row with the value <emphasis
role="italic">ok</emphasis> is returned. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_integrity_check">integrity_check</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>journal_mode</term>
<listitem>
<para>
Queries or sets the journal mode for databases associated with the current database connection. Consult the
SQLite <ulink url="http://www.sqlite.org/pragma.html#pragma_journal_mode">journal_mode</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>journal_size_limit</term>
<listitem>
<para>
This pragma can be used to limit the size of rollback-journal and WAL files left in the file-system after
transactions or checkpoints. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_journal_size_limit">journal_size_limit</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>legacy_file_format</term>
<listitem>
<para>
Sets or queries the value of the legacy_file_format flag. When this flag is on, new SQLite databases are created
in a file format that is readable and writable by all versions of SQLite going back to 3.0.0. When the flag is
off, new databases are created using the latest file format which might not be readable or writable by versions
of SQLite prior to 3.3.0. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_legacy_file_format">legacy_file_format</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>locking_mode</term>
<listitem>
<para>
Sets or queries the database connection locking-mode. The locking-mode is either NORMAL or EXCLUSIVE. Consult the
SQLite <ulink url="http://www.sqlite.org/pragma.html#pragma_locking_mode">locking_mode</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>max_page_count</term>
<listitem>
<para>
Queries or set the maximum number of pages in the database file. Both forms of the pragma return the maximum page
count. The set form attempts to modify the maximum page count. The maximum page count cannot be reduced below
the current database size. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_max_page_count">max_page_count</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>page_count</term>
<listitem>
<para>
Returns the total number of pages in the database file. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_page_count">page_count</ulink> documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>page_size</term>
<listitem>
<para>
Queries or sets the page size of the database. The page size must be a power of two between 512 and 65536
inclusive. Consult the SQLite <ulink url="http://www.sqlite.org/pragma.html#pragma_page_size">page_size</ulink>
documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>quick_check</term>
<listitem>
<para>
Performs an integrity check, like the integrity_check pragma, except that it does not verify that index content
matches table content. By skipping the verification of index content, quick_check is able to run much faster than
integrity_check. Otherwise the two pragmas are the same. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_quick_check">quick_check</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>read_uncommitted</term>
<listitem>
<para>
Query, set, or clear READ UNCOMMITTED isolation. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_read_uncommitted">read_uncommitted</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>recursive_triggers</term>
<listitem>
<para>
Query, set, or clear the recursive trigger capability. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_recursive_triggers">recursive_triggers</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>reverse_unordered_selects</term>
<listitem>
<para>
When enabled, this pragma causes SELECT statements without an ORDER BY clause to emit their results in the
reverse order of what they normally would. This can help debug applications that are making invalid assumptions
about the result order. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_reverse_unordered_selects">reverse_unordered_selects</ulink>
documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>schema_version</term>
<listitem>
<para>
Used to set or get the value of the schema-version. The pragmas schema_version and user_version are used to set
or get the value of the schema-version and user-version, respectively. The schema-version and the user-version
are big-endian 32-bit signed integers stored in the database header.
</para>
<para>
The schema-version is usually only manipulated internally by SQLite. Using the schema_version pragma to modify
the schema-version is potentially dangerous and may lead to program crashes or database corruption. Use with
caution.
</para>
<para>
The user-version is not used internally by SQLite. It may be used by applications for any purpose. Consult the
SQLite <ulink url="http://www.sqlite.org/pragma.html#pragma_schema_version">schema_version</ulink> documentation
for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>secure_delete</term>
<listitem>
<para>
Queries or changes the secure-delete setting. When secure-delete on, SQLite overwrites deleted content with
zeros. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_secure_delete">secure_delete</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>shrink_memory</term>
<listitem>
<para>
Causes the database connection on which it is invoked to free up as much memory as it can. Consult the SQLite
<ulink url="http://www.sqlite.org/pragma.html#pragma_shrink_memory">shrink_memory</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>synchronous</term>
<listitem>
<para>
Queries or changes the setting of the "synchronous" flag. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_synchronous">synchronous</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>table_info</term>
<listitem>
<para>
Returns a row for each column in the named table. Columns in the result set include the column name, data type,
whether or not the column can be NULL, and the default value for the column. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_table_info">table_info</ulink> documentation for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>temp_store</term>
<listitem>
<para>
Queries or changes the setting of the <emphasis role="italic">temp_store</emphasis> parameter. Consult the SQLite
<ulink url="http://www.sqlite.org/pragma.html#pragma_temp_store">temp_store</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>user_version</term>
<listitem>
<para>
Used to set or get the value of the user-version. The pragmas schema_version and user_version are used to set or
get the value of the schema-version and user-version, respectively. The schema-version and the user-version are
big-endian 32-bit signed integers stored in the database header.
</para>
<para>
The schema-version is usually only manipulated internally by SQLite. Using the schema_version pragma to modify
the schema-version is potentially dangerous and may lead to program crashes or database corruption. Use with
caution.
</para>
<para>
The user-version is not used internally by SQLite. It may be used by applications for any purpose. Consult the
SQLite <ulink url="http://www.sqlite.org/pragma.html#pragma_schema_version">schema_version</ulink> documentation
for complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>wal_autocheckpoint</term>
<listitem>
<para>
Queries or sets the write-ahead log auto-checkpoint interval. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_wal_autocheckpoint">wal_autocheckpoint</ulink> documentation for
complete details.
</para>
</listitem></varlistentry>
<varlistentry><term>wal_checkpoint</term>
<listitem>
<para>
If the write-ahead log is enabled (via the journal_mode pragma), this pragma causes a checkpoint operation to run
on the named <emphasis role="italic">database</emphasis> database, or on all attached databases if <emphasis
role="italic">database</emphasis> is omitted. If write-ahead log mode is disabled, this pragma is a harmless
no-op. Consult the SQLite <ulink
url="http://www.sqlite.org/pragma.html#pragma_wal_checkpoint">wal_checkpoint</ulink> documentation for complete
details.
</para>
</listitem></varlistentry>
<varlistentry><term>writable_schema</term>
<listitem>
<para>
When this pragma is on, the SQLITE_MASTER tables in the database can be changed using ordinary UPDATE, INSERT,
and DELETE statements. Warning: misuse of this pragma can easily result in a corrupt database file. Consult the
SQLite <ulink url="http://www.sqlite.org/pragma.html#pragma_writable_schema">writable_schema</ulink>
documentation for complete details.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term>value [optional]</term>
<listitem>
<para>
When the pragma is to be used to set a value, the <emphasis role="italic">value</emphasis> argument is the value to
set. For these pragmas, the existence of the argument determines if a query or a set is done. When the argument is
omitted, a query is done. When the argument is used, a set is done.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The return is dependent on the pragma in use. Some pragmas return result sets, some return a single value, and others
return a SQLite result <link linkend="sctResultCode">code</link>. In all cases a value is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
PRAGMA statement can be used to set / configure database values, to trigger an action, and to query most of the
configurable database values. SQLite deprecated and <emphasis role="italic">debug only</emphasis> PRAGMAs are not
recognized in ooSQLite.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example uses the table_info pragma to get information on the food_types table and then print it to the screen:
<programlisting>
<![CDATA[
dbName = 'ooFoods.rdbx'
tablename = 'food_types'
dbConn = .ooSQLiteConnection~new(dbName, .ooSQLite~OPEN_READWRITE)
resultSet = dbConn~pragma('table_info', tablename)
z = printResultSet(resultSet)
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::pragma() -->
<section id="mthRollbackHook"><title>rollbackHook</title>
<indexterm><primary>rollbackHook</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>rollbackHook</secondary></indexterm>
<programlisting>
<![CDATA[
>>--rollbackHook(--callBackObj--+------------+--+------------+--)----------------><
+-,-mthName--+ +-,-userData-+
]]>
</programlisting>
<para>
Registers a callback method to be invoked whenever a transaction is rolled back.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>callBackObj [required]</term>
<listitem>
<para>
An instantiated object with a method that will be invoked whenever a transaction is rolled back.
</para>
<para>
However, this argument can also be .nil to indicate that any installed rollback hook is to be removed.
</para>
</listitem></varlistentry>
<varlistentry><term>mthName [optional]</term>
<listitem>
<para>
The method name that will be invoked during a call back. By default, the method invoked will be <emphasis
role="italic">rollbackHookCallBack()</emphasis>. However, the user can specify an alternative method if desired. This
argument is ignored when the <emphasis role="italic">callbackObj</emphasis> argument is .nil.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optional]</term>
<listitem>
<para>
This can be any Rexx object the user desires. The object will be sent as the first and only argument to the rollback
hook callback method when it is invoked. This argument is ignored when the callbackObj argument is .nil.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">userData</emphasis> argument to a previous invocation of the <emphasis
role="italic">rollbackHook</emphasis> method on this database connection, or .nil if there has not been a previous
invocation or the <emphasis role="italic">userData</emphasis> argument was not used on the previous invocation.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">rollbackHook</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/commit_hook.html">sqlite3_rollback_hook</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
<section id="mthRollbackHookCallBack"><title>rollbackHookCallBack</title>
<indexterm><primary>rollbackHookCallBack</primary></indexterm>
<indexterm><primary>Callback Methods</primary><secondary>rollbackHookCallBack</secondary></indexterm>
<programlisting>
<![CDATA[
>>--rollbackHookCallBack(--userData--)------------><
]]>
</programlisting>
<para>
The <emphasis role="italic">rollbackHookCallBack</emphasis> method is an example of a user callback method for the <link
linkend="mthRollbackHook">rollbackHook</link> method. Here the method name of <emphasis
role="italic">rollbackHookCallBack</emphasis> is used, because it is the default method name if the programmer does not
specify his own name in the <emphasis role="italic">rollbackHook</emphasis> method. Any method name can be used by
specifying it as the second argument to the <emphasis role="italic">rollbackHook</emphasis> method.
</para>
<para>
<emphasis role="bold">Note:</emphasis> there is no <emphasis role="italic">rollbackHookCallBack</emphasis> method in any
ooSQLite class. This method is just used to illustrate how to define a user callback method to be used with the rollback
hook.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The single argument sent to the callback method is:
</para>
<variablelist>
<varlistentry><term>userData [required]</term>
<listitem>
<para>
The user data object specified by the programmer as the third argument to the <emphasis
role="italic">rollbackHook</emphasis> method. If the programmer did not specify a user data argument, this will be the
<computeroutput>.nil</computeroutput> object.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The programmer must return a whole number value from the callback. However, the actual value returned makes no difference
to the SQLite database engine. Typically, the programmer would just return 0.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The callback method must not do anything that will modify the database connection that invoked the callback. Any actions
to modify the database connection must be deferred until after the completion of the <link
linkend="mthStepClsStmt">step</link> invocation that triggered the rollback hook to begin with. Running any other SQL
statements, including SELECT statements, or merely instantiating a new <link linkend="mthNewClsStmt">statement</link>
object, or executing another <emphasis role="italic">step</emphasis> method will modify the database connection.
</para>
<para>
For the purposes of this method, a transaction is said to have been rolled back if an explicit ROLLBACK statement is
executed, or an error or constraint causes an implicit rollback to occur. However, the callback is not invoked if a
transaction is automatically rolled back because the database connection is closed.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The implementation of a <emphasis role="italic">rollback hook</emphasis> method is is discussed on the SQLite <ulink
url="http://www.sqlite.org/c3ref/commit_hook.html">sqlite3_rollback_hook</ulink> page.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::rollbackHookCallBack() -->
</section> <!-- End ooSQLiteConnection::rollbackHook() -->
<section id="mthSetAuthorizer"><title>setAuthorizer</title>
<indexterm><primary>setAuthorizer</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>setAuthorizer</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setAuthorizer(--callBackObj--+------------+--+------------+--)-------------><
+-,-mthName--+ +-,-userData-+
]]>
</programlisting>
<para>
Registers an authorizer callback method that is invoked as SQL statements are being compiled by instantiating an <link
linkend="clsOOSQLiteStmt">ooSQLiteStmt</link> object. The callback allows the Rexx program to disallow certain actions of
the SQL, or reject the SQL statemen entirely.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>callBackObj [required]</term>
<listitem>
<para>
An instantiated object with a method that will be invoked during the compilation of a SQL statement
</para>
<para>
However, this argument can also be .nil to indicate that any installed update hook is to be removed.
</para>
</listitem></varlistentry>
<varlistentry><term>mthName [optional]</term>
<listitem>
<para>
The method name that will be invoked during a call back. By default, the method invoked will be <emphasis
role="italic">authorizerCallBack()</emphasis>. However, the user can specify an alternative method if desired. This
argument is ignored when the <emphasis role="italic">callbackObj</emphasis> argument is .nil.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optional]</term>
<listitem>
<para>
This can be any Rexx object the user desires. The object will be sent as the last argument to the authorizer callback
method when it is invoked. This argument is ignored when the callbackObj argument is .nil.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns a SQLite result <link linkend="sctResultCode">code</link>. Currently, it appears that the SQLite database engine
always returns OK.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
At various points during the compilation process of a statement, as logic is being created to perform various actions,
the authorizer callback is invoked to see if those actions are allowed. The authorizer callback should return OK to
allow the action, IGNORE to disallow the specific action but allow the SQL statement to continue to be compiled, or DENY
to cause the entire SQL statement to be rejected with an error. If the authorizer callback returns any value other than
IGNORE, OK, or DENY then the instantiation of the <computeroutput>ooSQLiteStmt</computeroutput> object that triggered the
authorizer will fail with an error <link linkend="atrLastErrMsgClsStmt">message</link> .
</para>
<para>
An authorizer is used when preparing SQL statements from an untrusted source, to ensure that the SQL statements do not
try to access data they are not allowed to see, or that they do not try to execute malicious statements that damage the
database. For example, an application may allow a user to enter arbitrary SQL queries for evaluation by a database. But
the application does not want the user to be able to make arbitrary changes to the database. An authorizer could then be
put in place while the user-entered SQL is being prepared that disallows everything except SELECT statements.
</para>
<para>
Programs that need to process SQL from untrusted sources might also consider lowering resource limits using the <link
linkend="mthLimit">limit</link> method and / or limiting database size using the <emphasis
role="italic">max_page_count</emphasis> <link linkend="mthPragma">PRAGMA</link> in addition to using an authorizer.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">setAuthorizer</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/set_authorizer.html">sqlite3_set_authorizer</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
<section id="mthAuthorizerCallBack"><title>authorizerCallBack</title>
<indexterm><primary>authorizerCallBack</primary></indexterm>
<indexterm><primary>Callback Methods</primary><secondary>authorizerCallBack</secondary></indexterm>
<programlisting>
<![CDATA[
>>--authorizerCallBack(--code--,--str1--,--str2--,--str3--,--str4--,--userData--)-><
]]>
</programlisting>
<para>
The <emphasis role="italic">authorizerCallBack</emphasis> method is an example of a user callback method for the <link
linkend="mthSetAuthorizer">setAuthorizer</link> method. Here the method name of <emphasis
role="italic">authorizerCallBack</emphasis> is used, because it is the default method name if the programmer does not
specify his own name in the <emphasis role="italic">setAuthorizer</emphasis> method. Any method name can be used by
specifying it as the second argument to the <emphasis role="italic">setAuthorizer</emphasis> method.
</para>
<para>
<emphasis role="bold">Note:</emphasis> there is no <emphasis role="italic">authorizerCallBack</emphasis> method in any
ooSQLite class. This method is just used to illustrate how to define a user callback method to be used with the set
authorizer hook.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments sent to the callback method are:
</para>
<variablelist>
<varlistentry><term>code [required]</term>
<listitem>
<para>
One of the authorizer <link linkend="sctAuthorizerAction">constants</link> that specifies the particular action to be
authorized.
</para>
</listitem></varlistentry>
<varlistentry><term>str1 [required]</term>
<listitem>
<para>
String 1 that contains additional details about the action to be authorized. The string varies depending on the
action that triggered the callback. See the table in the Remarks section for possible values.
</para>
</listitem></varlistentry>
<varlistentry><term>str2 [required]</term>
<listitem>
<para>
String 2 that contains additional details about the action to be authorized. The string varies depending on the
action that triggered the callback. See the table in the Remarks section for possible values.
</para>
</listitem></varlistentry>
<varlistentry><term>str3 [required]</term>
<listitem>
<para>
The <link linkend="defDatabaseName">name</link> of the database (<emphasis role="italic">main</emphasis>, <emphasis
role="italic">temp</emphasis>, etc.,) if applicable. If not applicable, the empty string.
</para>
</listitem></varlistentry>
<varlistentry><term>str4 [required]</term>
<listitem>
<para>
The name of the inner-most trigger or view that is responsible for the access attempt or the empty string if this
access attempt is directly from top-level SQL code.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [required]</term>
<listitem>
<para>
The user data object specified by the programmer as the third argument to the <emphasis
role="italic">setAuthorizer</emphasis> method. If the programmer did not specify a user data argument, this will be the
<computeroutput>.nil</computeroutput> object.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The programmer must return 1 of the 3 authorizer return code <link linkend="sctAuthorizerReturnCode">constants</link>.
Any other reuturn will cause the instantiation of the <link linkend="clsOOSQLiteStmt">ooSQLiteStmt</link> object to fail
with an error.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
At various points during the compilation process of a statement, as logic is being created to perform various actions,
the authorizer callback is invoked to see if those actions are allowed. In ooSQLite, the compilation process of a
statement takes place during the initialization of an <link linkend="mthNewClsStmt">ooSQLiteStmt</link> object.
</para>
<para>
The authorizer callback should return OK to allow the action, IGNORE to disallow the specific action but allow the SQL
statement to continue to be compiled, or DENY to cause the entire SQL statement to be rejected with an error. If the
authorizer callback returns any value other than IGNORE, OK, or DENY then the instantiation of the
<computeroutput>ooSQLiteStmt</computeroutput> object that triggered the authorizer will fail with an error <link
linkend="atrLastErrMsgClsStmt">message</link> .
</para>
<para>
If the action code is READ and the callback returns IGNORE then the prepared statement statement is constructed to
substitute a NULL value in place of the table column that would have been read if OK had been returned. The IGNORE
return can be used to deny an untrusted user access to individual columns of a table. If the action code is DELETE and
the callback returns IGNORE then the DELETE operation proceeds but the truncate optimization is disabled and all rows
are deleted individually.
</para>
<para>
The callback method must not do anything that will modify the database connection that invoked the callback. Any actions
to modify the database connection must be deferred until after the completion of the <link
linkend="mthStepClsStmt">step</link> invocation that triggered the update hook to begin with. Running any other SQL
statements, including SELECT statements, or merely instantiating a new <link linkend="mthNewClsStmt">statement</link>
object, or executing another <emphasis role="italic">step</emphasis> method will modify the database connection.
</para>
<para>
The following table lists the values for <emphasis role="italic">str1</emphasis> and <emphasis
role="italic">str2</emphasis> for each of the possible action codes, the value of the <emphasis
role="italic">code</emphasis> argument
</para>
<table id="tblAuthorizerCallbackArgs" frame="all">
<title>The Authorizer Callback Arguments</title>
<tgroup cols="3">
<colspec colwidth="6*" />
<colspec colwidth="3*" />
<colspec colwidth="6*" />
<thead>
<row>
<entry>Code</entry>
<entry>Str1</entry>
<entry>Str2</entry>
</row>
</thead>
<tbody>
<row>
<entry>CREATE_INDEX</entry> <entry>Index Name </entry><entry>Table Name </entry>
</row>
<row>
<entry>CREATE_TABLE</entry> <entry>Table Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>CREATE_TEMP_INDEX</entry> <entry>Index Name </entry><entry>Table Name </entry>
</row>
<row>
<entry>CREATE_TEMP_TABLE</entry> <entry>Table Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>CREATE_TEMP_TRIGGER</entry><entry>Trigger Name </entry><entry>Table Name </entry>
</row>
<row>
<entry>CREATE_TEMP_VIEW</entry> <entry>View Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>CREATE_TRIGGER</entry> <entry>Trigger Name </entry><entry>Table Name </entry>
</row>
<row>
<entry>CREATE_VIEW</entry> <entry>View Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>DELETE</entry> <entry>Table Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>DROP_INDEX</entry> <entry>Index Name </entry><entry>Table Name </entry>
</row>
<row>
<entry>DROP_TABLE</entry> <entry>Table Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>DROP_TEMP_INDEX</entry> <entry>Index Name </entry><entry>Table Name </entry>
</row>
<row>
<entry>DROP_TEMP_TABLE</entry> <entry>Table Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>DROP_TEMP_TRIGGER</entry> <entry>Trigger Name </entry><entry>Table Name </entry>
</row>
<row>
<entry>DROP_TEMP_VIEW</entry> <entry>View Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>DROP_TRIGGER</entry> <entry>Trigger Name </entry><entry>Table Name </entry>
</row>
<row>
<entry>DROP_VIEW</entry> <entry>View Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>INSERT</entry> <entry>Table Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>PRAGMA</entry> <entry>Pragma Name </entry><entry>userData arg or Empty String</entry>
</row>
<row>
<entry>READ</entry> <entry>Table Name </entry><entry>Column Name </entry>
</row>
<row>
<entry>SELECT</entry> <entry>Empty String </entry><entry>Empty String </entry>
</row>
<row>
<entry>TRANSACTION</entry> <entry>Operation </entry><entry>Empty String </entry>
</row>
<row>
<entry>UPDATE</entry> <entry>Table Name </entry><entry>Column Name </entry>
</row>
<row>
<entry>ATTACH</entry> <entry>Filename </entry><entry>Empty String </entry>
</row>
<row>
<entry>DETACH</entry> <entry>Database Name</entry><entry>Empty String </entry>
</row>
<row>
<entry>ALTER_TABLE</entry> <entry>Database Name</entry><entry>Table Name </entry>
</row>
<row>
<entry>REINDEX</entry> <entry>Index Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>ANALYZE</entry> <entry>Table Name </entry><entry>Empty String </entry>
</row>
<row>
<entry>CREATE_VTABLE</entry> <entry>Table Name </entry><entry>Module Name </entry>
</row>
<row>
<entry>DROP_VTABLE</entry> <entry>Table Name </entry><entry>Module Name </entry>
</row>
<row>
<entry>FUNCTION</entry> <entry>Empty String </entry><entry>Function Name </entry>
</row>
<row>
<entry>SAVEPOINT</entry> <entry>Operation </entry><entry>Savepoint Name </entry>
</row>
</tbody></tgroup>
</table>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The implementation of an <emphasis role="italic">authorizer</emphasis> callback method is is discussed on the SQLite
<ulink url="http://www.sqlite.org/c3ref/set_authorizer.html">sqlite3_set_authorizer</ulink> page.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::setAuthorizerCallBack() -->
</section> <!-- End ooSQLiteConnection::setAuthorizer() -->
<section id="mthTableColumnMetadata"><title>tableColumnMetadata</title>
<indexterm><primary>tableColumnMetadata</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>tableColumnMetadata</secondary></indexterm>
<programlisting>
<![CDATA[
>>--tableColumnMetadata(--tableName--,--colName--,--results--+-----------+--)--><
+-,-dbName--+
]]>
</programlisting>
<para>
Retrieves metadata about a specific column of a specific table of this database connection.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
<variablelist>
<varlistentry><term>tableName [required]</term>
<listitem>
<para>
The name of the table containing the column whose metadata is being sought.
</para>
</listitem></varlistentry>
<varlistentry><term>[required]</term>
<listitem>
<para>
The name of the column whose metadata is being sought.
</para>
</listitem></varlistentry>
<varlistentry><term>results [required]</term>
<listitem>
<para>
A <computeroutput>Directory</computeroutput> object whose indexes will hold the metadata on return. On
success the following indexes in the object will be valid:
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">DATATYPE</emphasis></term>
<listitem>
<para>
The data type of the column.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">COLLATIONSEQUNCE</emphasis></term>
<listitem>
<para>
The name of the default collation sequence for the column.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">NOTNULL</emphasis></term>
<listitem>
<para>
True if the column has a NOT NULL constraint, otherwise false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">PRIMARYKEY</emphasis></term>
<listitem>
<para>
True if the column is part of the PRIMARY KEY, otherwise false.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">AUTOINCREMENT</emphasis></term>
<listitem>
<para>
True if the column is AUTOINCREMENT, otherwise false.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term>dbName[optional]</term>
<listitem>
<para>
The <link linkend="defDatabaseName">name</link> of the database (<emphasis role="italic">main</emphasis>, <emphasis
role="italic">temp</emphasis>, etc..) If this argument is omitted, then all attached databases are searched for the
table by the database engine, using the same algorithm as is used by SQLite to resolve unqualified table references.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns a SQLite result <link linkend="sctResultCode">code</link>, OK on success, otherwise an error code.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
If this methods fails, the <emphasis role="italic">results</emphasis> object is unchanged.
</para>
<para>
If the specified table is actually a view, an error code is returned. If the specified column is <emphasis
role="italic">rowid</emphasis>, <emphasis role="italic">oid</emphasis>, or <emphasis
role="italic">_rowid_</emphasis> and an INTEGER PRIMARY KEY column has been explicitly declared, then the output
parameters are set for the explicitly declared column. If there is no explicitly declared INTEGER PRIMARY KEY column,
then the output parameters are set as follows:
</para>
<itemizedlist>
<listitem><para><emphasis role="bold">Data type:</emphasis> &quot;INTEGER&quot;</para></listitem>
<listitem><para><emphasis role="bold">Collation sequence:</emphasis> &quot;BINARY&quot;</para></listitem>
<listitem><para><emphasis role="bold">Not null:</emphasis> false</para></listitem>
<listitem><para><emphasis role="bold">Primary key:</emphasis> true</para></listitem>
<listitem><para><emphasis role="bold">Auto increment</emphasis> false</para></listitem>
</itemizedlist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">tableColumnMetadata</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/table_column_metadata.html">sqlite3_table_column_metadata</ulink> API. Note that
the arguments to <emphasis role="italic">tableColumnMetadata</emphasis> are in a slightly different order than in the
SQLite API. This is to place the optional database name at the end of the argument list.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::tableColumnMetadata() -->
<section id="mthTotalChanges"><title>totalChanges</title>
<indexterm><primary>totalChanges</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>totalChanges</secondary></indexterm>
<programlisting>
<![CDATA[
>>--totalChanges---------------------------------><
]]>
</programlisting>
<para>
Determines the number of row changes caused by INSERT, UPDATE or DELETE statements since the database connection was
opened.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
There are no arguments to this method.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
Returns the number of row changes caused by INSERT, UPDATE or DELETE statements since the database connection was opened.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The count returned by <emphasis role="italic">totalChanges</emphasis> includes all changes from all trigger contexts and
changes made by foreign key actions. But, the count does not include changes used to implement REPLACE constraints,
do rollbacks or ABORT processing, or DROP TABLE processing. The count does not include rows of views that fire an INSTEAD
OF trigger, though if the INSTEAD OF trigger makes changes of its own, those changes are counted.
</para>
<para>
The <link linkend="mthChanges">changes</link> method can be used to get the number of changes caused by the most recent
completion of a single SQL statement.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details;</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">totalChanges</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/total_changes.html">sqlite3_total_changes</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::totalChanges() -->
<section id="mthTrace"><title>trace</title>
<indexterm><primary>trace</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>trace</secondary></indexterm>
<programlisting>
<![CDATA[
>>--trace(--callBackObj--+------------+--+------------+--)------><
+-,-mthName--+ +-,-userData-+
]]>
</programlisting>
<para>
Registers an user callback method that can be used for tracing. The callback method is invoked at various times when an SQL
statement is being run by <link linkend="mthStepClsStmt">step</link>.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>callBackObj [required]</term>
<listitem>
<para>
An instantiated object with a method that will be invoked for tracing.
</para>
<para>
However, this argument can also be .nil to indicate that any installed trace hook is to be removed.
</para>
</listitem></varlistentry>
<varlistentry><term>mthName [optional]</term>
<listitem>
<para>
The method name that will be invoked during a call back. By default, the method invoked will be <emphasis
role="italic">traceCallBack()</emphasis>. However, the user can specify an alternative method if desired. This
argument is ignored when the <emphasis role="italic">callbackObj</emphasis> argument is .nil.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optional]</term>
<listitem>
<para>
This can be any Rexx object the user desires. The object will be sent as the second argument to the trace callback
method when it is invoked. This argument is ignored when the callbackObj argument is .nil.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">userData</emphasis> argument to a previous invocation of the <emphasis
role="italic">trace</emphasis> method on the same database connection, or .nil if there has not been a previous
invocation or the <emphasis role="italic">userData</emphasis> argument was not used on the previous invocation.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
By default, there is no trace callback installed. There can only be one trace callback per database connection.
Setting a new trace callback automatically clears any previously installed callback.
</para>
<para>
The callback method is invoked at various times when an SQL statement is being executed by either <link
linkend="mthStepClsStmt">step</link> or <link linkend="mthExec">exec</link>. The trace callback is invoked with the SQL
statement text as the statement first begins executing. Additional trace callbacks might occur as each triggered
subprogram is entered. The callbacks for triggers contain a SQL comment that identifies the trigger.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">trace</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/profile.html">sqlite3_trace</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
<section id="mthTraceCallBack"><title>traceCallBack</title>
<indexterm><primary>traceCallBack</primary></indexterm>
<indexterm><primary>Callback Methods</primary><secondary>traceCallBack</secondary></indexterm>
<programlisting>
<![CDATA[
>>--commitHookCallBack(--sql--,--userData--)-----><
]]>
</programlisting>
<para>
The <emphasis role="italic">traceCallBack</emphasis> method is an example of a user callback method for the <link
linkend="mthTrace">trace</link> method. Here the method name of <emphasis role="italic">traceCallBack</emphasis> is used,
because it is the default method name if the programmer does not specify his own name in the <emphasis
role="italic">trace</emphasis> method. Any method name can be used by specifying it as the second argument to the
<emphasis role="italic">trace</emphasis> method.
</para>
<para>
<emphasis role="bold">Note:</emphasis> there is no <emphasis role="italic">traceCallBack</emphasis> method in any ooSQLite
class. This method is just used to illustrate how to define a user callback method to be used with when tracing
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments sent to the callback method are:
</para>
<variablelist>
<varlistentry><term>sql [required]</term>
<listitem>
<para>
When the statement first begins executing, <emphasis role="italic">sql</emphasis> will be the SQL statement text.
Additional trace callbacks could occur if a triggered subprogram is entered. In these cases, <emphasis
role="italic">sql</emphasis> will be a comment that identifies the trigger.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [required]</term>
<listitem>
<para>
The user data object specified by the programmer as the third argument to the <emphasis
role="italic">trace</emphasis> method. If the programmer did not specify a user data argument, this will be the
<computeroutput>.nil</computeroutput> object.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The programmer must return a whole number value from the callback, the exact number does not matter.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The implementation of a <emphasis role="italic">trace</emphasis> callback method is is discussed on the SQLite <ulink
url="http://www.sqlite.org/c3ref/profile.html">sqlite3_trace</ulink> page.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::traceCallBack() -->
</section> <!-- End ooSQLiteConnection::trace() -->
<section id="mthUpdateHook"><title>updateHook</title>
<indexterm><primary>updateHook</primary></indexterm>
<indexterm><primary>ooSQLiteConnection class</primary><secondary>updateHook</secondary></indexterm>
<programlisting>
<![CDATA[
>>--updateHook(--callBackObj--+------------+--+------------+--)----------------><
+-,-mthName--+ +-,-userData-+
]]>
</programlisting>
<para>
Registers a callback method to be invoked whenever a row is updated, inserted, or deleted.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments are:
</para>
<variablelist>
<varlistentry><term>callBackObj [required]</term>
<listitem>
<para>
An instantiated object with a method that will be invoked whenever a row is updated, inserted, or deleted.
</para>
<para>
However, this argument can also be .nil to indicate that any installed update hook is to be removed.
</para>
</listitem></varlistentry>
<varlistentry><term>mthName [optional]</term>
<listitem>
<para>
The method name that will be invoked during a call back. By default, the method invoked will be <emphasis
role="italic">updateHookCallBack()</emphasis>. However, the user can specify an alternative method if desired. This
argument is ignored when the <emphasis role="italic">callbackObj</emphasis> argument is .nil.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [optional]</term>
<listitem>
<para>
This can be any Rexx object the user desires. The object will be sent as the last argument to the update hook
callback method when it is invoked. This argument is ignored when the callbackObj argument is .nil.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The <emphasis role="italic">userData</emphasis> argument to a previous invocation of the <emphasis
role="italic">updateHook</emphasis> method on this database connection, or .nil if there has not been a previous
invocation or the <emphasis role="italic">userData</emphasis> argument was not used on the previous invocation.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The functionality of the <emphasis role="italic">updateHook</emphasis> method is similar to that of the SQLite
<ulink url="http://www.sqlite.org/c3ref/commit_hook.html">sqlite3_update_hook</ulink> API.
</para>
</listitem></varlistentry>
</variablelist>
<section id="mthUpdateHookCallBack"><title>updateHookCallBack</title>
<indexterm><primary>updateHookCallBack</primary></indexterm>
<indexterm><primary>Callback Methods</primary><secondary>updateHookCallBack</secondary></indexterm>
<programlisting>
<![CDATA[
>>--updateHookCallBack(--op--,--dbName--,--tableName--,--rowID--,--userData--)-><
]]>
</programlisting>
<para>
The <emphasis role="italic">updateHookCallBack</emphasis> method is an example of a user callback method for the <link
linkend="mthUpdateHook">updateHook</link> method. Here the method name of <emphasis
role="italic">updateHookCallBack</emphasis> is used, because it is the default method name if the programmer does not
specify his own name in the <emphasis role="italic">updateHook</emphasis> method. Any method name can be used by
specifying it as the second argument to the <emphasis role="italic">updateHook</emphasis> method.
</para>
<para>
<emphasis role="bold">Note:</emphasis> there is no <emphasis role="italic">updateHookCallBack</emphasis> method in any
ooSQLite class. This method is just used to illustrate how to define a user callback method to be used with the update
hook.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
The arguments sent to the callback method are:
</para>
<variablelist>
<varlistentry><term>op [required]</term>
<listitem>
<para>
One of 3 authorizer <link linkend="sctAuthorizerAction">constants</link> that indicate what the update operation was.
Either INSERT, DELETE, or UPDATE.
</para>
</listitem></varlistentry>
<varlistentry><term>dbName [required]</term>
<listitem>
<para>
The database <link linkend="defDatabaseName">name</link> of the database containing the affected row.
</para>
</listitem></varlistentry>
<varlistentry><term>tableName [required]</term>
<listitem>
<para>
The table name of the table containing the affected row.
</para>
</listitem></varlistentry>
<varlistentry><term>rowID [required]</term>
<listitem>
<para>
The row ID of the affected row. Every row of every SQLite table has a whole number key that uniquely identifies the
row within its table. In the case of an update, this is the rowid after the update takes place.
</para>
</listitem></varlistentry>
<varlistentry><term>userData [required]</term>
<listitem>
<para>
The user data object specified by the programmer as the third argument to the <emphasis
role="italic">updateHook</emphasis> method. If the programmer did not specify a user data argument, this will be the
<computeroutput>.nil</computeroutput> object.
</para>
</listitem></varlistentry>
</variablelist>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The programmer must return a whole number value from the callback. However, the actual value returned makes no difference
to the SQLite database engine. Typically, the programmer would just return 0.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Remarks:</emphasis></term>
<listitem>
<para>
The callback method must not do anything that will modify the database connection that invoked the callback. Any actions
to modify the database connection must be deferred until after the completion of the <link
linkend="mthStepClsStmt">step</link> invocation that triggered the update hook to begin with. Running any other SQL
statements, including SELECT statements, or merely instantiating a new <link linkend="mthNewClsStmt">statement</link>
object, or executing another <emphasis role="italic">step</emphasis> method will modify the database connection.
</para>
<para>
The update hook is not invoked when internal SQLite system tables are modified (i.e. sqlite_master and sqlite_sequence).
In the current SQLite database enginge implementation, the update hook is not invoked when duplicate rows are deleted
because of an ON CONFLICT REPLACE clause. Nor is the update hook invoked when rows are deleted using the truncate
optimization. The exceptions defined in this paragraph might change in a future release of SQLite.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
The implementation of a <emphasis role="italic">update hook</emphasis> method is is discussed on the SQLite <ulink
url="http://www.sqlite.org/c3ref/update_hook.html">sqlite3_update_hook</ulink> page.
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End ooSQLiteConnection::updateHookCallBack() -->
</section> <!-- End ooSQLiteConnection::updateHook() -->
</section>