Hello Atul_Vaidya,

Tuesday, September 8, 2009, 4:08:50 AM, you wrote:

A> It would be great if i can refer to any example for this
A> Regards,
A> Atul

A> Michal Seliga wrote:
>> 
>> Atul_Vaidya wrote:
>>> Hi,
>>>     How to store a multimap in SQlite database ?
>>> My requirement is that i want to store a multimap<int,long> in a column
>>> of
>>> the SQlite table
>>> Regards,
>>> Atul
>> 
>> but you have to use some additional
>> encoding (base64, bintohex, uuencode/uudecode, whatever you want) to make
>> sure
>> that stored text is pure ASCII and content won't be damaged
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
>> 

It's really not much different than writing it to a flat file. Just
write a wrapper around the sqlite calls that you pass your map too,
enum the map, insert the values in a 2 column integer table and then
have another function that enumerates the table and re-constructs the
map entries when you want to load it back up again. You can go the
streaming route but, why bother? I don't see the point of streaming
for something really basic like this. Assuming both integers together
represent the "key" to the map, I'd "primary key" over both values.

Are you planning on querying for values through SQLITE or are you just
using it for persistent storage? If it's just for storage then it's
really easy.

-- 
Best regards,
 Teg                            mailto:t...@djii.com

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

Reply via email to