-->
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: calling simple function
PostPosted: Wed Feb 13, 2008 12:36 pm 
Newbie

Joined: Thu Oct 18, 2007 5:07 am
Posts: 3
Hi all,

I'm trying to call a very simple function with Hibernate. Here it is :


Code:
CREATE OR REPLACE FUNCTION F_OPC_REMPLACECHARS
(
   RaisonSociale     IN VARCHAR2
) RETURN VARCHAR2
IS
   sChaineTransf VARCHAR2(300);
BEGIN
   sChaineTransf :=  RaisonSociale;
   sChaineTransf := LOWER(sChaineTransf);
   sChaineTransf := TRANSLATE(sChaineTransf, 'éèêàâùûôöôïîç', 'eeeaauuoooiic');
   sChaineTransf := TRANSLATE(sChaineTransf, '&"''(-_)=?./§,;:!%µ*$£~#{[|`\@]}+^', '                                 ');
   sChaineTransf := UPPER(sChaineTransf);
   sChaineTransf := REPLACE(sChaineTransf, ' ', '');

   RETURN sChaineTransf;
END F_OPC_REMPLACECHARS;


As you see, it's not a select statment, it's just returning a simple VARCHAR2. The function works fine.

I would like to be able to call it in a service, just like it was a Java method. (I could code the same thing in Java, but that would mean twice the work for maintance) I've tried to follow chapter 16 of the doc, with no success. Does anybody have any ideas on how to make this work?

Greetings,

Erwan


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.