Is it possible to pass the result of a query as a function parameter?

Is it possible to pass the result of a query as a function parameter?

guiroehe
Collaborator Collaborator
423 Views
4 Replies
Message 1 of 5

Is it possible to pass the result of a query as a function parameter?

guiroehe
Collaborator
Collaborator

Hello,

I wonder if it is possible to pass the result of a query as a parameter in a function call. If so, what is the specification for the variable in the function code? I tried with Table, but the function receives an invalid content.

 

Also, how one tests if a query is NULL? objectexists(...) does not seem to work.

 

Thank you.

0 Likes
Accepted solutions (2)
424 Views
4 Replies
Replies (4)
Message 2 of 5

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution

You can use a clone of the table result to cast it as an array and pass it as a variant parameter.

0 Likes
Message 3 of 5

guiroehe
Collaborator
Collaborator

Hi, @jason_lightfoot_adsk ,

 

thank you. It worked.

I am implying that this way the query looses its "table" characteristics, correct (column names, indexes, etc.)?

Thank you once more.

0 Likes
Message 4 of 5

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution

Yes - you lose that information in a array.   You could alternatively create a Map of the table for better referencing and pass that to your function - try mapFromTable() here.

0 Likes
Message 5 of 5

guiroehe
Collaborator
Collaborator

Thank you very much!

0 Likes