Update of /cvsroot/monetdb/clients/src/examples/C
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4807/C

Modified Files:
        sample0.c sample1.c sample2.c sample3.c sample4.c 
Log Message:
made versions for m5


Index: sample2.c
===================================================================
RCS file: /cvsroot/monetdb/clients/src/examples/C/sample2.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- sample2.c   3 Oct 2007 13:56:13 -0000       1.4
+++ sample2.c   24 Oct 2007 08:37:57 -0000      1.5
@@ -68,6 +68,17 @@
                        die(dbh, hdl);
                if ((hdl = mapi_query(dbh, "select * from emp")) == NULL || 
mapi_error(dbh))
                        die(dbh, hdl);
+       } else if (strcmp(argv[3], "mal") == 0) {
+               if ((hdl = mapi_query(dbh, "emp := bat.new(:str,:int);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query_array(dbh, "bat.insert(emp,\"?\",?);", 
parm)) == NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL || 
mapi_error(dbh))
+                       die(dbh, hdl);
        } else {
                if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL 
|| mapi_error(dbh))
                        die(dbh, hdl);

Index: sample0.c
===================================================================
RCS file: /cvsroot/monetdb/clients/src/examples/C/sample0.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- sample0.c   3 Oct 2007 13:56:12 -0000       1.4
+++ sample0.c   24 Oct 2007 08:37:57 -0000      1.5
@@ -39,14 +39,13 @@
 {
        Mapi dbh= NULL;
        MapiHdl hdl= NULL;
-       int sqltest = 0;
 
        if (argc != 4) {
                printf("usage:%s <host> <port> <language>\n", argv[0]);
                exit(-1);
        }
 
-       printf("# Start %s test on %s\n", sqltest ? "sql" : "mil", argv[1]);
+       printf("# Start %s test on %s\n", argv[3], argv[1]);
        dbh = mapi_connect(argv[1], atoi(argv[2]), "monetdb", "monetdb", 
argv[3], NULL);
        if (dbh == NULL || mapi_error(dbh))
                die(dbh, hdl);
@@ -70,6 +69,21 @@
                        die(dbh, hdl);
                if ((hdl = mapi_query(dbh, "select * from emp")) == NULL || 
mapi_error(dbh))
                        die(dbh, hdl);
+       } else if (strcmp(argv[3], "mal") == 0) {
+               if ((hdl = mapi_query(dbh, "emp := bat.new(:str,:int);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "bat.insert(emp,\"John\",23);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "bat.insert(emp,\"Mary\",22);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL || 
mapi_error(dbh))
+                       die(dbh, hdl);
        } else {
                if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL 
|| mapi_error(dbh))
                        die(dbh, hdl);

Index: sample3.c
===================================================================
RCS file: /cvsroot/monetdb/clients/src/examples/C/sample3.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- sample3.c   3 Oct 2007 13:56:14 -0000       1.4
+++ sample3.c   24 Oct 2007 08:37:57 -0000      1.5
@@ -69,6 +69,21 @@
                        die(dbh, hdl);
                if ((hdl = mapi_query(dbh, "select * from emp")) == NULL || 
mapi_error(dbh))
                        die(dbh, hdl);
+       } else if (strcmp(argv[3], "mal") == 0) {
+               if ((hdl = mapi_query(dbh, "emp := bat.new(:str,:int);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "bat.insert(emp,\"John\",23);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "bat.insert(emp,\"Mary\",22);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL || 
mapi_error(dbh))
+                       die(dbh, hdl);
        } else {
                if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL 
|| mapi_error(dbh))
                        die(dbh, hdl);

Index: sample4.c
===================================================================
RCS file: /cvsroot/monetdb/clients/src/examples/C/sample4.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- sample4.c   3 Oct 2007 13:56:14 -0000       1.4
+++ sample4.c   24 Oct 2007 08:37:57 -0000      1.5
@@ -71,6 +71,21 @@
                        die(dbh, hdl);
                if ((hdl = mapi_query(dbh, "select * from emp")) == NULL || 
mapi_error(dbh))
                        die(dbh, hdl);
+       } else if (strcmp(argv[3], "mal") == 0) {
+               if ((hdl = mapi_query(dbh, "emp := bat.new(:str,:int);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "bat.insert(emp,\"John\",23);")) == 
NULL)
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "bat.insert(emp,\"Mary\",22);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL || 
mapi_error(dbh))
+                       die(dbh, hdl);
        } else {
                if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL 
|| mapi_error(dbh))
                        die(dbh, hdl);

Index: sample1.c
===================================================================
RCS file: /cvsroot/monetdb/clients/src/examples/C/sample1.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- sample1.c   3 Oct 2007 13:56:12 -0000       1.4
+++ sample1.c   24 Oct 2007 08:37:57 -0000      1.5
@@ -69,6 +69,21 @@
                        die(dbh, hdl);
                if ((hdl = mapi_query(dbh, "select * from emp")) == NULL || 
mapi_error(dbh))
                        die(dbh, hdl);
+       } else if (strcmp(argv[3], "mal") == 0) {
+               if ((hdl = mapi_query(dbh, "emp := bat.new(:str,:int);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "bat.insert(emp, \"John\",23);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "bat.insert(emp, \"Mary\",22);")) == 
NULL || mapi_error(dbh))
+                       die(dbh, hdl);
+               if (mapi_close_handle(hdl) != MOK)
+                       die(dbh, hdl);
+               if ((hdl = mapi_query(dbh, "io.print(emp);")) == NULL || 
mapi_error(dbh))
+                       die(dbh, hdl);
        } else {
                if ((hdl = mapi_query(dbh, "var emp:= new(str,int);")) == NULL 
|| mapi_error(dbh))
                        die(dbh, hdl);


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to