How to call a custom Oracle function returning a value from JPA

后端 未结 5 489
暗喜
暗喜 2021-01-14 01:23

I have a custom function in oracle returning a number after deleting records. I could get a value in sql_plus such as

call my_function(4) into :out_number;
<         


        
5条回答
  •  攒了一身酷
    2021-01-14 02:04

    I used this to execute native functions in oracle:

    Query query = em.createNativeQuery("select my_function(:param) from dual");
    query.setParameter("param", 4);
    return query.getSingleResult();
    

提交回复
热议问题