Diffstat (limited to 'examples/opiedb/sqltest/spaltenweise.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | examples/opiedb/sqltest/spaltenweise.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/examples/opiedb/sqltest/spaltenweise.cpp b/examples/opiedb/sqltest/spaltenweise.cpp new file mode 100644 index 0000000..c11724c --- a/dev/null +++ b/examples/opiedb/sqltest/spaltenweise.cpp | |||
@@ -0,0 +1,43 @@ | |||
1 | #include <qdir.h> | ||
2 | |||
3 | #include <qpe/qpeapplication.h> | ||
4 | #include <opie2/osqlmanager.h> | ||
5 | #include <opie2/osqlquery.h> | ||
6 | #include <opie2/osqldriver.h> | ||
7 | #include <opie2/osqlresult.h> | ||
8 | |||
9 | using namespace Opie::DB; | ||
10 | |||
11 | int main( int argc, char* argv[] ) { | ||
12 | |||
13 | QPEApplication app( argc, argv ); | ||
14 | OSQLManager man; | ||
15 | man.registerPath( QDir::currentDirPath() ); | ||
16 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | ||
17 | |||
18 | OSQLDriver *driver = man.standard(); | ||
19 | owarn << "testmain" + driver->id() << oendl; | ||
20 | driver->setUrl("/home/ich/spaltenweise"); | ||
21 | if ( driver->open() ) { | ||
22 | owarn << "could open" << oendl; | ||
23 | }else | ||
24 | owarn << "wasn't able to open" << oendl; | ||
25 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(" | ||
26 | "uid,categories,completed," | ||
27 | "progress,summary,HasDate," | ||
28 | "DateDay,DateMonth,DateYear," | ||
29 | "priority,description)" ); | ||
30 | |||
31 | OSQLResult res = driver->query( raw ); | ||
32 | delete raw; | ||
33 | for (int i = 0; i< 10000; i++ ) { | ||
34 | int uid = i; | ||
35 | OSQLRawQuery raw("insert into todolist VALUES("+ | ||
36 | QString::number(uid)+ ",'-122324;-12132',1,100,"+ | ||
37 | "'Summary234-"+QString::number(uid)+"',1,5,8,2002,1,"+ | ||
38 | "'Description\n12344')"); | ||
39 | OSQLResult res = driver->query( &raw ); | ||
40 | |||
41 | } | ||
42 | return 0; | ||
43 | }; | ||