adding test scripts
[csql.git] / test / adapter / Select / selecttest5.c
blobcabbfc85d596492878284ba138eb77dbea87342d
1 /* call execute without calling prepare. it should fail.
2 */
4 #include "common.h"
5 int main()
7 DbRetVal rv = OK;
8 AbsSqlConnection *con = createConnection();
9 rv = con->connect("root","manager");
10 if(rv!=OK)return 1;
12 AbsSqlStatement *stmt = createStatement();
13 stmt->setConnection(con);
14 char statement[200];
16 strcpy(statement,"CREATE TABLE t1(f1 INT,f2 INT);");
17 if(strcmp(getenv("DSN"),"db2")==0)
18 strcpy(statement,"CREATE TABLE t1(f1 INT,f2 INT)");
20 int rows=0;
21 /*rv = stmt->prepare(statement);
22 if(rv!=OK)
24 delete stmt;
25 delete con;
26 return 1;
27 }*/
29 rv = stmt->execute(rows);
31 if(rv!=OK)
33 delete stmt;
34 delete con;
35 printf("Test script passed\n");
36 return 0;
38 stmt->free();
39 printf("Test script failed\n");
42 delete stmt;
43 delete con;
44 return 1;