zella
zella

Reputation: 4685

How to use js server functions as part of osql

I have a js function with rids as parameter (see "Execute" on screenshot), it works:

enter image description here

I try to use this function with result of subquery in osql:

select testFunction(select @rid from User where someField < 365)

And it gives me Error parsing query of course.

How to use function as part of osql in that case?

Upvotes: 1

Views: 44

Answers (1)

Ivan Mainetti
Ivan Mainetti

Reputation: 1982

this should work:

select testFunction(@this.@rid) from User where someField < 365

in this way it's going to call the function every time it found a record passing that single record to the function and so on for every result of the select from User where someField < 365

Hope it helps! Ivan

Upvotes: 3

Related Questions