Skip to content
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

Closed
firebird-automations opened this issue Nov 24, 2011 · 14 comments

Comments

@firebird-automations
Copy link

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

@firebird-automations
Copy link
Author

Commented by: Gregori Arjona (garjona)

ODBC trace

@firebird-automations
Copy link
Author

Modified by: Gregori Arjona (garjona)

Attachment: SQL3.LOG [ 12057 ]

@firebird-automations
Copy link
Author

Commented by: @alexpotapchenko

Give me ODBC trace for query
"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" too.
How execute SQL scripts in VF? I have downloaded VF 8 but I can't understand how to reproduce this problem...

@firebird-automations
Copy link
Author

Commented by: Gregori Arjona (garjona)

New ODBC trace doing cast in calculated fields

@firebird-automations
Copy link
Author

Modified by: Gregori Arjona (garjona)

Attachment: SQL.LOG [ 12058 ]

@firebird-automations
Copy link
Author

Commented by: Gregori Arjona (garjona)

VisualFoxpro 8 sample code

@firebird-automations
Copy link
Author

Modified by: Gregori Arjona (garjona)

Attachment: test.prg [ 12059 ]

@firebird-automations
Copy link
Author

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 .
You can add BIGINT field and check type without aggregates.

@firebird-automations
Copy link
Author

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.

@firebird-automations
Copy link
Author

Commented by: @alexpotapchenko

I don't understand what you want. Give an example please.

@firebird-automations
Copy link
Author

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.

@firebird-automations
Copy link
Author

Commented by: @alexpotapchenko

FLAG_NO_BIGINT is not for following release.

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

Fix Version: 2.0.1 [ 10430 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants