Hi,
yes, you could use a blob (binary lagre object):
create table tab (MyData blob);
then use sqlite3_prepare() to prepare an insert statement and bind your
structure using sqlite3_bind_blob().
To retrieve the data, use sqlite3_column_blob() on your result set.
These functions are documented here: http://www.sqlite.org/capi3ref.html
However, to do this i always create a text representation of my binary
data (perhaps XML or some tab-delimited string) to store, so i can check
if my program works right. If you store your binary data and then move
the database to another machine, you might have problems with byte
ordering, variable sizes etc.
Hope this helps,
Martin
pavan savoy schrieb:
---------- Forwarded message ----------
From: pavan savoy <[EMAIL PROTECTED]>
Date: Feb 8, 2006 5:22 PM
Subject: Help regarding insertion into database
To: [EMAIL PROTECTED]
Hi,
Inside C program I have a structure and want to store it into a
database, isnt there any datatype where I could just mention this many
number of bytes starting from this address...
specifically I want to store a struct s { int a; char b[16]}; directly
without having to create table tab(a integer, b varchar2); ....
cant I just have create table tab(data binary);
insert into tab(&s1);
insert into tab(&s2); ..... etc..
may sound like a newbie question ... pls excuse