-->
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.  [ 2 posts ] 
Author Message
 Post subject: NHibernate 2.0 PostgreSQL call stored function
PostPosted: Tue Apr 15, 2008 4:24 am 
Newbie

Joined: Tue Apr 15, 2008 3:49 am
Posts: 1
Hi I have a problem to call a stored function on insert.

I tried this in the .hbm.xml for my test class:
<sql-insert>exec employeesinsert ?,?,?,?,?</sql-insert>
but the error was: syntax error at or near "exec"

I also tried this:
<plpgsql-insert>exec employeesinsert ?,?,?,?,?</plpgsql-insert>
But received: 'urn:nhibernate-mapping-2.2' has invalid child element 'plpgsql-insert'

The function is:
CREATE OR REPLACE FUNCTION employeesinsert(_name text, _surname text, _email text, _t integer)
RETURNS void AS
$BODY$
BEGIN
INSERT INTO employees (id, name, surname, email, "type")
VALUES (_id, _name, _surname, _email, '_t');
END
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
ALTER FUNCTION employeesinsert(text, text, text, integer) OWNER TO root;

Can anybody give an example how to do this?
Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 05, 2008 6:25 am 
Newbie

Joined: Sat May 03, 2008 1:57 am
Posts: 3
Location: Nagpur, India
user SELECT * FROM <fun_name> for database other than MS SQL, actually exec is for MS SQL only


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

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.