From: Carlos G.A. <car...@ho...> - 2002-06-21 16:55:14
|
Hello: If you have in Interbase/Firebird a table like this: create table DECIMAL_TEST( codigo char(3), importe decimal( 18,5 ) ); And you make this in visual foxpro: local lnHConn lnHConn = sqlconnect( "nombre_conexion" ) sqlexec( lnHConn, "select sum(importe) from DECIMAL_TEST", "TEST" ) The cursor "TEST" have a field character(20) because Visual Foxpro converts SQL_BIGINT ( the datatype returned for the driver for the field when it have to return SQL_DECIMAL ) to character, my fix solve this and with it the field is numeric. Best Regards Carlos Guzmán Álvarez >From: "B. Schulte" <sc...@de...> >To: fir...@li... >Subject: [Firebird-odbc-devel] RE: DECIMAL fields AND Visual Foxpro >Date: Fri, 21 Jun 2002 18:19:54 +0200 > >Hi, > >I'm sorry, but I can't reproduce this behaviour. >By the way: the are is real DECIMAL-type in FireBird. It is internally >converted to NUMERIC or DOUBLE (and also shown as this). >maybe you can tell me step by step what you did. >I remember that I saw this kind of error also with the 5.6-odbc-driver, >that came with the first release for Interbase 6.0. >Maybe this is a FoxPro-specific problem (maybe not definitively) > > B. Schulte > > > > > > > Hello: > > > > > > In visual foxpro when you execute a Statement with sqlexec like this: > > sqlexec( gnHConn,"SELECT SUM(field) FROM TABLE", "CURSOR") > > if the field in the sum is a DECIMAL field in Firebird, Visual Foxpro > > converts it in Character because the driver returns JDBC_BIGINT as > > column type i have a little fix for this issue and return JDBC_DECIMAL > > instead of SQL_BIGINT for DECIMAL FIELDS( i ´m very pleased if any can > > confirm to me that this fix is correct ): > > > > > > Sqlda.h: > > > > Change: > > static int getSqlType (int iscType, int subType); > > static const char* getSqlTypeName (int iscType, int subType); > > to : > > > > static int getSqlType (int iscType, int subType, int sqlScale); > > static const char* getSqlTypeName (int iscType, int subType, int > > sqlScale); > > > > > > > >------------------------------------------------------- >Sponsored by: >ThinkGeek at http://www.ThinkGeek.com/ >_______________________________________________ >Firebird-odbc-devel mailing list >Fir...@li... >https://lists.sourceforge.net/lists/listinfo/firebird-odbc-devel _________________________________________________________________ MSN Photos es la manera más sencilla de compartir e imprimir sus fotos: http://photos.msn.com/support/worldwide.aspx |