mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-23 08:24:18 +00:00
1 line
768 B
C
1 line
768 B
C
/* -*-c,save-*- */
|
||
|
||
/*
|
||
|
||
* example.c - test prog
|
||
|
||
* Robert Heller. Created: Sun Oct 26, 1986 01:14:27.13
|
||
|
||
* Last Mod:
|
||
|
||
*
|
||
|
||
*/
|
||
|
||
#include <stdio.h>
|
||
|
||
#include "sdb.h"
|
||
|
||
|
||
|
||
main()
|
||
|
||
{
|
||
|
||
DB_SEL *sptr;
|
||
|
||
char payee[100], amount[100];
|
||
|
||
|
||
|
||
/* setup retrieval */
|
||
|
||
if ((sptr = db_retrieve("checks where amount > 25.00")) == NULL) {
|
||
|
||
db_perror("example (checks)");
|
||
|
||
exit();
|
||
|
||
}
|
||
|
||
|
||
|
||
/* bind user varianbles to attributes */
|
||
|
||
db_bind(sptr,"checks","payee",payee);
|
||
|
||
db_bind(sptr,"checks","amount",amount);
|
||
|
||
|
||
|
||
/* loop through selection */
|
||
|
||
while (db_fetch(sptr))
|
||
|
||
printf("%s\t%s\n",payee,amount);
|
||
|
||
|
||
|
||
/* finish selection */
|
||
|
||
db_done(sptr);
|
||
|
||
}
|
||
|
||
|