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 : int
8 8 : main(void)
9 : {
10 : SQLHDESC Descriptor;
11 : SQLINTEGER ind;
12 : SQLTCHAR name[128];
13 : SQLSMALLINT si;
14 :
15 8 : odbc_use_version3 = 1;
16 8 : odbc_connect();
17 :
18 8 : odbc_command("create table #tmp1 (i int)");
19 :
20 : /* get IRD */
21 8 : CHKGetStmtAttr(SQL_ATTR_IMP_ROW_DESC, &Descriptor, sizeof(Descriptor), &ind, "S");
22 :
23 8 : CHKGetDescRec(-1, name, TDS_VECTOR_SIZE(name), &si, NULL, NULL, NULL, NULL, NULL, NULL, "E");
24 : /* TODO here should be NO_DATA cause we are requesting bookmark */
25 : /* CHKGetDescRec(0, name, sizeof(name), &si, NULL, NULL, NULL, NULL, NULL, NULL, "No"); */
26 8 : CHKGetDescRec(1, name, TDS_VECTOR_SIZE(name), &si, NULL /*Type*/, NULL /*SubType*/, NULL /*Length*/, NULL/*Precision*/,
27 : NULL /*Scale*/, NULL /*Nullable*/, "No");
28 :
29 8 : odbc_command("SELECT name FROM sysobjects");
30 :
31 8 : CHKGetDescRec(1, name, TDS_VECTOR_SIZE(name), &si, NULL /*Type*/, NULL /*SubType*/, NULL /*Length*/, NULL/*Precision*/,
32 : NULL /*Scale*/, NULL /*Nullable*/, "S");
33 :
34 8 : odbc_disconnect();
35 8 : ODBC_FREE();
36 : return 0;
37 : }
38 :
|