· 7 years ago · Feb 25, 2019, 10:42 AM
1int main(int argc, char** args)
2{
3
4 sqlite3* connection;
5 sqlite3_stmt *statement = NULL;
6
7 int temp=1;
8 char input[22];
9 char* tmp;
10 char prikaz2 [100];
11
12 if(argc==2)
13 {
14 temp = sqlite3_open(args[1], &connection);
15
16
17 if (temp==SQLITE_ERROR)
18 {
19
20 fprintf(stderr, "CHYBA: Nepodarilo sa otvotir databazu. \n" );
21 sqlite3_close(connection);
22 return 1;
23 }
24
25 temp = sqlite3_exec(connection, "CREATE TABLE IF NOT EXISTS database (name TEXT, value INTEGER);", 0, 0, 0);
26
27 }
28 else
29 {
30
31 fprintf(stderr, "CHYBA: Zly pocet vstupnych parametrov. \n" );
32 return 1;
33 }