Line data Source code
1 : /* test SQLGetDescRec */
2 : #include "common.h"
3 :
4 : static char software_version[] = "$Id: descrec.c,v 1.3 2011-07-12 10:16:59 freddy77 Exp $";
5 : static void *no_unused_var_warn[] = { software_version, no_unused_var_warn };
6 :
7 10 : TEST_MAIN()
8 : {
9 : SQLHDESC Descriptor;
10 : SQLINTEGER ind;
11 : SQLTCHAR name[128];
12 : SQLSMALLINT si;
13 :
14 10 : odbc_use_version3 = 1;
15 10 : odbc_connect();
16 :
17 10 : odbc_command("create table #tmp1 (i int)");
18 :
19 : /* get IRD */
20 10 : CHKGetStmtAttr(SQL_ATTR_IMP_ROW_DESC, &Descriptor, sizeof(Descriptor), &ind, "S");
21 :
22 10 : CHKGetDescRec(-1, name, TDS_VECTOR_SIZE(name), &si, NULL, NULL, NULL, NULL, NULL, NULL, "E");
23 : /* TODO here should be NO_DATA cause we are requesting bookmark */
24 : /* CHKGetDescRec(0, name, sizeof(name), &si, NULL, NULL, NULL, NULL, NULL, NULL, "No"); */
25 10 : CHKGetDescRec(1, name, TDS_VECTOR_SIZE(name), &si, NULL /*Type*/, NULL /*SubType*/, NULL /*Length*/, NULL/*Precision*/,
26 : NULL /*Scale*/, NULL /*Nullable*/, "No");
27 :
28 10 : odbc_command("SELECT name FROM sysobjects");
29 :
30 10 : CHKGetDescRec(1, name, TDS_VECTOR_SIZE(name), &si, NULL /*Type*/, NULL /*SubType*/, NULL /*Length*/, NULL/*Precision*/,
31 : NULL /*Scale*/, NULL /*Nullable*/, "S");
32 :
33 10 : odbc_disconnect();
34 10 : ODBC_FREE();
35 10 : return 0;
36 : }
37 :
|