Re: [sqlite] Very large database

2008-03-13 Thread sswensen
Thanks you solved my problem. I was passing null instead of 0 to open_v2. I had 
looked at the source before but it did not click. Also I had 3 routines in my 
app each opening the database, doing some work then closing. The first routine 
using sqlite3_exec the second sqlite_open/prep/step the third routine did 
sqlite3_open_v2/prep_v2/step. I think mixing these in a single c executable 
contributed to the problem.

Sincerely,
Severin Swensen
Data Engineering Dept.
Epsilon, Inc.



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Cote
Sent: Thursday, March 13, 2008 10:10 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Very large database

[EMAIL PROTECTED] wrote:
> Is there any reason why a database of >20GiB would have problems
> being  opened with sqlite3_open_v2 or have issues with sqlite3_prepare_v2.

No, not really. They oth call the same function to do the work. The
following is from the SQLite source:

/*
** Open a new database handle.
*/
int sqlite3_open(
   const char *zFilename,
   sqlite3 **ppDb
){
   return openDatabase(zFilename, ppDb,
   SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
}
int sqlite3_open_v2(
   const char *filename,   /* Database filename (UTF-8) */
   sqlite3 **ppDb, /* OUT: SQLite db handle */
   int flags,  /* Flags */
   const char *zVfs/* Name of VFS module to use */
){
   return openDatabase(filename, ppDb, flags, zVfs);
}

The only difference may be the flags the user provides to the
sqlite3_open_v2() call. If you use the same flags as used by
sqlite3_open() it would be identical.

Similarly , the sqlite3_prepare() and the v2 function use the same
subroutine to do the work.

int sqlite3_prepare(
   sqlite3 *db,  /* Database handle. */
   const char *zSql, /* UTF-8 encoded SQL statement. */
   int nBytes,   /* Length of zSql in bytes. */
   sqlite3_stmt **ppStmt,/* OUT: A pointer to the prepared statement */
   const char **pzTail   /* OUT: End of parsed string */
){
   int rc;
   rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,ppStmt,pzTail);
   assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 );  /* VERIFY: F13021 */
   return rc;
}
int sqlite3_prepare_v2(
   sqlite3 *db,  /* Database handle. */
   const char *zSql, /* UTF-8 encoded SQL statement. */
   int nBytes,   /* Length of zSql in bytes. */
   sqlite3_stmt **ppStmt,/* OUT: A pointer to the prepared statement */
   const char **pzTail   /* OUT: End of parsed string */
){
   int rc;
   rc = sqlite3LockAndPrepare(db,zSql,nBytes,1,ppStmt,pzTail);
   assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 );  /* VERIFY: F13021 */
   return rc;
}

In this case the fourth argument tells the function to save the SQL so
it can be recompiled later if need be.

What kind of problems are you having? Can you be more specific.

HTH
Dennis Cote
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Very large database

2008-03-12 Thread sswensen

Is there any reason why a database of >20GiB would have problems being opened 
with sqlite3_open_v2 or have issues with sqlite3_prepare_v2.
I am running on a RHEL 5 x86_64 server.

Accessing the database via the legacy open and prepare functions works fine as 
well as the exec function.

The database contains a single table with 4 integer keys and a 1300 byte string 
column.

Thanks,
Severin Swensen

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users