Originally Posted by
girldemsuga
Are you saying that oracle somehow can have a database contained within a single file like access as i would not need to install the oracle server if i'm developing a simple application for a client?
No. You do need to install a database server as well as the client.
SQLite seems to be what you're looking for. It comes with C/C++ and TCL interfaces to easily connect and execute statements. sqlite3_open() sqlite3_exec() and sqlite3_close() would be the functions to pay attention to. I was able to download and connect and run a couple statements in minutes. Unfortunately I don't have a C/C++ compiler on my machine so I couldn't get to compile the sample code they had.
Code:
#include <stdio.h>
#include <sqlite3.h>
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
int i;
for(i=0; i<argc; i++){
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
printf("\n");
return 0;
}
int main(int argc, char **argv){
sqlite3 *db;
char *zErrMsg = 0;
int rc;
if( argc!=3 ){
fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENT\n", argv[0]);
exit(1);
}
rc = sqlite3_open(argv[1], &db);
if( rc ){
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
}
rc = sqlite3_exec(db, argv[2], callback, 0, &zErrMsg);
if( rc!=SQLITE_OK ){
fprintf(stderr, "SQL error: %s\n", zErrMsg);
sqlite3_free(zErrMsg);
}
sqlite3_close(db);
return 0;
}
Read through the documentation for details.