I have discovered a problem when selecting data from a mySQL view that contains one or more calculated fields.
I am using a PreparedStatement to query a view.
Example Table Called XXX
Column AAA Decimal(22,3)
Column BBB Decimal(22,3)
View Called YYY
Columns AAA & BBB from Table XXX plus calculated field as below
Column CCC = (AAA * BBB)
If my prepared statement does a SELECT * FROM XXX it works.
If my prepared statement does a SELECT * FROM YYY if fails with S0001
If I drop the calculated column CCC from the view then the SELECT works
again.
All rows in the table have number values populated with values.
As as workaround I use a VIEW without a calculated field then perform
the following from JDBC
SELECT *,(AAA * BBB) AS CCC from YYY
Its very odd - any ideas ?
Dave
I am using a PreparedStatement to query a view.
Example Table Called XXX
Column AAA Decimal(22,3)
Column BBB Decimal(22,3)
View Called YYY
Columns AAA & BBB from Table XXX plus calculated field as below
Column CCC = (AAA * BBB)
If my prepared statement does a SELECT * FROM XXX it works.
If my prepared statement does a SELECT * FROM YYY if fails with S0001
If I drop the calculated column CCC from the view then the SELECT works
again.
All rows in the table have number values populated with values.
As as workaround I use a VIEW without a calculated field then perform
the following from JDBC
SELECT *,(AAA * BBB) AS CCC from YYY
Its very odd - any ideas ?
Dave