New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ODBC v 2.0.0151 returns wrong type of colum in calculated field. [ODBC133] #130
Comments
Commented by: Gregori Arjona (garjona) ODBC trace |
Modified by: Gregori Arjona (garjona)Attachment: SQL3.LOG [ 12057 ] |
Commented by: @alexpotapchenko Give me ODBC trace for query |
Commented by: Gregori Arjona (garjona) New ODBC trace doing cast in calculated fields |
Modified by: Gregori Arjona (garjona)Attachment: SQL.LOG [ 12058 ] |
Commented by: Gregori Arjona (garjona) VisualFoxpro 8 sample code |
Modified by: Gregori Arjona (garjona)Attachment: test.prg [ 12059 ] |
Commented by: @alexpotapchenko The type of sum(INTEGER field) is BIGINT In Firebird. VF8 doesn't support BIGINT (for ODBC: SQL_BIGINT) type and it returns this type as string . |
Commented by: Gregori Arjona (garjona) Thanks for the info Alexander. Easysoft ODBC driver and also the mysql driver can adjust the precision for agregated fields, it would be possible to add this option in the ODBC driver for Firebird? Tanks in advance. |
Commented by: @alexpotapchenko I don't understand what you want. Give an example please. |
Commented by: Gregori Arjona (garjona) In mysql odbc controller there is an option called FLAG_NO_BIGINT , this changes BIGINT columns to INT columns because some applications can't handle BIGINT. http://dev.mysql.com/doc/refman/5.0/en/connector-odbc-configuration-connection-parameters.html Thanks, and sorry for my bad english. |
Commented by: @alexpotapchenko FLAG_NO_BIGINT is not for following release. |
Modified by: @alexpotapchenkostatus: Open [ 1 ] => Resolved [ 5 ] resolution: Won't Fix [ 2 ] Fix Version: 2.0.1 [ 10430 ] |
Modified by: @alexpotapchenkostatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Gregori Arjona (garjona)
Attachments:
SQL3.LOG
SQL.LOG
test.prg
Test table:
CREATE TABLE TEST (
ID INTEGER NOT NULL,
QUANTITY1 INTEGER NOT NULL,
QUANTITY2 SMALLINT NOT NULL,
QUANTITY3 NUMERIC(15,2) NOT NULL,
QUANTITY4 DOUBLE PRECISION NOT NULL
);
data:
INSERT INTO TEST (ID, QUANTITY1, QUANTITY2, QUANTITY3, QUANTITY4) VALUES (1, 1, 2, 3, 4);
INSERT INTO TEST (ID, QUANTITY1, QUANTITY2, QUANTITY3, QUANTITY4) VALUES (2, 22, 34, 23, 12);
Calling this select, odbc returns wrong type of column Q1 and Q2
SELECT SUM(QUANTITY1) AS Q1,SUM(QUANTITY2) AS Q2,SUM(QUANTITY3) AS Q3,SUM(QUANTITY4) AS Q4 FROM TEST
Obc returns q1 and q2 as string
This workaround fix this problem.
SELECT CAST(SUM(QUANTITY1) AS INTEGER) AS Q1,CAST(SUM(QUANTITY2) AS INTEGER) AS Q2,SUM(QUANTITY3) AS Q3,SUM(QUANTITY4) AS Q4 FROM TEST
The text was updated successfully, but these errors were encountered: