ex8.c

Example for using sqlo_exec.

00001 /* $Id: ex8.c 221 2002-08-24 12:54:47Z kpoitschke $ */
00002 #include <stdio.h>
00003 #include <stdlib.h>
00004 #include "examples.h"
00005 
00006 int update_emp(sqlo_db_handle_t dbh, double factor, const char * job)
00007 {
00008   int stat;
00009   char stmt[1024];
00010 
00011   sprintf(stmt, "UPDATE EMP SET SAL = SAL * %f WHERE JOB = '%s'",
00012           factor, job);
00013 
00014   if ( 0 > (stat = sqlo_exec(dbh, stmt)))
00015     error_exit(dbh, "sqlo_run");
00016 
00017   return stat;                  /* number of processed rows */
00018 }
00019 
00020 /* $Id: ex8.c 221 2002-08-24 12:54:47Z kpoitschke $ */
00021 

Generated on Mon May 21 13:42:17 2007 for libsqlora8 by  doxygen 1.4.7