Author |
Message
|
kunal07 |
Posted: Thu Mar 20, 2014 2:15 am Post subject: Return ROW Variables |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
hi,
i am trying to create a function that will return row type variable but not able to do.
I have created one function CREATE Function Test(IN abc Character) RETURNS ROW
BEGIN
Declae rowdata ROW;
SET rowdata .tes1 = value1;
SET rowdata .test2 == value2;
.........
.......
RETURN rowdata ;
But while deploying i am getting the error : Syntax error : 'keyword Row'.
The token caused a syntax error.
Correct the syntax of your ESQL expression in node '.publish', around line and column '1.62', then redeploy the message flow.
any one can help me on this.
thanks |
|
Back to top |
|
 |
kunal07 |
Posted: Thu Mar 20, 2014 4:27 am Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
Hi Champs,
Where are you??
any solution?????? |
|
Back to top |
|
 |
kimbert |
Posted: Thu Mar 20, 2014 4:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Here's your problem:
Code: |
Declae rowdata ROW; |
That was easy. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
kunal07 |
Posted: Thu Mar 20, 2014 4:37 am Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
any solution??? if its easy,..
i am getting the deployment error.
can you please suggest anything to resolve that deployment error??? |
|
Back to top |
|
 |
kunal07 |
Posted: Thu Mar 20, 2014 4:38 am Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
its declare row data only |
|
Back to top |
|
 |
kunal07 |
Posted: Thu Mar 20, 2014 4:53 am Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
guys is it possible to return ROW datatype variable from a function ????? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 20, 2014 4:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kunal07 wrote: |
can you please suggest anything to resolve that deployment error??? |
Don't use a ROW type variable as a parameter. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 20, 2014 4:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kunal07 wrote: |
guys is it possible to return ROW datatype variable from a function ????? |
No, and show some patience!
We all have day jobs. If you want an urgent answer raise a PMR!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kunal07 |
Posted: Thu Mar 20, 2014 5:36 am Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
ok so we cannt use the ROW variable as return type. ????
i have to return a list of array value from a function..
is there any other way you suggest??? |
|
Back to top |
|
 |
Esa |
Posted: Thu Mar 20, 2014 5:54 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Declare the ROW variable outside the function/procedure
Create a child element to it.
Declare a reference to the child element;
pass the reference to the procedure
within the procedure, create a list by adding child elements under the reference as in your first example
And, when creating your next topic, do some testing with at least Code and Preview buttons in the post editor. |
|
Back to top |
|
 |
kunal07 |
Posted: Thu Mar 20, 2014 6:21 am Post subject: |
|
|
Acolyte
Joined: 05 Dec 2012 Posts: 72
|
thanks for the reply. I have already done that but actually i want to return this as an array.
is it possible to return this.
i will going to call a function from mapping node and i want to return an array. |
|
Back to top |
|
 |
|