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