What is the best way to store bitarray (blob) for pasting in database?
Suliman via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Apr 6 05:56:39 PDT 2016
I have next task.
There is PostgreSQL DB. With field like: id, mydata.
mydata - is binary blob. It can be 10MB or even more.
I need load all data from PostgreSQL to SQLLite.
I decided ti create struct that and fill it with data. And then
do INSERT operation in sqllite.
But I do not know is it's good way, and if it's ok what data type
should I use for blob (binary data).
struct MyData
{
string id;
string mydata; // what datatype I should use here??
}
MyData [] mydata;
MyData md;
while (rs.next())
{
md.id = to!string(rs.getString(1));
md.mydata = to!string(rs.getString(2)); //??
mydata ~= md;
}
....
stmtLite.executeUpdate(`insert into MySyncData(id,mydata)
values(md.id,md.data)`); //ddbc driver
is it's normal way to insert data?
More information about the Digitalmars-d-learn
mailing list