[Gambas-devel] Support of LONG in database drivers
Andrea Bortolan
andrea_bortolan at ...112...
Tue Nov 15 15:27:42 CET 2005
Hi Benoit,
I'm working on it......just a question about the code you've posted:
in the con_data function there is a duplicate case for the FIELD_TYPE_LONGLONG see the following :
static void conv_data(char *data, GB_VARIANT_VALUE *val, int type, int
len)
{
GB_VALUE conv;
GB_DATE_SERIAL date;
double sec;
switch (type)
{
case FIELD_TYPE_TINY:
if (len == 1)
{
val->_boolean.type = GB_T_BOOLEAN;
/*GB.NumberFromString(GB_NB_READ_INTEGER, data, strlen(data),
&conv);*/
val->_boolean.value = atoi(data) != 0;
}
else
{
GB.NumberFromString(GB_NB_READ_INTEGER, data, strlen(data),
&conv);
val->_integer.type = GB_T_INTEGER;
val->_integer.value = ((GB_INTEGER *)&conv)->value;
}
break;
case FIELD_TYPE_INT24:
case FIELD_TYPE_SHORT:
case FIELD_TYPE_LONG:
/*case FIELD_TYPE_TINY:*/
case FIELD_TYPE_LONGLONG:
case FIELD_TYPE_YEAR:
GB.NumberFromString(GB_NB_READ_INTEGER, data, strlen(data),
&conv);
val->type = GB_T_INTEGER;
val->_integer.value = ((GB_INTEGER *)&conv)->value;
break;
case FIELD_TYPE_LONGLONG:
GB.NumberFromString(GB_NB_READ_LONG, data, strlen(data), &conv);
val->type = GB_T_LONG;
val->_long.value = ((GB_LONG *)&conv)->value;
break;
case FIELD_TYPE_FLOAT:
case FIELD_TYPE_DOUBLE:
case FIELD_TYPE_DECIMAL:
GB.NumberFromString(GB_NB_READ_FLOAT, data, strlen(data), &conv);
val->_float.type = GB_T_FLOAT;
val->_float.value = ((GB_FLOAT *)&conv)->value;
break;
I think that I need also to add the new data type in the table_create function do you agree ?
I hope to have enought time to starting the test on the new datatype tomorrow.
Have a nice day, Andrea.
Coai.
---------------------------------
Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20051115/7f1ebfb2/attachment.html>
More information about the Devel
mailing list