Author |
Message
|
Harshalw |
Posted: Mon Aug 04, 2008 6:12 am Post subject: How to call a function defined other compute node |
|
|
Voyager
Joined: 23 Jul 2008 Posts: 77
|
Hi,
I have 2 compute node Compute1 and Compute 2.
I have defined a fucntion FUNC2 in Compute 2. I wanted to call this function from Compute1. Pls reply on how to call FUNC2 from Compute1.
Thanks,
Harshalw |
|
Back to top |
|
 |
billybong |
Posted: Mon Aug 04, 2008 7:02 am Post subject: |
|
|
 Disciple
Joined: 22 Jul 2005 Posts: 150 Location: Stockholm, Sweden
|
Short answer:
You need to create the function on schema level, that is outside the module.
Then you can simply call it by either
1) Having both modules in the same schema
2) Specify a PATH in comp1 module esql file "importing" the schema used by comp2 module
3) Call the function with the full schema name used by comp2 included in the comp2 call (eg CALL com.ibm.common.myFunction('helloworld!'))
Long answer:
Find it in the ESQL programming guide.  _________________ IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Integration Developer V6.0
IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere DataPower |
|
Back to top |
|
 |
AkankshA |
Posted: Mon Aug 04, 2008 8:08 pm Post subject: Re: How to call a function defined other compute node |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
Harshalw wrote: |
Hi,
I have 2 compute node Compute1 and Compute 2.
I have defined a fucntion FUNC2 in Compute 2. I wanted to call this function from Compute1. Pls reply on how to call FUNC2 from Compute1.
Thanks,
Harshalw |
Define FUNC2 outside the module of Compute1 and make a call of Func1 in both compute1 and compute2
You can even define it in a separate eSQL file and ensure that PATH and schema clauses are taken care of.. _________________ Cheers |
|
Back to top |
|
 |
wangchengsi |
Posted: Thu Aug 07, 2008 7:33 pm Post subject: |
|
|
Newbie
Joined: 05 Jun 2008 Posts: 5
|
functions in a module is "private",only accessable for other functions in the same module
you can define your "global" function outside module (in schema 1), then other functions in other module of different schema (in schema 2) can use that "global" function by adding "path" in schema 2 |
|
Back to top |
|
 |
sandeep9678 |
Posted: Thu Aug 07, 2008 8:47 pm Post subject: |
|
|
 Apprentice
Joined: 04 Aug 2008 Posts: 41 Location: India
|
It is always good to have seperate esql file which contais the common functions and then utilize them as beans. |
|
Back to top |
|
 |
|