Steve Frierdich said: > Anyone know of any links or have example on how to create a stored > procedure and how to use that stored procedure in code on a sqlite > database?
Steve, We're happy to help people out here, but we would appreciate it if you could read some of our responses before re-asking the same question. As to how to store your scripts in a file and make use of them in sqlite, the following code is close, although not fully checked. char* buffer; struct stat sb; FILE* in; char* sql; sqlite3_stmt* stmt; sqlite3* db; if (stat("file.sql", &sb)) return EXIT_FAILURE; in = fopen("file.sql", "r"); if (!in) return EXIT_FAILURE; buffer = (char*)calloc(1, sb.st_size + 1); fread((void*)buffer, 1, sb.st_size, in); fclose(in); sql = buffer; while(sql) { /* check the parameter order on this, I'm winging it */ sqlite3_prepare(db, sql, strlen(sql), &sql, &stmt); while(sqlite3_step(stmt) != SQLITE_DONE); sqlite3_finalize(stmt); } free(buffer); This is completely off the top of my head, and of course may not address your particular needs. But you've got the file reading and the continuous processing of the SQL statements until they're completed. That should be a good start to get you going. If you're using another language you'll have to do the translation yourself. Clay Dowling -- Lazarus Notes from Lazarus Internet Development http://www.lazarusid.com/notes/ Articles, Reviews and Commentary on web development