These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: using hibernate to call a function in postgresql
PostPosted: Thu Dec 08, 2011 1:42 pm 
Newbie

Joined: Thu Dec 08, 2011 1:30 pm
Posts: 1
Hi guys,

i'm using hibernate without spring, i have the following function defined in PG:

Code:
CREATE OR REPLACE FUNCTION store_tmp_pct_bv()  RETURNS void AS
$$
     BEGIN
    update public."pct_bv"  set  c_pct_prelev_sout=data.c_pct_prelev_sout
                            from
    (SELECT id_bv,id_demande,c_pct_prelev_sout FROM public.v_tmp_pct_bv
     ) as data
     where   data.id_bv="pct_bv"."id_bv"
      and      data.id_demande= "pct_bv"."id_demande" ;
     END;
$$  LANGUAGE plpgsql




in my java code i use the following to execte the function:

Code:
Integer result=   getSession().createSQLQuery(" select public.store_tmp_pct_bv() ").executeUpdate();



but i got the following exception:
Code:
org.hibernate.exception.GenericJDBCException: could not execute native bulk manipulation query



and thanks for your help


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.