Line data Source code
1 : #include "common.h"
2 :
3 : /* Test that a select following a store procedure execution return results */
4 :
5 : int
6 10 : main(void)
7 : {
8 : char output[256];
9 : SQLLEN dataSize;
10 :
11 10 : odbc_connect();
12 :
13 10 : odbc_command_with_result(odbc_stmt, "drop proc sp_norowset_test");
14 :
15 10 : odbc_command("create proc sp_norowset_test as begin declare @i int end");
16 :
17 10 : odbc_command("exec sp_norowset_test");
18 :
19 : /* note, mssql 2005 seems to not return row for tempdb, use always master */
20 10 : odbc_command("select name from master..sysobjects where name = 'sysobjects'");
21 10 : CHKFetch("S");
22 :
23 10 : CHKGetData(1, SQL_C_CHAR, output, sizeof(output), &dataSize, "S");
24 :
25 10 : if (strcmp(output, "sysobjects") != 0) {
26 0 : printf("Unexpected result\n");
27 0 : exit(1);
28 : }
29 :
30 10 : CHKFetch("No");
31 :
32 10 : CHKMoreResults("No");
33 :
34 10 : odbc_command("drop proc sp_norowset_test");
35 :
36 10 : odbc_disconnect();
37 :
38 10 : printf("Done.\n");
39 : return 0;
40 : }
|