Author |
Message
|
MSV |
Posted: Thu Sep 14, 2006 11:42 pm Post subject: user-defined esql function |
|
|
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 |
|
 |
elvis_gn |
Posted: Fri Sep 15, 2006 1:35 am Post subject: Re: user-defined esql function |
|
|
 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 |
|
 |
MSV |
Posted: Fri Sep 15, 2006 3:02 am Post subject: Re: user-defined esql function |
|
|
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 |
|
 |
jefflowrey |
Posted: Fri Sep 15, 2006 4:17 am Post subject: |
|
|
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 |
|
 |
MSV |
Posted: Fri Sep 15, 2006 5:34 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Fri Sep 15, 2006 5:36 am Post subject: |
|
|
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 |
|
 |
MSV |
Posted: Fri Sep 15, 2006 5:48 am Post subject: |
|
|
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 |
|
 |
sanu_mit |
Posted: Mon Sep 18, 2006 8:42 pm Post subject: |
|
|
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 |
|
 |
mgk |
Posted: Tue Sep 19, 2006 12:49 am Post subject: |
|
|
 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 |
|
 |
vzhilyaev |
Posted: Wed Jul 04, 2007 12:59 am Post subject: Have you solved this problem? |
|
|
Newbie
Joined: 30 May 2006 Posts: 3
|
I'm facing the same right now. |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Jul 04, 2007 1:45 am Post subject: Re: Have you solved this problem? |
|
|
 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 |
|
 |
vzhilyaev |
Posted: Wed Jul 04, 2007 2:14 am Post subject: |
|
|
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 |
|
 |
vzhilyaev |
Posted: Wed Jul 04, 2007 3:08 am Post subject: Problem solved |
|
|
Newbie
Joined: 30 May 2006 Posts: 3
|
Project / Clean...
Now everything works fine. |
|
Back to top |
|
 |
|