Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Stored procedure problems with PostgreSQL

This is because PostgreSQL does not support stored procedures, only stored
functions.  The standard stored procedure execution does not work for stored
functions.  Just use a native query.



Lars Tackmann wrote:
> 
> Hi all
> 
> I have defined the following stored procedure (function) in PostgreSQL
> called get_user(varchar) and am trying to execute it using EclipseLink
>  named-stored-procedure-query. The correct way to call a function in
> PostgreSQL is to do:
> 
> select get_user('blacla');
> 
> but it looks like eclipselink runs it as:
> 
> EXECUTE get_user('blabla')
> 
> which as far as I know is incorrect (and fails on postgresql).  I am
> using Eclipselink
> 1.1-RC1 and the orm.xml that defined my stored procedure call looks
> like this:
> --
>    <named-stored-procedure-query name="User.findByUsername"
> procedure-name="get_user"
> 
> result-class="org.randompage.samples.jpa.domain.User">
>        <parameter query-parameter="username" name="v_username"/>
>    </named-stored-procedure-query>
> --
> 
> is it my named-procedure-query that is wrong ? or could this be a bug
> in EclipseLink.
> 
> -- 
> Yours sincerely
> 
> Lars Tackmann
> 
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Stored-procedure-problems-with-PostgreSQL-tp22142369p22161192.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top