List:MySQL++« Previous MessageNext Message »
From:Shigeya Suzuki Date:July 16 2006 1:06pm
Subject:fixed length char handling/declaration by SSQL
View as plain text  
Hi,

I'm new to mysql++ and trying to figure out how to use this.

One of the code snipped I need to write is store some fixed length
binary data (say, char(16)) and want to handle it efficiently or want to
write it in C+ as easy as possible. In other words, I'd like to store
IPv6 address as column and want to handle it via a class. (I plan to
store it as varchar but actually, whether this is efficient in MySQL
point of view is another question - I have not used MySQL very seriously
till now..)

Say, I want to write, for example,

sql_create_3(AddressToAS,
	     3, 0,
	     unsigned int, ata_id,
	     SOME_CLASS_NAME ata_addr,
	     unsigned int, ata_as);

and, want to use storein(some_vector)...

I understand that it is possible to fetch binary data using
'fetch_lengths' function (according to ML), but since I love power of
SSQLS, I prefer using it if possible. Or, prefer to write or modify some
template to achieve this. I tried to use string but string seems to be
not working well.

I checked mailing list but there are no mention about fixed length
binary as I check. I read reference but no mention about such. I will
read code, but I want to know whether it is possible to write it easily
or not...

Any information appreciated.

shigeya

PS. I didn't know about mysql++ - this library is really good. Actually,
I've tried to write DB independent C++ SQL DB libraries for three times
in last 12 years and always not satisfied with result.. Fortunately I
currently only need to use MySQL for my personal research purpose, so it
perfectly fit to my needs. thanks.
Thread
fixed length char handling/declaration by SSQLShigeya Suzuki16 Jul
  • Re: fixed length char handling/declaration by SSQLWarren Young18 Jul
    • Re: fixed length char handling/declaration by SSQLShigeya Suzuki19 Jul