[sqlite] inserting blob data

2009-03-31 Thread Mayura S.
Hi,
 
I'm using 3.2.2.
I have a binary data in a variable which I want to store as a blob in my 
database table.
I have defined a blob field in my table.
Since this binary data varies in size every time, hence I want to store it as 
blob.
Please let me know how can I insert a blob data using the function - 
sqlite_exec_printf().
 
I also want to later read that data using sqlite_get_table_printf().
 
Can anybody give an example.
Thanks in advance.
 
Regards
Mayura 


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


[sqlite] Table problem

2009-03-22 Thread Mayura S.
Hi,
I've choosen sqlite 3.6.11 for a small purpose in my organisation.
The software runs on a proprietroy OS.
SQLite is used by a single process, there are no other threads using SQLite, 
hence SQLITE_THREADSAFE = 0.
I have written the memory and OS functions.

My Schema table is very simple, as under.
static char    NVDataTable[] =
  "CREATE TABLE  NVDataTable( "
  "iDataId   INTEGER PRIMARY KEY, "
  "iVoidData INTEGER, "
  "iDefaultData  INTEGER,"
  "cStringId VARCHAR(32) DEFAULT '' NOT NULL,"
  "iSize INTEGER, "
  "iReadOnly INTEGER, "
  "iCiphered INTEGER )";

I was able to successfully Open database - using sqlite3_open().
I was able to successfully create table  - using sqlite3_exec().
Ofcourse, I struggled a LOT to achive the above two ...  (even though i had 
worked on 3.2.2 long ago)

I'm NOT able to INSERT a record into the database using - sqlite3_mprintf() and 
sqlite3_exec()
*z = sqlite3_mprintf("INSERT INTO NVDataTable VALUES(NULL, '%d', '%d', \"%s\", 
'%d', '%d', '%d' )", 
    iVoidData, iDefaultData,  stTmp, 1u, iReadOnly, 
iCiphered);
I get a return error as - 1
And, an error message as - [Error:= no such table: NVDataTable ]

I'm not getting any clue.  How do I verify the table after I've created the 
table.
I just need to achive INSERT and SELECT.   
The SELECT is just a simple fetch of record based on id, there are no complex 
or conditional queries.
Please help me.

Thanks in advance.
Mayura S.



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


[sqlite] compilation : undefined symbols.

2009-03-10 Thread Mayura S.
Hello Sir,

I downloaded sqlite 3.6.11 code for my project in my organisation.
I'm not using the amalgamation code.  I'm building the source code files in 
unix environment.

I'm not new to sqlite, I have earlier worked on 3.2.2.
My project need is very simple - to store and read data (persistent data ).
Hence there are no complex/conditional queries or sorting of any kind.

I'm building the code with following switches, hence scaling down Sqlite as 
much as possible to cater only store and read data.

-DSQLITE_OS_OTHER=1
-DSQLITE_THREADSAFE=0
-DSQLITE_TEMP_STORE=3
-DSQLITE_OMIT_AUTHORIZATION
-DSQLITE_OMIT_AUTOINIT
-DSQLITE_OMIT_BETWEEN_OPTIMIZATION
-DSQLITE_OMIT_BLOB_LITERAL
-DSQLITE_OMIT_BUILTIN_TEST
-DSQLITE_OMIT_CHECK
-DSQLITE_OMIT_COMPLETE
-DSQLITE_OMIT_DATETIME_FUNCS
-DSQLITE_OMIT_DECLTYPE
-DSQLITE_OMIT_DEPRECATED
-DSQLITE_OMIT_FLAG_PRAGMAS
-DSQLITE_OMIT_FLOATING_POINT
-DSQLITE_OMIT_GET_TABLE
-DSQLITE_OMIT_INCRBLOB
-DSQLITE_OMIT_INTEGRITY_CHECK
-DSQLITE_OMIT_LIKE_OPTIMIZATION
-DSQLITE_OMIT_LOAD_EXTENSION
-DSQLITE_OMIT_LOCALTIME
-DSQLITE_OMIT_PAGER_PRAGMAS
-DSQLITE_OMIT_PROGRESS_CALLBACK
-DSQLITE_OMIT_SCHEMA_PRAGMAS
-DSQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
-DSQLITE_OMIT_SHARED_CACHE
-DSQLITE_OMIT_SUBQUERY
-DSQLITE_OMIT_TCL_VARIABLE
-DSQLITE_OMIT_TRACE
-DSQLITE_OMIT_TRUNCATE_OPTIMIZATION
-DSQLITE_OMIT_UTF16
-DSQLITE_OMIT_XFER_OPT
-DSQLITE_OMIT_ALTERTABLE
-DSQLITE_OMIT_ANALYZE
-DSQLITE_OMIT_ATTACH
-DSQLITE_OMIT_AUTOINCREMENT
-DSQLITE_OMIT_AUTOVACUUM
-DSQLITE_OMIT_CAST
-DSQLITE_OMIT_COMPOUND_SELECT
-DSQLITE_OMIT_CONFLICT_CLAUSE
-DSQLITE_OMIT_EXPLAIN
-DSQLITE_OMIT_FOREIGN_KEY
-DSQLITE_OMIT_PRAGMA
-DSQLITE_OMIT_REINDEX
-DSQLITE_OMIT_TEMPDB
-DSQLITE_OMIT_VACUUM
-DSQLITE_OMIT_VIEW
-DSQLITE_OMIT_VIRTUALTABLE
-DSQLITE_SYSTEM_MALLOC


... but I'm  getting the following symbols as Undefined.

Error: L6218E: Undefined symbol sqlite3CreateView (referred from sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3Vacuum (referred from sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3Pragma (referred from sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3Attach (referred from sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3Detach (referred from sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3Reindex (referred from sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3Analyze (referred from sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3AlterRenameTable (referred from 
sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3AlterFinishAddColumn (referred from 
sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3AlterBeginAddColumn (referred from 
sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3VtabFinishParse (referred from 
sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3VtabBeginParse (referred from 
sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3VtabArgInit (referred from sqlite.ptl).
Error: L6218E: Undefined symbol sqlite3VtabArgExtend (referred from sqlite.ptl)


The above symbols are not available in the '#else' code of any compiler switch. 
Most of the compiler switch do not have any '#else' code.
Please guide me on resolving these symbols.  All the above symbols are used in 
parse.c file.
I believe parse.c is a generated file.  
Should I make changes in parse.c file ? OR
Should I stub those symbols in '#else' code ?

Thanks in advance.
Mayura


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