Files
Digital-Research-Source-Code/CPM OPERATING SYSTEMS/CPM 68K/cpm68k_pgms/sdbas/EXAMPLE.C
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

1 line
768 B
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* -*-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);
}