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