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
|
<HTML>
<HEAD>
<TITLE>prguide.htm</TITLE>
<LINK REL="ToC" HREF="httoc.htm">
<LINK REL="Index" HREF="htindex.htm">
<LINK REL="Next" HREF="prguid20.htm">
<LINK REL="Previous" HREF="prguid18.htm"></HEAD>
<BODY BGCOLOR="#FFFFFF">
<P ALIGN=CENTER>
<A HREF="prguid18.htm" TARGET="_self"><IMG SRC="graprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>
<A HREF="httoc.htm" TARGET="_self"><IMG SRC="gratoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>
<A HREF="htindex.htm" TARGET="_self"><IMG SRC="graindex.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Index"></A>
<A HREF="prguid20.htm" TARGET="_self"><IMG SRC="granext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>
<HR ALIGN=CENTER>
<P>
<UL>
<UL>
<LI>
<A HREF="#E74E6" >SQLFreeEnv (ODBC 1.0, Core)</A>
<UL>
<LI>
<A HREF="#E11E191" >Syntax</A>
<LI>
<A HREF="#E11E192" >Returns</A>
<LI>
<A HREF="#E11E193" >Diagnostics</A>
<LI>
<A HREF="#E11E194" >Comments</A>
<LI>
<A HREF="#E11E195" >Code Example</A>
<LI>
<A HREF="#E11E196" >Related Functions</A></UL>
<LI>
<A HREF="#E10E84" >SQLFreeStmt (ODBC 1.0, Core)</A>
<UL>
<LI>
<A HREF="#E11E197" >Syntax</A>
<LI>
<A HREF="#E11E198" >Returns</A>
<LI>
<A HREF="#E11E199" >Diagnostics</A>
<LI>
<A HREF="#E11E200" >Comments</A>
<LI>
<A HREF="#E11E201" >Code Example</A>
<LI>
<A HREF="#E11E202" >Related Functions</A></UL>
<LI>
<A HREF="#E10E85" >SQLGetConnectOption (ODBC 1.0, Level 1)</A>
<UL>
<LI>
<A HREF="#E11E203" >Syntax</A>
<LI>
<A HREF="#E11E204" >Returns</A>
<LI>
<A HREF="#E11E205" >Diagnostics</A>
<LI>
<A HREF="#E11E206" >Comments</A>
<LI>
<A HREF="#E11E207" >Related Functions</A></UL>
<LI>
<A HREF="#E10E86" >SQLGetCursorName (ODBC 1.0, Core)</A>
<UL>
<LI>
<A HREF="#E11E208" >Syntax</A>
<LI>
<A HREF="#E11E209" >Returns</A>
<LI>
<A HREF="#E11E210" >Diagnostics</A>
<LI>
<A HREF="#E11E211" >Comments</A></UL>
<LI>
<A HREF="#E10E87" >SQLGetData (ODBC 1.0, Level 1)</A>
<UL>
<LI>
<A HREF="#E11E212" >Syntax</A>
<LI>
<A HREF="#E11E213" >Returns</A>
<LI>
<A HREF="#E11E214" >Diagnostics</A>
<LI>
<A HREF="#E11E215" >Comments</A>
<LI>
<A HREF="#E11E216" >Code Example</A>
<LI>
<A HREF="#E11E217" >Related Functions</A></UL></UL></UL>
<HR ALIGN=CENTER>
<A NAME="E74E6"></A>
<H2>
<FONT FACE="Arial"><B>SQLFreeEnv (ODBC 1.0, Core)</B><A NAME="I2"></A><A NAME="I3"></A><A NAME="I4"></A><A NAME="I5"></A><A NAME="I6"></A></FONT></H2>
<BLOCKQUOTE>
<P><B>SQLFreeEnv</B> frees the environment handle and releases all memory associated with the environment handle.
</BLOCKQUOTE>
<A NAME="E11E191"></A>
<H3>
<FONT FACE="Arial">Syntax</FONT></H3>
<BLOCKQUOTE>
<P>RETCODE <B>SQLFreeEnv</B>(<I>henv</I>)<A NAME="I7"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The <B>SQLFreeEnv</B> function accepts the following argument.
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P><B>Type</B>
</BLOCKQUOTE></TD>
<TD WIDTH=93 VALIGN=top >
<A NAME="E7E974"></A>
<P>Argument
</TD><TD WIDTH=73 VALIGN=top >
<A NAME="E7E974"></A>
<P>Use
</TD><TD WIDTH=206 VALIGN=top >
<A NAME="E7E974"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P>HENV
</BLOCKQUOTE></TD>
<TD WIDTH=93 VALIGN=top >
<A NAME="E7E975"></A>
<P><I>henv</I>
</TD><TD WIDTH=73 VALIGN=top >
<A NAME="E7E975"></A>
<P>Input
</TD><TD WIDTH=206 VALIGN=top >
<A NAME="E7E975"></A>
<P>Environment handle.</TD></TR></TABLE>
<A NAME="E11E192"></A>
<H3>
<FONT FACE="Arial">Returns<A NAME="I8"></A></FONT></H3>
<BLOCKQUOTE>
<P>SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.
</BLOCKQUOTE>
<A NAME="E11E193"></A>
<H3>
<FONT FACE="Arial">Diagnostics<A NAME="I9"></A></FONT></H3>
<BLOCKQUOTE>
<P>When <B>SQLFreeEnv</B> returns SQL_ERROR or SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained by calling <B>SQLError</B>. The following table lists the SQLSTATE values commonly returned by <B>SQLFreeEnv </B>and explains each one in the context of this function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned by the Driver Manager. The return code associated with each SQLSTATE value is SQL_ERROR, unless noted otherwise.
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P><B>SQLSTATE</B>
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E976"></A>
<P>Error
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E976"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P>01000
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E977"></A>
<P>General warning
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E977"></A>
<P>Driver-specific informational message. (Function returns SQL_SUCCESS_WITH_INFO.)</TD>
</TR>
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P>S1000
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E978"></A>
<P>General error
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E978"></A>
<P>An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by <B>SQLError</B> in the argument <I>szErrorMsg</I> describes the error and its cause.</TD>
</TR>
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P>S1010
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E979"></A>
<P>Function sequence error
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E979"></A>
<P>(DM) There was at least one <I>hdbc</I> in an allocated or connected state. Call <B>SQLDisconnect</B> and <B>SQLFreeConnect</B> for each <I>hdbc</I> before calling <B>SQLFreeEnv</B>.</TD></TR></TABLE>
<A NAME="E11E194"></A>
<H3>
<FONT FACE="Arial">Comments<A NAME="I10"></A><A NAME="I11"></A></FONT></H3>
<BLOCKQUOTE>
<P>Prior to calling <B>SQLFreeEnv</B>, an application must call <B>SQLFreeConnect</B> for any <I>hdbc</I> allocated under the <I>henv</I>. Otherwise, <B>SQLFreeEnv</B> returns SQL_ERROR and the <I>henv</I> and any active <I>hdbc</I> remains valid.<A NAME="I12"></A><A NAME="I13"></A><A NAME="I14"></A><A NAME="I15"></A><A NAME="I16"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>When the Driver Manager processes the <B>SQLFreeEnv</B> function, it checks the <B>TraceAutoStop</B> keyword in the [ODBC] section of the ODBC.INI file or the ODBC subkey of the registry. If it is set to 1, the Driver Manager disables tracing for all applications and sets the <B>Trace</B> keyword in the [ODBC] section of the ODBC.INI file or the ODBC subkey of the registry to 0.
</BLOCKQUOTE>
<A NAME="E11E195"></A>
<H3>
<FONT FACE="Arial">Code Example<A NAME="I17"></A></FONT></H3>
<BLOCKQUOTE>
<P>See <B>SQLBrowseConnect</B> and <B>SQLConnect</B>.
</BLOCKQUOTE>
<A NAME="E11E196"></A>
<H3>
<FONT FACE="Arial">Related Functions</FONT></H3>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P><B>For information about</B>
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E980"></A>
<P>See</TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Allocating an environment handle
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E981"></A>
<P><B>SQLAllocEnv</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Freeing a connection handle
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E982"></A>
<P><B>SQLFreeConnect</B></TD></TR></TABLE><A NAME="E10E84"></A>
<H2>
<FONT FACE="Arial"><B>SQLFreeStmt (ODBC 1.0, Core)</B><A NAME="I18"></A><A NAME="I19"></A><A NAME="I20"></A><A NAME="I21"></A><A NAME="I22"></A><A NAME="I23"></A><A NAME="I24"></A><A NAME="I25"></A><A NAME="I26"></A><A NAME="I27"></A><A NAME="I28"></A><A NAME="I29"></A><A NAME="I30"></A></FONT></H2>
<BLOCKQUOTE>
<P><B>SQLFreeStmt</B> stops processing associated with a specific <I>hstmt</I>, closes any open cursors associated with the <I>hstmt</I>, discards pending results, and, optionally, frees all resources associated with the statement handle.
</BLOCKQUOTE>
<A NAME="E11E197"></A>
<H3>
<FONT FACE="Arial">Syntax</FONT></H3>
<BLOCKQUOTE>
<P>RETCODE <B>SQLFreeStmt</B>(<I>hstmt</I>, <I>fOption</I>)<A NAME="I31"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The <B>SQLFreeStmt</B> function accepts the following arguments.
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P><B>Type</B>
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E983"></A>
<P>Argument
</TD><TD WIDTH=66 VALIGN=top >
<A NAME="E7E983"></A>
<P>Use
</TD><TD WIDTH=226 VALIGN=top >
<A NAME="E7E983"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>HSTMT
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E984"></A>
<P><I>hstmt</I>
</TD><TD WIDTH=66 VALIGN=top >
<A NAME="E7E984"></A>
<P>Input
</TD><TD WIDTH=226 VALIGN=top >
<A NAME="E7E984"></A>
<P>Statement handle</TD>
</TR>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>UWORD
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E985"></A>
<P><I>fOption</I>
</TD><TD WIDTH=66 VALIGN=top >
<A NAME="E7E985"></A>
<P>Input
</TD><TD WIDTH=226 VALIGN=top >
<A NAME="E7E985"></A>
<P>One of the following options:
<BLOCKQUOTE>
<P>SQL_ CLOSE: Close the cursor associated with <I>hstmt</I> (if one was defined) and discard all pending results. The application can reopen this cursor later by executing a <B>SELECT</B> statement again with the same or different parameter values. If no cursor is open, this option has no effect for the application.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>SQL_DROP: Release the <I>hstmt</I>, free all resources associated with it, close the cursor (if one is open), and discard all pending rows. This option terminates all access to the <I>hstmt</I>. The <I>hstmt</I> must be reallocated to be reused.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>SQL_UNBIND: Release all column buffers bound by <B>SQLBindCol</B> for the given <I>hstmt</I>.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>SQL_RESET_PARAMS: Release all parameter buffers set by <B>SQLBindParameter</B> for the given <I>hstmt</I>.</TD></TR></BLOCKQUOTE></TABLE>
<A NAME="E11E198"></A>
<H3>
<FONT FACE="Arial">Returns<A NAME="I32"></A></FONT></H3>
<BLOCKQUOTE>
<P>SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.
</BLOCKQUOTE>
<A NAME="E11E199"></A>
<H3>
<FONT FACE="Arial">Diagnostics<A NAME="I33"></A></FONT></H3>
<BLOCKQUOTE>
<P>When <B>SQLFreeStmt</B> returns SQL_ERROR or SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained by calling <B>SQLError</B>. The following table lists the SQLSTATE values commonly returned by <B>SQLFreeStmt </B>and explains each one in the context of this function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned by the Driver Manager. The return code associated with each SQLSTATE value is SQL_ERROR, unless noted otherwise.
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P><B>SQLSTATE</B>
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E986"></A>
<P>Error
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E986"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P>01000
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E987"></A>
<P>General warning
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E987"></A>
<P>Driver-specific informational message. (Function returns SQL_SUCCESS_WITH_INFO.)</TD>
</TR>
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P>IM001
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E988"></A>
<P>Driver does not support this function
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E988"></A>
<P>(DM) The driver associated with the <I>hstmt</I> does not support the function.</TD>
</TR>
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P>S1000
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E989"></A>
<P>General error
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E989"></A>
<P>An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by <B>SQLError</B> in the argument <I>szErrorMsg</I> describes the error and its cause.</TD>
</TR>
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P>S1001
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E990"></A>
<P>Memory allocation failure
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E990"></A>
<P>The driver was unable to allocate memory required to support execution or completion of the function.</TD>
</TR>
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P>S1010
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E991"></A>
<P>Function sequence error
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E991"></A>
<P>(DM) An asynchronously executing function was called for the <I>hstmt</I> and was still executing when this function was called.
<BLOCKQUOTE>
<P>(DM) <B>SQLExecute</B>, <B>SQLExecDirect</B>, or <B>SQLSetPos</B> was called for the <I>hstmt</I> and returned SQL_NEED_DATA. This function was called before data was sent for all data-at-execution parameters or columns.</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=93 VALIGN=top >
<BLOCKQUOTE>
<P>S1092
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E992"></A>
<P>Option type out of range
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E992"></A>
<P>(DM) The value specified for the argument <I>fOption</I> was not:
<BLOCKQUOTE>
<P>SQL_CLOSE
<BR>SQL_DROP
<BR>SQL_UNBIND
<BR>SQL_RESET_PARAMS</TD></TR></BLOCKQUOTE></TABLE>
<A NAME="E11E200"></A>
<H3>
<FONT FACE="Arial">Comments<A NAME="I34"></A></FONT></H3>
<BLOCKQUOTE>
<P>An application can call <B>SQLFreeStmt</B> to terminate processing of a <B>SELECT</B> statement with or without canceling the statement handle.<A NAME="I35"></A><A NAME="I36"></A><A NAME="I37"></A><A NAME="I38"></A><A NAME="I39"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The SQL_DROP option frees all resources that were allocated by the <B>SQLAllocStmt</B> function.
</BLOCKQUOTE>
<A NAME="E11E201"></A>
<H3>
<FONT FACE="Arial">Code Example<A NAME="I40"></A></FONT></H3>
<BLOCKQUOTE>
<P>See <B>SQLBrowseConnect</B> and <B>SQLConnect</B>.
</BLOCKQUOTE>
<A NAME="E11E202"></A>
<H3>
<FONT FACE="Arial">Related Functions</FONT></H3>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P><B>For information about</B>
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E993"></A>
<P>See</TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Allocating a statement handle
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E994"></A>
<P><B>SQLAllocStmt</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Canceling statement processing
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E995"></A>
<P><B>SQLCancel</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Setting a cursor name
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E996"></A>
<P><B>SQLSetCursorName</B></TD></TR></TABLE><A NAME="E10E85"></A>
<H2>
<FONT FACE="Arial"><B>SQLGetConnectOption (ODBC 1.0, Level 1)</B><A NAME="I41"></A><A NAME="I42"></A></FONT></H2>
<BLOCKQUOTE>
<P><B>SQLGetConnectOption</B> returns the current setting of a connection option.
</BLOCKQUOTE>
<A NAME="E11E203"></A>
<H3>
<FONT FACE="Arial">Syntax</FONT></H3>
<BLOCKQUOTE>
<P>RETCODE <B>SQLGetConnectOption</B>(<I>hdbc</I>, <I>fOption</I>, <I>pvParam</I>)<A NAME="I43"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The <B>SQLGetConnectOption</B> function accepts the following arguments:
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P><B>Type</B>
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E997"></A>
<P>Argument
</TD><TD WIDTH=93 VALIGN=top >
<A NAME="E7E997"></A>
<P>Use
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E997"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>HDBC
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E998"></A>
<P><I>hdbc</I>
</TD><TD WIDTH=93 VALIGN=top >
<A NAME="E7E998"></A>
<P>Input
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E998"></A>
<P>Connection handle. </TD>
</TR>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>UWORD
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E999"></A>
<P><I>fOption</I>
</TD><TD WIDTH=93 VALIGN=top >
<A NAME="E7E999"></A>
<P>Input
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E999"></A>
<P>Option to retrieve. </TD>
</TR>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>PTR
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E1000"></A>
<P><I>pvParam</I>
</TD><TD WIDTH=93 VALIGN=top >
<A NAME="E7E1000"></A>
<P>Output
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1000"></A>
<P>Value associated with <I>fOption</I>. Depending on the value of <I>fOption</I>, a 32-bit integer value or a pointer to a null-terminated character string will be returned in <I>pvParam</I>.</TD></TR></TABLE>
<A NAME="E11E204"></A>
<H3>
<FONT FACE="Arial">Returns<A NAME="I44"></A></FONT></H3>
<BLOCKQUOTE>
<P>SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA_FOUND, SQL_ERROR, or SQL_INVALID_HANDLE.
</BLOCKQUOTE>
<A NAME="E11E205"></A>
<H3>
<FONT FACE="Arial">Diagnostics<A NAME="I45"></A></FONT></H3>
<BLOCKQUOTE>
<P>When <B>SQLGetConnectOption</B> returns SQL_ERROR or SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained by calling <B>SQLError</B>. The following table lists the SQLSTATE values commonly returned by <B>SQLGetConnectOption </B>and explains each one in the context of this function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned by the Driver Manager. The return code associated with each SQLSTATE value is SQL_ERROR, unless noted otherwise.
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P><B>SQLSTATE</B>
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1001"></A>
<P>Error
</TD><TD WIDTH=233 VALIGN=top >
<A NAME="E7E1001"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P>01000
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1002"></A>
<P>General warning
</TD><TD WIDTH=233 VALIGN=top >
<A NAME="E7E1002"></A>
<P>Driver-specific informational message. (Function returns SQL_SUCCESS_WITH_INFO.)</TD>
</TR>
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P>08003
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1003"></A>
<P>Connection not open
</TD><TD WIDTH=233 VALIGN=top >
<A NAME="E7E1003"></A>
<P>(DM) An <I>fOption</I> value was specified that required an open connection.</TD>
</TR>
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P>IM001
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1004"></A>
<P>Driver does not support this function
</TD><TD WIDTH=233 VALIGN=top >
<A NAME="E7E1004"></A>
<P>(DM) The driver corresponding to the <I>hdbc</I> does not support the function.</TD>
</TR>
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P>S1000
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1005"></A>
<P>General error
</TD><TD WIDTH=233 VALIGN=top >
<A NAME="E7E1005"></A>
<P>An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by <B>SQLError</B> in the argument <I>szErrorMsg</I> describes the error and its cause.</TD>
</TR>
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P>S1001
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1006"></A>
<P>Memory allocation failure
</TD><TD WIDTH=233 VALIGN=top >
<A NAME="E7E1006"></A>
<P>The driver was unable to allocate memory required to support execution or completion of the function.</TD>
</TR>
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P>S1010
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1007"></A>
<P>Function sequence error
</TD><TD WIDTH=233 VALIGN=top >
<A NAME="E7E1007"></A>
<P>(DM) <B>SQLBrowseConnect</B> was called for the <I>hdbc</I> and returned SQL_NEED_DATA. This function was called before <B>SQLBrowseConnect</B> returned SQL_SUCCESS_WITH_INFO or SQL_SUCCESS.</TD>
</TR>
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P>S1092
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1008"></A>
<P>Option type out of range
</TD><TD WIDTH=233 VALIGN=top >
<A NAME="E7E1008"></A>
<P>(DM) The value specified for the argument <I>fOption</I> was in the block of numbers reserved for ODBC connection and statement options, but was not valid for the version of ODBC supported by the driver.</TD>
</TR>
<TR>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P>S1C00
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1009"></A>
<P>Driver not capable
</TD><TD WIDTH=233 VALIGN=top >
<A NAME="E7E1009"></A>
<P>The value specified for the argument <I>fOption</I> was a valid ODBC connection option for the version of ODBC supported by the driver, but was not supported by the driver.
<BLOCKQUOTE>
<P>The value specified for the argument <I>fOption</I> was in the block of numbers reserved for driver-specific connection and statement options, but was not supported by the driver.</TD></TR></BLOCKQUOTE></TABLE>
<A NAME="E11E206"></A>
<H3>
<FONT FACE="Arial">Comments<A NAME="I46"></A><A NAME="I47"></A><A NAME="I48"></A></FONT></H3>
<BLOCKQUOTE>
<P>For a list of options, see <B>SQLSetConnectOption</B>. Note that if <I>fOption</I> specifies an option that returns a string, <I>pvParam</I> must be a pointer to storage for the string. The maximum length of the string will be SQL_MAX_OPTION_STRING_LENGTH bytes (excluding the null termination byte).<A NAME="I49"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>Depending on the option, an application does not need to establish a connection prior to calling <B>SQLGetConnectOption</B>. However, if <B>SQLGetConnectOption</B> is called and the specified option does not have a default and has not been set by a prior call to <B>SQLSetConnectOption</B>, <B>SQLGetConnnectOption</B> will return SQL_NO_DATA_FOUND.<A NAME="I50"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>While an application can set statement options using <B>SQLSetConnectOption</B>, an application cannot use <B>SQLGetConnectOption</B> to retrieve statement option values; it must call <B>SQLGetStmtOption</B> to retrieve the setting of statement options.
</BLOCKQUOTE>
<A NAME="E11E207"></A>
<H3>
<FONT FACE="Arial">Related Functions</FONT></H3>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P><B>For information about</B>
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1010"></A>
<P>See</TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Returning the setting of a statement option
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1011"></A>
<P><B>SQLGetStmtOption</B> (extension)</TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Setting a connection option
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1012"></A>
<P><B>SQLSetConnectOption</B> (extension)</TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Setting a statement option
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1013"></A>
<P><B>SQLSetStmtOption</B> (extension)</TD></TR></TABLE><A NAME="E10E86"></A>
<H2>
<FONT FACE="Arial"><B>SQLGetCursorName (ODBC 1.0, Core)</B><A NAME="I51"></A></FONT></H2>
<BLOCKQUOTE>
<P><B>SQLGetCursorName</B> returns the cursor name associated with a specified <I>hstmt</I>.
</BLOCKQUOTE>
<A NAME="E11E208"></A>
<H3>
<FONT FACE="Arial">Syntax</FONT></H3>
<BLOCKQUOTE>
<P>RETCODE <B>SQLGetCursorName</B>(<I>hstmt</I>, <I>szCursor</I>, <I>cbCursorMax</I>, <I>pcbCursor</I>)<A NAME="I52"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The <B>SQLGetCursorName</B> function accepts the following arguments.
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=100 VALIGN=top >
<BLOCKQUOTE>
<P><B>Type</B>
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E1014"></A>
<P>Argument
</TD><TD WIDTH=73 VALIGN=top >
<A NAME="E7E1014"></A>
<P>Use
</TD><TD WIDTH=193 VALIGN=top >
<A NAME="E7E1014"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=100 VALIGN=top >
<BLOCKQUOTE>
<P>HSTMT
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E1015"></A>
<P><I>hstmt</I>
</TD><TD WIDTH=73 VALIGN=top >
<A NAME="E7E1015"></A>
<P>Input
</TD><TD WIDTH=193 VALIGN=top >
<A NAME="E7E1015"></A>
<P>Statement handle.</TD>
</TR>
<TR>
<TD WIDTH=100 VALIGN=top >
<BLOCKQUOTE>
<P>UCHAR FAR *
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E1016"></A>
<P><I>szCursor</I>
</TD><TD WIDTH=73 VALIGN=top >
<A NAME="E7E1016"></A>
<P>Output
</TD><TD WIDTH=193 VALIGN=top >
<A NAME="E7E1016"></A>
<P>Pointer to storage for the cursor name.</TD>
</TR>
<TR>
<TD WIDTH=100 VALIGN=top >
<BLOCKQUOTE>
<P>SWORD
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E1017"></A>
<P><I>cbCursorMax</I>
</TD><TD WIDTH=73 VALIGN=top >
<A NAME="E7E1017"></A>
<P>Input
</TD><TD WIDTH=193 VALIGN=top >
<A NAME="E7E1017"></A>
<P>Length of <I>szCursor</I>.</TD>
</TR>
<TR>
<TD WIDTH=100 VALIGN=top >
<BLOCKQUOTE>
<P>SWORD FAR *
</BLOCKQUOTE></TD>
<TD WIDTH=86 VALIGN=top >
<A NAME="E7E1018"></A>
<P><I>pcbCursor</I>
</TD><TD WIDTH=73 VALIGN=top >
<A NAME="E7E1018"></A>
<P>Output
</TD><TD WIDTH=193 VALIGN=top >
<A NAME="E7E1018"></A>
<P>Total number of bytes (excluding the null termination byte) available to return in <I>szCursor</I>. If the number of bytes available to return is greater than or equal to <I>cbCursorMax</I>, the cursor name in <I>szCursor</I> is truncated to <I>cbCursorMax</I> – 1 bytes.</TD></TR></TABLE>
<A NAME="E11E209"></A>
<H3>
<FONT FACE="Arial">Returns<A NAME="I53"></A></FONT></H3>
<BLOCKQUOTE>
<P>SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.
</BLOCKQUOTE>
<A NAME="E11E210"></A>
<H3>
<FONT FACE="Arial">Diagnostics<A NAME="I54"></A></FONT></H3>
<BLOCKQUOTE>
<P>When <B>SQLGetCursorName</B> returns either SQL_ERROR or SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained by calling <B>SQLError</B>. The following table lists the SQLSTATE values commonly returned by <B>SQLGetCursorName </B>and explains each one in the context of this function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned by the Driver Manager. The return code associated with each SQLSTATE value is SQL_ERROR, unless noted otherwise.
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=113 VALIGN=top >
<BLOCKQUOTE>
<P><B>SQLSTATE</B>
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1019"></A>
<P>Error
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1019"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=113 VALIGN=top >
<BLOCKQUOTE>
<P>01000
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1020"></A>
<P>General warning
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1020"></A>
<P>Driver-specific informational message. (Function returns SQL_SUCCESS_WITH_INFO.)</TD>
</TR>
<TR>
<TD WIDTH=113 VALIGN=top >
<BLOCKQUOTE>
<P>01004
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1021"></A>
<P>Data truncated
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1021"></A>
<P>The buffer <I>szCursor</I> was not large enough to return the entire cursor name, so the cursor name was truncated. The argument <I>pcbCursor</I> contains the length of the untruncated cursor name. (Function returns SQL_SUCCESS_WITH_INFO.)</TD>
</TR>
<TR>
<TD WIDTH=113 VALIGN=top >
<BLOCKQUOTE>
<P>IM001
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1022"></A>
<P>Driver does not support this function
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1022"></A>
<P>(DM) The driver associated with the <I>hstmt</I> does not support the function.</TD>
</TR>
<TR>
<TD WIDTH=113 VALIGN=top >
<BLOCKQUOTE>
<P>S1000
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1023"></A>
<P>General error
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1023"></A>
<P>An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by <B>SQLError</B> in the argument <I>szErrorMsg</I> describes the error and its cause.</TD>
</TR>
<TR>
<TD WIDTH=113 VALIGN=top >
<BLOCKQUOTE>
<P>S1001
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1024"></A>
<P>Memory allocation failure
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1024"></A>
<P>The driver was unable to allocate memory required to support execution or completion of the function.</TD>
</TR>
<TR>
<TD WIDTH=113 VALIGN=top >
<BLOCKQUOTE>
<P>S1010
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1025"></A>
<P>Function sequence error
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1025"></A>
<P>(DM) An asynchronously executing function was called for the <I>hstmt</I> and was still executing when this function was called.
<BLOCKQUOTE>
<P>(DM) <B>SQLExecute</B>, <B>SQLExecDirect</B>, or <B>SQLSetPos</B> was called for the <I>hstmt</I> and returned SQL_NEED_DATA. This function was called before data was sent for all data-at-execution parameters or columns.</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=113 VALIGN=top >
<BLOCKQUOTE>
<P>S1015
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1026"></A>
<P>No cursor name available
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1026"></A>
<P>(DM) There was no open cursor on the <I>hstmt</I> and no cursor name had been set with <B>SQLSetCursorName</B>.</TD>
</TR>
<TR>
<TD WIDTH=113 VALIGN=top >
<BLOCKQUOTE>
<P>S1090
</BLOCKQUOTE></TD>
<TD WIDTH=140 VALIGN=top >
<A NAME="E7E1027"></A>
<P>Invalid string or buffer length
</TD><TD WIDTH=200 VALIGN=top >
<A NAME="E7E1027"></A>
<P>(DM) The value specified in the argument <I>cbCursorMax</I> was less than 0.</TD></TR></TABLE>
<A NAME="E11E211"></A>
<H3>
<FONT FACE="Arial">Comments<A NAME="I55"></A><A NAME="I56"></A><A NAME="I57"></A><A NAME="I58"></A></FONT></H3>
<BLOCKQUOTE>
<P>The only ODBC SQL statements that use a cursor name are positioned update and delete (for example, <B>UPDATE</B> <I>table-name</I> ...<B>WHERE CURRENT </B><B>OF</B> <I>cursor-name</I>). If the application does not call <B>SQLSetCursorName</B> to define a cursor name, on execution of a <B>SELECT</B> statement the driver generates a name that begins with the letters SQL_CUR and does not exceed 18 characters in length.<A NAME="I59"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P><B>SQLGetCursorName</B> returns the name of a cursor regardless of whether the name was created explicitly or implicitly.
</BLOCKQUOTE><A NAME="I60"></A><A NAME="I61"></A>
<BLOCKQUOTE>
<P>A cursor name that is set either explicitly or implicitly remains set until the <I>hstmt</I> with which it is associated is dropped, using <B>SQLFreeStmt</B> with the SQL_DROP option.
</BLOCKQUOTE>
<A NAME="E7E1028"></A>
<P>Related Functions
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P><B>For information about</B>
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1029"></A>
<P>See</TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Executing an SQL statement
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1030"></A>
<P><B>SQLExecDirect</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Executing a prepared SQL statement
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1031"></A>
<P><B>SQLExecute</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Preparing a statement for execution
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1032"></A>
<P><B>SQLPrepare</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Setting a cursor name
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1033"></A>
<P><B>SQLSetCursorName</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Setting cursor scrolling options
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1034"></A>
<P><B>SQLSetScrollOptions</B> (extension)</TD></TR></TABLE><A NAME="E10E87"></A>
<H2>
<FONT FACE="Arial"><B>SQLGetData (ODBC 1.0, Level 1)</B><A NAME="I62"></A><A NAME="I63"></A><A NAME="I64"></A><A NAME="I65"></A></FONT></H2>
<BLOCKQUOTE>
<P><B>SQLGetData</B> returns result data for a single unbound column in the current row. The application must call <B>SQLFetch</B>, or <B>SQLExtendedFetch</B> and (optionally) <B>SQLSetPos</B> to position the cursor on a row of data before it calls <B>SQLGetData</B>. It is possible to use <B>SQLBindCol</B> for some columns and use <B>SQLGetData</B> for others within the same row. This function can be used to retrieve character or binary data values in parts from a column with a character, binary, or data source–specific data type (for example, data from SQL_LONGVARBINARY or SQL_LONGVARCHAR columns).
</BLOCKQUOTE>
<A NAME="E11E212"></A>
<H3>
<FONT FACE="Arial">Syntax</FONT></H3>
<BLOCKQUOTE>
<P>RETCODE <B>SQLGetData</B>(<I>hstmt</I>, <I>icol</I>, <I>fCType</I>, <I>rgbValue</I>, <I>cbValueMax</I>, <I>pcbValue</I>)<A NAME="I66"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The <B>SQLGetData</B> function accepts the following arguments:
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P><B>Type</B>
</BLOCKQUOTE></TD>
<TD WIDTH=80 VALIGN=top >
<A NAME="E7E1035"></A>
<P>Argument
</TD><TD WIDTH=60 VALIGN=top >
<A NAME="E7E1035"></A>
<P>Use
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E1035"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>HSTMT
</BLOCKQUOTE></TD>
<TD WIDTH=80 VALIGN=top >
<A NAME="E7E1036"></A>
<P><I>hstmt</I>
</TD><TD WIDTH=60 VALIGN=top >
<A NAME="E7E1036"></A>
<P>Input
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E1036"></A>
<P>Statement handle. </TD>
</TR>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>UWORD
</BLOCKQUOTE></TD>
<TD WIDTH=80 VALIGN=top >
<A NAME="E7E1037"></A>
<P><I>icol</I>
</TD><TD WIDTH=60 VALIGN=top >
<A NAME="E7E1037"></A>
<P>Input
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E1037"></A>
<P>Column number of result data, ordered sequentially left to right, starting at 1. A column number of 0 is used to retrieve a bookmark for the row; bookmarks are not supported by ODBC 1.0 drivers or <B>SQLFetch</B>.</TD>
</TR>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>SWORD<A NAME="I67"></A><A NAME="I68"></A><A NAME="I69"></A><A NAME="I70"></A><A NAME="I71"></A>
</BLOCKQUOTE></TD>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P><I>fCType</I>
</BLOCKQUOTE></TD>
<TD WIDTH=60 VALIGN=top >
<A NAME="E7E1038"></A>
<P>Input
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E1038"></A>
<P>The C data type of the result data. This must be one of the following values:
<BLOCKQUOTE>
<P>SQL_C_BINARY
<BR>SQL_C_BIT
<BR>SQL_C_BOOKMARK
<BR>SQL_C_CHAR
<BR>SQL_C_DATE
<BR>SQL_C_DEFAULT
<BR>SQL_C_DOUBLE
<BR>SQL_C_FLOAT
<BR>SQL_C_SLONG
<BR>SQL_C_SSHORT
<BR>SQL_C_STINYINT
<BR>SQL_C_TIME
<BR>SQL_C_TIMESTAMP
<BR>SQL_C_ULONG
<BR>SQL_C_USHORT
<BR>SQL_C_UTINYINT
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>SQL_C_DEFAULT specifies that data be converted to its default C data type.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P><B>Note</B> Drivers must also support the following values of <I>fCType</I> from ODBC 1.0. Applications must use these values, rather than the ODBC 2.0 values, when calling an ODBC 1.0 driver:
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>SQL_C_LONG
<BR>SQL_C_SHORT
<BR>SQL_C_TINYINT
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>For information about how data is converted, see "Converting Data from SQL to C Data Types" in Appendix D, "Data Types."</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>PTR
</BLOCKQUOTE></TD>
<TD WIDTH=80 VALIGN=top >
<A NAME="E7E1039"></A>
<P><I>rgbValue</I>
</TD><TD WIDTH=60 VALIGN=top >
<A NAME="E7E1039"></A>
<P>Output
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E1039"></A>
<P>Pointer to storage for the data.</TD>
</TR>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>SDWORD<A NAME="I72"></A><A NAME="I73"></A>
</BLOCKQUOTE></TD>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P><I>cbValueMax</I>
</BLOCKQUOTE></TD>
<TD WIDTH=60 VALIGN=top >
<A NAME="E7E1040"></A>
<P>Input
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E1040"></A>
<P>Maximum length of the <I>rgbValue</I> buffer. For character data, <I>rgbValue</I> must also include space for the null-termination byte.
<BLOCKQUOTE>
<P>For character and binary C data, <I>cbValueMax</I> determines the amount of data that can be received in a single call to <B>SQLGetData</B>. For all other types of C data, <I>cbValueMax</I> is ignored; the driver assumes that the size of <I>rgbValue</I> is the size of the C data type specified with <I>fCType</I> and returns the entire data value. For more information about length, see "Precision, Scale, Length, and Display Size" in Appendix D, "Data Types."</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=73 VALIGN=top >
<BLOCKQUOTE>
<P>SDWORD FAR *
</BLOCKQUOTE></TD>
<TD WIDTH=80 VALIGN=top >
<BLOCKQUOTE>
<P><I>pcbValue</I>
</BLOCKQUOTE></TD>
<TD WIDTH=60 VALIGN=top >
<A NAME="E7E1041"></A>
<P>Output
</TD><TD WIDTH=240 VALIGN=top >
<A NAME="E7E1041"></A>
<P>SQL_NULL_DATA, the total number of bytes (excluding the null termination byte for character data) available to return in <I>rgbValue</I> prior to the current call to <B>SQLGetData</B>, or SQL_NO_TOTAL if the number of available bytes cannot be determined.
<BLOCKQUOTE>
<P>For character data, if <I>pcbValue</I> is SQL_NO_TOTAL or is greater than or equal to <I>cbValueMax</I>, the data in <I>rgbValue</I> is truncated to <I>cbValueMax</I> – 1 bytes and is null-terminated by the driver.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>For binary data, if <I>pcbValue</I> is SQL_NO_TOTAL or is greater than <I>cbValueMax</I>, the data in <I>rgbValue</I> is truncated to <I>cbValueMax</I> bytes.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>For all other data types, the value of <I>cbValueMax</I> is ignored and the driver assumes the size of <I>rgbValue</I> is the size of the C data type specified with <I>fCType</I>.</TD></TR></BLOCKQUOTE></TABLE>
<A NAME="E11E213"></A>
<H3>
<FONT FACE="Arial">Returns<A NAME="I74"></A></FONT></H3>
<BLOCKQUOTE>
<P>SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA_FOUND, SQL_STILL_EXECUTING, SQL_ERROR, or SQL_INVALID_HANDLE.
</BLOCKQUOTE>
<A NAME="E11E214"></A>
<H3>
<FONT FACE="Arial">Diagnostics<A NAME="I75"></A></FONT></H3>
<BLOCKQUOTE>
<P>When <B>SQLGetData</B> returns either SQL_ERROR or SQL_SUCCESS_WITH_INFO, an associated SQLSTATE value may be obtained by calling <B>SQLError</B>. The following table lists the SQLSTATE values commonly returned by <B>SQLGetData </B>and explains each one in the context of this function; the notation "(DM)" precedes the descriptions of SQLSTATEs returned by the Driver Manager. The return code associated with each SQLSTATE value is SQL_ERROR, unless noted otherwise.
</BLOCKQUOTE>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P><B>SQLSTATE</B>
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1042"></A>
<P>Error
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1042"></A>
<P>Description</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>01000
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1043"></A>
<P>General warning
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1043"></A>
<P>Driver-specific informational message. (Function returns SQL_SUCCESS_WITH_INFO.)</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>01004
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1044"></A>
<P>Data truncated
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1044"></A>
<P>All of the data for the specified column, <I>icol</I>, could not be retrieved in a single call to the function. The argument <I>pcbValue</I> contains the length of the data remaining in the specified column prior to the current call to <B>SQLGetData</B>. (Function returns SQL_SUCCESS_WITH_INFO.) For more information on using multiple calls to <B>SQLGetData</B> for a single column, see "Comments."</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>07006
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1045"></A>
<P>Restricted data type attribute violation
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1045"></A>
<P>The data value cannot be converted to the C data type specified by the argument <I>fCType</I>.</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>08S01
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1046"></A>
<P>Communication link failure
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1046"></A>
<P>The communication link between the driver and the data source to which the driver was connected failed before the function completed processing.</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>22002
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1047"></A>
<P>Indicator variable required but not supplied
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1047"></A>
<P>NULL data is retrieved and <I>pcbValue</I> is a null pointer.</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>22003
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1048"></A>
<P>Numeric value out of range
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1048"></A>
<P>Returning the numeric value (as numeric or string) for the column would have caused the whole (as opposed to fractional) part of the number to be truncated.
<BLOCKQUOTE>
<P>Returning the binary value for the column would have caused a loss of binary significance.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>For more information, see Appendix D, "Data Types."</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>22005
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1049"></A>
<P>Error in assignment
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1049"></A>
<P>The data for the column was incompatible with the data type into which it was to be converted. For more information, see Appendix D, "Data Types."</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>22008
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1050"></A>
<P>Datetime field overflow
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1050"></A>
<P>The data for the column was not a valid date, time, or timestamp value. For more information, see Appendix D, "Data Types."</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>24000
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1051"></A>
<P>Invalid cursor state
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1051"></A>
<P>(DM) The <I>hstmt</I> was in an executed state but no result set was associated with the <I>hstmt</I>.
<BLOCKQUOTE>
<P>(DM) A cursor was open on the <I>hstmt</I> but <B>SQLFetch</B> or <B>SQLExtendedFetch</B> had not been called.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>A cursor was open on the <I>hstmt</I> and <B>SQLFetch</B> or <B>SQLExtendedFetch</B> had been called, but the cursor was positioned before the start of the result set or after the end of the result set.</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>IM001
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1052"></A>
<P>Driver does not support this function
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1052"></A>
<P>(DM) The driver corresponding to the <I>hstmt</I> does not support the function.</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1000
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1053"></A>
<P>General error
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1053"></A>
<P>An error occurred for which there was no specific SQLSTATE and for which no implementation-specific SQLSTATE was defined. The error message returned by <B>SQLError</B> in the argument <I>szErrorMsg</I> describes the error and its cause.</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1001
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1054"></A>
<P>Memory allocation failure
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1054"></A>
<P>The driver was unable to allocate memory required to support execution or completion of the function.</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1002
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1055"></A>
<P>Invalid column number
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1055"></A>
<P>The value specified for the argument <I>icol</I> was 0 and the driver was an ODBC 1.0 driver.
<BLOCKQUOTE>
<P>The value specified for the argument <I>icol</I> was 0 and <B>SQLFetch</B> was used to fetch the data.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The value specified for the argument <I>icol</I> was 0 and the SQL_USE_BOOKMARKS statement option was set to SQL_UB_OFF.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The specified column was greater than the number of result columns.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The specified column was bound through a call to <B>SQLBindCol</B>. This description does not apply to drivers that return the SQL_GD_BOUND bitmask for the SQL_GETDATA_EXTENSIONS option in <B>SQLGetInfo</B>.</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=86 VALIGN=top ><BR></TD>
<TD WIDTH=120 VALIGN=top ><BR></TD>
<TD WIDTH=246 VALIGN=top >
<BLOCKQUOTE>
<P>The specified column was at or before the last bound column specified through <B>SQLBindCol</B>. This description does not apply to drivers that return the SQL_GD_ANY_COLUMN bitmask for the SQL_GETDATA_EXTENSIONS option in <B>SQLGetInfo</B>.</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=86 VALIGN=top ><BR></TD>
<TD WIDTH=120 VALIGN=top ><BR></TD>
<TD WIDTH=246 VALIGN=top >
<BLOCKQUOTE>
<P>The application has already called <B>SQLGetData</B> for the current row. The column specified in the current call was before the column specified in the preceding call. This description does not apply to drivers that return the SQL_GD_ANY_ORDER bitmask for the SQL_GETDATA_EXTENSIONS option in <B>SQLGetInfo</B>.</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1003
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1056"></A>
<P>Program type out of range
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1056"></A>
<P>(DM) The argument <I>fCType</I> was not a valid data type or SQL_C_DEFAULT.
<BLOCKQUOTE>
<P>The argument <I>icol</I> was 0 and the argument <I>fCType</I> was not SQL_C_BOOKMARK.</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1008
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1057"></A>
<P>Operation canceled
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1057"></A>
<P>Asynchronous processing was enabled for the <I>hstmt</I>. The function was called and before it completed execution, <B>SQLCancel</B> was called on the <I>hstmt</I>. Then the function was called again on the <I>hstmt</I>.
<BLOCKQUOTE>
<P>The function was called and, before it completed execution, <B>SQLCancel</B> was called on the <I>hstmt</I> from a different thread in a multithreaded application.</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1009
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1058"></A>
<P>Invalid argument value
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1058"></A>
<P>(DM) The argument <I>rgbValue</I> was a null pointer.</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1010
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1059"></A>
<P>Function sequence error
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1059"></A>
<P>(DM) The specified <I>hstmt</I> was not in an executed state. The function was called without first calling <B>SQLExecDirect</B>, <B>SQLExecute</B>, or a catalog function.
<BLOCKQUOTE>
<P>(DM) An asynchronously executing function (not this one) was called for the <I>hstmt</I> and was still executing when this function was called.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>(DM) <B>SQLExecute</B>, <B>SQLExecDirect</B>, or <B>SQLSetPos</B> was called for the <I>hstmt</I> and returned SQL_NEED_DATA. This function was called before data was sent for all data-at-execution parameters or columns.</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1090
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1060"></A>
<P>Invalid string or buffer length
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1060"></A>
<P>(DM) The value specified for argument <I>cbValueMax</I> was less than 0.</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1109
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1061"></A>
<P>Invalid cursor position
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1061"></A>
<P>The cursor was positioned (by <B>SQLSetPos</B> or <B>SQLExtendedFetch</B>) on a row for which the value in the <I>rgfRowStatus</I> array in <B>SQLExtendedFetch</B> was SQL_ROW_DELETED or SQL_ROW_ERROR.</TD>
</TR>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1C00
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1062"></A>
<P>Driver not capable
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1062"></A>
<P>The driver or data source does not support use of <B>SQLGetData</B> with multiple rows in <B>SQLExtendedFetch</B>. This description does not apply to drivers that return the SQL_GD_BLOCK bitmask for the SQL_GETDATA_EXTENSIONS option in <B>SQLGetInfo</B>.
<BLOCKQUOTE>
<P>The driver or data source does not support the conversion specified by the combination of the <I>fCType</I> argument and the SQL data type of the corresponding column. This error only applies when the SQL data type of the column was mapped to a driver-specific SQL data type.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The argument <I>icol</I> was 0 and the driver does not support bookmarks.
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>The driver only supports ODBC 1.0 and the argument <I>fCType</I> was one of the following:
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>SQL_C_STINYINT
<BR>SQL_C_UTINYINT
<BR>SQL_C_SSHORT
<BR>SQL_C_USHORT
<BR>SQL_C_SLONG
<BR>SQL_C_ULONG</TD>
</TR>
</BLOCKQUOTE>
<TR>
<TD WIDTH=86 VALIGN=top >
<BLOCKQUOTE>
<P>S1T00
</BLOCKQUOTE></TD>
<TD WIDTH=120 VALIGN=top >
<A NAME="E7E1063"></A>
<P>Timeout expired
</TD><TD WIDTH=246 VALIGN=top >
<A NAME="E7E1063"></A>
<P>The timeout period expired before the data source returned the result set. The timeout period is set through <B>SQLSetStmtOption</B>, SQL_QUERY_TIMEOUT.</TD></TR></TABLE>
<A NAME="E11E215"></A>
<H3>
<FONT FACE="Arial">Comments<A NAME="I76"></A><A NAME="I77"></A><A NAME="I78"></A><A NAME="I79"></A><A NAME="I80"></A><A NAME="I81"></A></FONT></H3>
<BLOCKQUOTE>
<P>With each call, the driver sets <I>pcbValue</I> to the number of bytes that were available in the result column prior to the current call to <B>SQLGetData</B>. (If SQL_MAX_LENGTH has been set with <B>SQLSetStmtOption</B>, and the total number of bytes available on the first call is greater than SQL_MAX_LENGTH, the available number of bytes is set to SQL_MAX_LENGTH. Note that the SQL_MAX_LENGTH statement option is intended to reduce network traffic and may not be supported by all drivers. To guarantee that data is truncated, an application should allocate a buffer of the desired size and specify this size in the <I>cbValueMax</I> argument.) If the total number of bytes in the result column cannot be determined in advance, the driver sets <I>pcbValue</I> to SQL_NO_TOTAL. If the data value for the column is NULL, the driver stores SQL_NULL_DATA in <I>pcbValue</I>.<A NAME="I82"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P><B>SQLGetData</B> can convert data to a different data type. The result and success of the conversion is determined by the rules for assignment specified in "Converting Data from SQL to C Data Types" in Appendix D, "Data Types."<A NAME="I83"></A><A NAME="I84"></A><A NAME="I85"></A><A NAME="I86"></A><A NAME="I87"></A><A NAME="I88"></A><A NAME="I89"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>If more than one call to <B>SQLGetData</B> is required to retrieve data from a single column with a character, binary, or data source–specific data type, the driver returns SQL_SUCCESS_WITH_INFO. A subsequent call to <B>SQLError</B> returns SQLSTATE 01004 (Data truncated). The application can then use the same column number to retrieve subsequent parts of the data until <B>SQLGetData</B> returns SQL_SUCCESS, indicating that all data for the column has been retrieved. <B>SQLGetData</B> will return SQL_NO_DATA_FOUND when it is called for a column after all of the data has been retrieved and before data is retrieved for a subsequent column. The application can ignore excess data by proceeding to the next result column.<A NAME="I90"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<NOTE>Note An application can use <B>SQLGetData</B> to retrieve data from a column in parts only when retrieving character C data from a column with a character,binary, or data source–specific data type or when retrieving binary C data from a column with a character, binary, or data source–specific data type. If <B>SQLGetData</B> is called more than one time in a row for a column under any other conditions, it returns SQL_NO_DATA_FOUND for all calls after the first.<A NAME="I91"></A></NOTE>
<HR ALIGN=CENTER>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>For maximum interoperability, applications should call <B>SQLGetData</B> only for unbound columns with numbers greater than the number of the last bound column. Within a single row of data, the column number in each call to <B>SQLGetData</B> should be greater than or equal to the column number in the previous call (that is, data should be retrieved in increasing order of column number). As extended functionality, drivers can return data through <B>SQLGetData</B> from bound columns, from columns before the last bound column, or from columns in any order. To determine whether a driver supports these extensions, an application calls <B>SQLGetInfo</B> with the SQL_GETDATA_EXTENSIONS option.<A NAME="I92"></A>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>Furthermore, applications that use <B>SQLExtendedFetch</B> to retrieve data should call <B>SQLGetData</B> only when the rowset size is 1. As extended functionality, drivers can return data through <B>SQLGetData</B> when the rowset size is greater than 1. The application calls <B>SQLSetPos</B> to position the cursor on a row and calls <B>SQLGetData</B> to retrieve data from an unbound column. To determine whether a driver supports this extension, an application calls <B>SQLGetInfo</B> with the SQL_GETDATA_EXTENSIONS option.
</BLOCKQUOTE>
<A NAME="E11E216"></A>
<H3>
<FONT FACE="Arial">Code Example<A NAME="I93"></A></FONT></H3>
<BLOCKQUOTE>
<P>In the following example, an application executes a <B>SELECT</B> statement to return a result set of the employee names, ages, and birthdays sorted by birthday, age, and name. For each row of data, it calls <B>SQLFetch</B> to position the cursor to the next row. It calls <B>SQLGetData</B> to retrieve the fetched data; the storage locations for the data and the returned number of bytes are specified in the call to <B>SQLGetData</B>. Finally, it prints each employee’s name, age, and birthday.
</BLOCKQUOTE>
<BLOCKQUOTE>
<PRE>
<FONT FACE="Courier New">#define NAME_LEN 30
#define BDAY_LEN 11
UCHAR szName[NAME_LEN], szBirthday[BDAY_LEN];
SWORD sAge;
SDWORD cbName, cbAge, cbBirthday;
retcode = SQLExecDirect(hstmt,
<BR> "SELECT NAME, AGE, BIRTHDAY FROM EMPLOYEE ORDER BY 3, 2, 1",
<BR> SQL_NTS);
if (retcode == SQL_SUCCESS) {
while (TRUE) {
retcode = SQLFetch(hstmt);
if (retcode == SQL_ERROR || retcode == SQL_SUCCESS_WITH_INFO) {
show_error();
}
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO){
/* Get data for columns 1, 2, and 3 */
/* Print the row of data */
SQLGetData(hstmt, 1, SQL_C_CHAR, szName, NAME_LEN, &cbName);
SQLGetData(hstmt, 2, SQL_C_SSHORT, &sAge, 0, &cbAge);
SQLGetData(hstmt, 3, SQL_C_CHAR, szBirthday, BDAY_LEN,
<BR> &cbBirthday);
fprintf(out, "%-*s %-2d %*s", NAME_LEN-1, szName, sAge,
<BR> BDAY_LEN-1, szBirthday);
} else {
break;
}
}
}</FONT></PRE></BLOCKQUOTE>
<A NAME="E11E217"></A>
<H3>
<FONT FACE="Arial">Related Functions</FONT></H3>
<TABLE WIDTH=800 >
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P><B>For information about</B>
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1064"></A>
<P>See</TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Assigning storage for a column in a result set
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1065"></A>
<P><B>SQLBindCol</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Canceling statement processing
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1066"></A>
<P><B>SQLCancel</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Executing an SQL statement
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1067"></A>
<P><B>SQLExecDirect</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Executing a prepared SQL statement
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1068"></A>
<P><B>SQLExecute</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Fetching a block of data or scrolling through a result set
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1069"></A>
<P><B>SQLExtendedFetch</B> (extension)</TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Fetching a row of data
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1070"></A>
<P><B>SQLFetch</B></TD>
</TR>
<TR>
<TD WIDTH=250 VALIGN=top >
<BLOCKQUOTE>
<P>Sending parameter data at execution time
</BLOCKQUOTE></TD>
<TD WIDTH=202 VALIGN=top >
<A NAME="E7E1071"></A>
<P><B>SQLPutData</B> (extension)</TD></TR></TABLE><P ALIGN=CENTER>
<A HREF="prguid18.htm" TARGET="_self"><IMG SRC="graprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>
<A HREF="httoc.htm" TARGET="_self"><IMG SRC="gratoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>
<A HREF="htindex.htm" TARGET="_self"><IMG SRC="graindex.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Index"></A>
<A HREF="prguid20.htm" TARGET="_self"><IMG SRC="granext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>
<center><p><font SIZE=-2>Copyright © 1992-1997 Solid Information Technology Ltd All rights reserved.</font></p></center>
</BODY></HTML>
|