jdbc - Eclipselink generated SQL with ROWNUMBER, which is not recognized by SQLServer -


i using eclipselink connect different dbs. , run same query against db2 , sqlserver. query runs on db2 failed on sqlserver.

here error message:


internal exception: com.microsoft.sqlserver.jdbc.sqlserverexception: 'rownumber' not recognized built-in function name. error code: 195  call: select * (select * (select el_temp.*, rownumber() over() el_r ownm (select t0.eval_id a1, t0.eval_typ_id a2, t0.create_datetm a3 , t0.eval_desc a4, t0.eval_name a5, t0.revision_nbr a6, t0.update_datet m a7, t1.logicl_db a8, t1.query_string_hash a9, t1.query_string_txt a10 eval t0, sql_eval t1 ((t0.eval_name = ?) , ((t1.eval_id = t0.ev al_id) , (t0.eval_typ_id = ?))) order t0.revision_nbr desc) el_temp) el_temp2 el_rownm <= ?) el_temp3 el_rownm > ?         bind => [ba-td.lodg_rm_night_trans_fact.price_amt_local_with_oms, 1, 1, 0] 

i think query generated eclipselink since original query simple. question is, sqlserver cannot recognize 'rownumber' how change 'row_number'? there way config how eclipselink sql generation?

thanks!

try setting eclipselink.target-database property org.eclipse.persistence.platform.database.sqlserverplatform:

<property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.sqlserverplatform"/> 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -