Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 29 lines (21 sloc) 0.548 kb
d34df440 » Robert Hickman (Hessiess)
2010-12-15 initial commit
1 #include <unistd.h>
2 #include <sqlite3.h>
3 #include <stdio.h>
4
f097226f » Robert Hickman (Hessiess)
2010-12-19 fixed segfault bug
5 #include "src/sqlite_wrapper.h"
d34df440 » Robert Hickman (Hessiess)
2010-12-15 initial commit
6
7 sqlite3 *db;
8 int rc;
9
10 int main()
11 {
f097226f » Robert Hickman (Hessiess)
2010-12-19 fixed segfault bug
12 sqlite_wrapper__init(&db, "test.sqlite");
d34df440 » Robert Hickman (Hessiess)
2010-12-15 initial commit
13
f097226f » Robert Hickman (Hessiess)
2010-12-19 fixed segfault bug
14 sw_result_set *result = sqlite_wrapper__execute(db,
15 "select * from stocks where go_check = 1");
d34df440 » Robert Hickman (Hessiess)
2010-12-15 initial commit
16
17 if(sw_result_set__check_error(result) == 1)
18 printf(sw_result_set__get_error_msg(result));
f097226f » Robert Hickman (Hessiess)
2010-12-19 fixed segfault bug
19 else
20 {
21 printf(sw_result_set__get_value(result, "id", 0));
22 }
d34df440 » Robert Hickman (Hessiess)
2010-12-15 initial commit
23
24 printf("\n");
25
26 sw_result_set__delete(result);
27
28 sqlite3_close(db);
29 }
Something went wrong with that request. Please try again.