0 Replies Latest reply on Oct 1, 2009 4:40 PM by Eduard Correa

    Calling Oracle Function-Procedure (with DML operations)

    Eduard Correa Newbie

      Hi Seam folks,

      Im using Hibernate as JPA provider and i have a problem calling a Oracle function/procedure from EntityManager.

      First i used this way:

      Query query =  entityManager.createNativeQuery("SELECT PACKAGE.myFuncion(?1) FROM DUAL");
      query.setParameter(1, x);
      BigDecimal result = (BigDecimal) query.getSingleResult();

      This works fine for function/procedure with no DML operations. (Only selects and process logic). But i need to call functions and procedures that perform DML sentences (insert, update, delete), i've tried with

      Query query = entityManager.createNativeQuery("{ ? = call PACKAGE.myFunction(?) }")

      But always I get errors

      The documentation is some poor, then i would appreciate some help about this subject.


      Warm regards

      Eduard Correa