The expected file was wrong earlier
[csql.git] / test / sqlapi / Select / selecttest5.c
blob5063d1fe4f08565d64afa70e6826d2a8eb0c9eb9
1 /* call execute without calling prepare. it should fail.
3 * Author : Jitendra Lenka
4 */
6 #include<AbsSqlStatement.h>
7 #include<SqlFactory.h>
9 int main()
11 DbRetVal rv = OK;
12 AbsSqlConnection *con = SqlFactory :: createConnection(CSql);
13 rv = con->connect("root","manager");
14 if(rv!=OK)return 1;
16 AbsSqlStatement *stmt = SqlFactory :: createStatement(CSql);
17 stmt->setConnection(con);
18 char statement[200];
20 strcpy(statement,"CREATE TABLE T1(F1 INT,F2 INT);");
22 int rows=0;
23 /*rv = stmt->prepare(statement);
24 if(rv!=OK)
26 delete stmt;
27 delete con;
28 return 1;
29 }*/
31 rv = stmt->execute(rows);
32 printf("hello\n");
33 if(rv!=OK)
35 delete stmt;
36 delete con;
37 printf("Execute failed without call prepare\n");
38 return 0;
40 stmt->free();
41 printf("Test script failed\n");
44 delete stmt;
45 delete con;
46 return 1;