ex5.c

Example for using sqlo_open2

00001 /* $Id: ex5.c 221 2002-08-24 12:54:47Z kpoitschke $ */
00002 #include <stdio.h>
00003 #include <stdlib.h>
00004 #include "examples.h"
00005 
00006 sqlo_stmt_handle_t open_cursor2(sqlo_db_handle_t dbh, double min_income)
00007 {
00008   sqlo_stmt_handle_t sth = SQLO_STH_INIT;
00009   int argc = 0;
00010   const char * argv[1];
00011   char hlp[64];
00012 
00013   sprintf(hlp, "%f", min_income);
00014 
00015   argv[argc++] = hlp;
00016 
00017   if ( 0 > (sqlo_open2(&sth, dbh, 
00018                        "SELECT ENAME, SAL FROM EMP WHERE SAL >= :1", 
00019                        argc, argv))) {
00020     error_exit(dbh, "sqlo_open");
00021   }
00022 
00023   return sth;
00024 }
00025 /* $Id: ex5.c 221 2002-08-24 12:54:47Z kpoitschke $ */

Generated on Mon May 21 13:43:28 2007 for libsqlora8 by  doxygen 1.4.7