guy12 wrote:
i need to insert hex values in the data base and after that i have to select
them again ...

what's the best way for doing that ??

i first used INTERGER for that but i think that is the wrong way...

p.s. i need to accress the db through my c-code
You have a couple of choices.

First you could store your values in sqlite as strings of hex digits. You could use code like this to convert a number to a string in s containing the hex digits that represent that number.

char s[10];
sprintf(s, "%0X", number)

Then you can insert that string into a text column in sqlite.

You would retrieve the same string from sqlite using a select statement and then convert it back to a number using strtoul(s, NULL, 16) if necessary.

Alternatively, you could store the values in sqlite as integers (as you seem to have tried). If you have the hex digits of the number in a string use strtoul(hex_digits, NULL, 16) to convert them to an integer and save that integer in sqlite. Then after you retrieve the integer form sqlite, you can convert it back to a string of hex digits using sprintf as shown above.

The "best" format to use really depends on how you get the information, and how you want to process and display it.

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to