Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

EclipseLink generates wrong sql code when calling stored procedure

$
0
0

Hi,

 

 

I am using EclipseLink 2.5 trying to call a HANA stored procedure, like this:

 

1) describe it in the xml:

 

<named-stored-procedure-query  name="findAllStationsNamedProc"  result-class="com.domain.Station"  procedure-name="CC_TEST_READ_STATIONS"></named-stored-procedure-query>

 

2) use it in code:

 

Query q = em.createNamedQuery("findAllStationsNamedProc");
List<Station> stationList = q.getResultList();
System.out.println("Loaded  " + stationList.size() + " stations");

Although other calls that do not involve calling a stored procedure work fine through JDBC, this one doesn't. The generated SQL doesn't seem to be proper HANA SQL, having EXECUTE instead of CALL:

 

 

javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "EXECUTE": line 1 col 1 (at pos 1)
Error Code: 257
Call: EXECUTE PROCEDURE CC_TEST_READ_STATIONS()
Query: ReadAllQuery(name="findAllStationsThroughAMDPNamedProc" referenceClass=Station )

Any ideas why it generates with EXECUTE and what would be any possible solutions?

 

 

Thank you,

Alex


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>