Home » Community » Newbie corner » SQL + vector related question
SQL + vector related question [message #39929] |
Sun, 12 May 2013 14:12 |
jerson
Messages: 202 Registered: June 2010 Location: Bombay, India
|
Experienced Member |
|
|
I have the following schema
TABLE_ (TEST)
DATE_ (TESTDATE) SQLDEFAULT(CURRENT_DATE)
STRING_ (REFNO ,50)
STRING_ (PATIENT ,50)
STRING_ (DOCTOR ,50)
BLOB_ (OPCOMMENT)
BLOB_ (DOCCOMMENT)
BLOB_ (DATA)
END_TABLE
and these
Vector<Pointf> LeftSeries[4], // 4 series of 12 points each
RightSeries[4];
Vector<Byte> vb; // holds the above 2 sets of data
This is what I have done
BufferStream dat;
dat % LeftSeries[0]
% LeftSeries[1]
% LeftSeries[2]
% LeftSeries[3]
% RightSeries[0]
% RightSeries[1]
% RightSeries[2]
% RightSeries[3];
vb = dat.GetResult();
SQL * Insert(TEST) (REFNO,AsString(~SaveRecord.edtReference))
(DOCTOR,AsString(~SaveRecord.edtDoctor))
(PATIENT,AsString(~SaveRecord.edtPatientName))
(DOCCOMMENT,AsString(~SaveRecord.edtDocComments))
(OPCOMMENT,AsString(~SaveRecord.edtOpComments))
// ***** This line does not work ***** (DATA,vb);
// This is just to make sure I can put something to the DATA blob (DATA,AsString(~SaveRecord.edtOpComments));
I unroll the data like this
// retrieve the data from the bufferstream and show it
BufferStream dat(vb);
dat % LeftSeries[0]
% LeftSeries[1]
% LeftSeries[2]
% LeftSeries[3]
% RightSeries[0]
% RightSeries[1]
% RightSeries[2]
% RightSeries[3];
Question:
How can I save/retrieve the Vector<Byte> to/from the table? This is the first time ever I'm using sqlite3 and serialization, so please forgive my ignorance.
Regards
Jerson
|
|
|
Goto Forum:
Current Time: Fri May 10 01:31:34 CEST 2024
Total time taken to generate the page: 0.02891 seconds
|