ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » user-defined esql function

Post new topic  Reply to topic
 user-defined esql function « View previous topic :: View next topic » 
Author Message
MSV
PostPosted: Thu Sep 14, 2006 11:42 pm    Post subject: user-defined esql function Reply with quote

Acolyte

Joined: 11 Apr 2006
Posts: 59

Hi all,

I'm trying to call the following user-defined esql function within a mapping editor.
CREATE FUNCTION Tranform_Flag(IN str CHAR) RETURNS CHAR
BEGIN
IF str='I' THEN
return 'A';
ELSE
return 'N';
END IF;
END;

The message flow is complied.But, the bar file is not being deployed. The following errors are found in the event log.

Quote:
( WBRK6_DEFAULT_BROKER.new ) ('.MF_DataInsert', '71.607') : Undefined function '''.'Tranform_Flag''.

The program is attempting to call a function which is not defined or is not in the schema path.

Correct the syntax of your ESQL expression in node ''.MF_DataInsert'', around line and column ''71.607'', then redeploy the message flow.


Any help is appreciated.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Fri Sep 15, 2006 1:35 am    Post subject: Re: user-defined esql function Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi MSV,
MSV wrote:
( WBRK6_DEFAULT_BROKER.new ) ('.MF_DataInsert', '71.607') : Undefined function '''.'Tranform_Flag''.

The program is attempting to call a function which is not defined or is not in the schema path.

Correct the syntax of your ESQL expression in node ''.MF_DataInsert'', around line and column ''71.607'', then redeploy the message flow.
Where is the function lying in your project ? In the same schema, different schema, different project ?

You should have the schema name infront of the function name if in different schema.

Regards.
Back to top
View user's profile Send private message Send e-mail
MSV
PostPosted: Fri Sep 15, 2006 3:02 am    Post subject: Re: user-defined esql function Reply with quote

Acolyte

Joined: 11 Apr 2006
Posts: 59

elvis_gn wrote:

Where is the function lying in your project ? In the same schema, different schema, different project ?
You should have the schema name infront of the function name if in different schema.
Regards.


Hi Elvis,
The function is lying in the same project and under the same schema
As the function is defined in the same schema(default schema), I haven't mentioned the schema name before the function.

I'm calling the function in mapping editor as follows:
esql:Tranform_Flag($source/soapenv:Envelope/soapenv:Body/tns1:Interface/tns1:Content/tns1:flag)
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 15, 2006 4:17 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Is the function inside a module or outside a module?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
MSV
PostPosted: Fri Sep 15, 2006 5:34 am    Post subject: Reply with quote

Acolyte

Joined: 11 Apr 2006
Posts: 59

I'm not using any of the compute/filter/database nodes.

My esql just consists of the function.It is not in a module.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 15, 2006 5:36 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

So the entire ESQL file simply consists of the function? Then the function should be in Schema scope, and not module scope... so that's not the problem.

Are you sure the ESQL file was included in the bar file?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
MSV
PostPosted: Fri Sep 15, 2006 5:48 am    Post subject: Reply with quote

Acolyte

Joined: 11 Apr 2006
Posts: 59

Yes.I can view the esql file (while checking the Show source files option within the bar file)
Back to top
View user's profile Send private message
sanu_mit
PostPosted: Mon Sep 18, 2006 8:42 pm    Post subject: Reply with quote

Apprentice

Joined: 03 Jul 2003
Posts: 25
Location: Kolkata

Instead of the declaration of the function as
CREATE FUNCTION Tranform_Flag(IN str CHAR) RETURNS CHAR
make the declaration as
CREATE FUNCTION Tranform_Flag(str CHAR) RETURNS CHAR

I think u don't need to provide direction of the parameters of a function. It is required for procedures.
Back to top
View user's profile Send private message Yahoo Messenger
mgk
PostPosted: Tue Sep 19, 2006 12:49 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
I think u don't need to provide direction of the parameters of a function. It is required for procedures.


You don't need to provide direction indicators for functions, but from V6 onwards you can provide them if you wish. And I think it is usually a good idea if you do.

I would expect that providing the indicator (or not) will make very little difference in this case.[/i]
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
vzhilyaev
PostPosted: Wed Jul 04, 2007 12:59 am    Post subject: Have you solved this problem? Reply with quote

Newbie

Joined: 30 May 2006
Posts: 3

I'm facing the same right now.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Jul 04, 2007 1:45 am    Post subject: Re: Have you solved this problem? Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi vzhilyaev,
vzhilyaev wrote:
I'm facing the same right now.
Did you try the solutions provided above ?

Can you show us the error and your code.

Regards.
Back to top
View user's profile Send private message Send e-mail
vzhilyaev
PostPosted: Wed Jul 04, 2007 2:14 am    Post subject: Reply with quote

Newbie

Joined: 30 May 2006
Posts: 3

Hi, elvis_gn!

I'm using message map with submap, which was created by "Create new submap" wizard. Autogenerated code for wildcard element:
Code:
SOAPRequest_submap0($source/Appdata)

Both map and submap are packed in message broker archive. I can see both msgmap-files, if "Show source files" is checked. When I try to deploy bar to execution group, I get the following error:
Quote:
BIP2558E: (.SOAPRequest, 137.6) : Undefined function '.SOAPRequest_submap0'.

The program is attempting to call a function which is not defined or is not in the schema path.

Correct the logic of the ESQL program and re-deploy the message flow.
Back to top
View user's profile Send private message
vzhilyaev
PostPosted: Wed Jul 04, 2007 3:08 am    Post subject: Problem solved Reply with quote

Newbie

Joined: 30 May 2006
Posts: 3

Project / Clean...
Now everything works fine.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » user-defined esql function
Jump to:  



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
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.