Version 8.0.19 JDBC & Server problem with view
Posted by: David Garratt
Date: April 14, 2020 11:44AM

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

Options: ReplyQuote


Subject
Written By
Posted
Version 8.0.19 JDBC & Server problem with view
April 14, 2020 11:44AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.