cancel
Showing results for 
Search instead for 
Did you mean: 

MDO Query errors in log -[Cannot fetch column 22, which has JDBC type DOUBLE, into a Java variable of type ]

former_member185280
Active Contributor
0 Kudos

Hello,
We are seeing a lot of log messages like the one below when an MDO select query is run. There is a message for every numeric column. There doesnt seem to be any issue with the queries working properly its just creating a lot of log messages. Has anyone else had this issue?

Exception of type com.sap.sql.log.OpenSQLException caught:
Cannot fetch column 22, which has JDBC type DOUBLE, into a Java variable of type
float..
[EXCEPTION]
com.sap.sql.log.OpenSQLException: Cannot fetch
column 22, which has JDBC type DOUBLE, into a Java variable of type float.

at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:83) ...

Accepted Solutions (1)

Accepted Solutions (1)

former_member185280
Active Contributor
0 Kudos

Created incident 316599 / 2014 for this issue.

Answers (2)

Answers (2)

Former Member
0 Kudos

I have also encountered the same exact problem.

It seems that the underlying database is storing an attribute with a datatype of FLOAT in a field with a DOUBLE datatype.

If I change the attributes datatype to DOUBLE, I no longer see the error.

BTW, I am on Netweaver 7.31 SP10, MII 14 SP4 P1 running on MS SQL 2008 R2

saumya_govil
Active Contributor
0 Kudos

Hi Christian,

I have faced a similar issue few days back and was able to resolve it as well.

The issue was a simple datatype mismatch while reading the query result and assigning it to a variable.

In your case looks like (as exactly what the log says) you fetch a variable of type double and assign it to float type. Try using a type conversion if you actually need it to be as float; else change the variable type to be double to avoid the error.

Could you please share the select query you use so that I may let you know in more detail what could be the issue? Maybe you can trace the query and the error message/result in the transaction using a tracer.

Regards,

Saumya Govil

former_member185280
Active Contributor
0 Kudos

Saumya,


Thank you for your reply. The datatype for the columns is defined in the MDO as floats. My query is an MDO select query so there is no type assignment there. The error messages in the logs do not affect or manifest themselves at the query or transaction level. The query returns the expected data and everything functions fine. Because of this it actually took a while to figure out where the excessive log messages were coming from.

Regards,
Christian

saumya_govil
Active Contributor
0 Kudos

Hi Christian,

You are right. As in your case it is a select query it does not reflect the error automatically. In my case, I had an insert query so it failed then and there, which was easier to debug and fix.

I have one question regarding your case. When you read the MDO using the query, what do you do with the output? Do you assign it to any local/transaction property in the output links of the query block or in a proceeding assignment block?

Because, the error mentions that the assignment of float to double datatype fails. So, in theory there should be some assignment done with the output.

Please check if you could figure out this part in your transaction.

Regards,

Saumya Govil

former_member185280
Active Contributor
0 Kudos

Thanks Saumya,
I am able to recreate the issue by executing the query directly in the workbench so I don't think it has anything to do with any action at the transaction level. 
Regards,
Christian

saumya_govil
Active Contributor
0 Kudos

Hi Christian,

Great. So, we know one part of it.

One more important thing to check. Are you using the option 'Used Typed parameters' for this query? If yes, check if there you use datatype double for the parameter in error.

Regards,

Saumya Govil

former_member185280
Active Contributor
0 Kudos

It occurs regardless of the 'Used Types parameters' flag setting. There are no input parameters.