FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
March 01, 2004

The SQLite Database Engine

(Page 5 of 10)
March 04:

Listing 4: Using a custom function.

int main(int argc, char **argv)
{
   sqlite *db;

const char *tail; sqlite_vm *pvm; char *err_msg; int ncols; const char** fields; const char** col_defs; db = sqlite_open("db", 0, &err_msg); sqlite_create_function(db, "normal_curve_area", 4, normal_curve_area, NULL); const char* sql = "select normal_curve_area(-2.35, 2.35, 0, 1)"; sqlite_compile(db, sql, &tail, &pvm, &err_msg); sqlite_step(pvm, &ncols, &fields, &col_defs); printf("Area=%s\n", fields[0]); sqlite_finalize(pvm, &err_msg); sqlite_close(db); return 0; }

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK