pavan savoy said:
> ---------- 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..
It's certainly possible to cast the object as a void* and insert it as a
blob. That's really somewhat less than desirable though. You might be
happier if you check out http://www.ceamus.com/objbuilder/ which will
create data objects in the Active Record pattern. Currently it generates
C++ objects, but it's a fairly simple matter to convert it to generating C
functions and data structures.
Clay
--
Simple Content Management
http://www.ceamus.com