ex10.c

Example for sqlo_prepare and sqlo_bind_by_pos.

00001 /* $Id: ex10.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 prepare_cursor(sqlo_db_handle_t dbh, double * min_salary)
00007 {
00008   sqlo_stmt_handle_t sth;                      /* statement handle */
00009 
00010   if (0 > (sth = sqlo_prepare(dbh, 
00011                             "SELECT ENAME, SAL FROM EMP WHERE SAL >= :salary ORDER BY 2,1")))
00012     error_exit(dbh, "sqlo_prepare");
00013 
00014   if (SQLO_SUCCESS != 
00015       sqlo_bind_by_pos(sth, 1, SQLOT_FLT, min_salary, sizeof(double), 0, 0))
00016     error_exit(dbh, "sqlo_bind_by_pos");
00017 
00018   return sth;
00019 }
00020 /* $Id: ex10.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