Author |
Message
|
semcgurk |
Posted: Fri Nov 15, 2013 7:25 am Post subject: Passing Array as a Parameter to Function |
|
|
Newbie
Joined: 14 Nov 2013 Posts: 9
|
Hi there,
I am trying to create a Function that allows an array to be passed in as a parameter.
I cannot get the signature of the function right.
I have tried the following:
Code: |
CREATE FUNCTION FilterByMultipleValues(IN CharArray[]) RETURNS CHAR
|
and
Code: |
CREATE FUNCTION FilterByMultipleValues(IN CharArray[] CHAR) RETURNS CHAR
|
and the editor reports a syntax error with both of these.
Can anyone help me with this please? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Nov 15, 2013 7:43 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There's no such thing as an ARRAY in esql.
Learn and accept that.
What you are pretending is an array is either a list or a row or an element in the message tree.
You can't pass lists around, so it can't be a list.
Go back to the ESQL manual. Understand all of the available types. |
|
Back to top |
|
 |
semcgurk |
Posted: Fri Nov 15, 2013 8:03 am Post subject: |
|
|
Newbie
Joined: 14 Nov 2013 Posts: 9
|
If it is an Environment Variable with multiple instances, could I not just create a reference to it and thus define my function thus:
Code: |
CREATE FUNCTION FilterByMultipleValues(IN CharArray[]) RETURNS CHAR
|
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Nov 15, 2013 8:08 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
semcgurk wrote: |
If it is an Environment Variable with multiple instances, could I not just create a reference to it and thus define my function thus:
Code: |
CREATE FUNCTION FilterByMultipleValues(IN CharArray[]) RETURNS CHAR
|
|
No, because that doesn't define a reference.
But you're on the right track. |
|
Back to top |
|
 |
semcgurk |
Posted: Fri Nov 15, 2013 8:14 am Post subject: |
|
|
Newbie
Joined: 14 Nov 2013 Posts: 9
|
D'oh!
Copy and paste #fail:
Code: |
CREATE FUNCTION FilterByMultipleValues(IN CharArray REFERENCE) RETURNS CHAR
|
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Nov 15, 2013 8:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
semcgurk |
Posted: Fri Nov 15, 2013 8:26 am Post subject: |
|
|
Newbie
Joined: 14 Nov 2013 Posts: 9
|
|
Back to top |
|
 |
dogorsy |
Posted: Fri Nov 15, 2013 9:39 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
Honestly !... it is well documented. It would be a lot quicker to read the docs than to ask in this forum. |
|
Back to top |
|
 |
|