What's the correct way to to include an Args in Direct Database Query?
Options
![Sam](https://us.v-cdn.net/6037124/uploads/userpics/0L4LF9AMMKKV/nQYIQL2LGWTH7.jpg)
Sam
Member ✭
Look at the example below, the idea is to find lease_id IN a lease_ids array, in the first case below I tried to format the lease_ids array into (39,38,137,84,144,185,187,189,191,66,146), which is the correct way to query in posgresql, result in an error:
But when I directly type them in, no error occur:
How can I include the lease_ids array in this raw query?
Tagged:
Answers
-
Found the solution, convert the array from Xano (recognize by Posgresql as a String) to individual values first using:
IN ( SELECT value::bigint FROM json_array_elements_text(?) AS arr(value))
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback