You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wanted to ask something I'm not fully getting. I'm having trouble on how to correctly use the ILIKE operator with the % wildcard. I have a table orders with a TEXT field named item_id. This works:
awaitdb.all("SELECT * FROM orders WHERE item_id ILIKE ?;",item)
Adding the % wildcard in any of the following ways will fail:
awaitdb.all("SELECT * FROM orders WHERE item_id ILIKE %?;",item)
awaitdb.all("SELECT * FROM orders WHERE item_id ILIKE ?%;",item)
awaitdb.all("SELECT * FROM orders WHERE item_id ILIKE %?%;",item)
The error is the same for the 3 examples:
[Error: Parser Error: syntax error at or near "%"] {
errno: -1,
code: 'DUCKDB_NODEJS_ERROR',
errorType: 'Parser'
}
Adding single quotes for any of the % expressions above does not solve the issue.
Another similat issue that I'm getting is when I try to perform a SELECT with the IN operator. Given an array of ids, e.g: [1, 2, 3] How should I correctly write/pass arguments to db.all?:
letorders=[1,2,3];awaitdb.all("SELECT * FROM batches WHERE order_id IN (?);",orders);
The above snippet produces the following error:
[Error: Conversion Error: Could not convert string '1,3,6' to INT64] {
errno: -1,
code: 'DUCKDB_NODEJS_ERROR',
errorType: 'Conversion'
}
Is there any documentation on how to write these types of queries?
Thanks in advance,
Lucas.
The text was updated successfully, but these errors were encountered:
Any help/guidelines/references on how to correctly treat the ? placeholder for diverse operators/use cases is much appreciated as at least for me this has been (still is) a time waster.
Hi,
Just wanted to ask something I'm not fully getting. I'm having trouble on how to correctly use the
ILIKE
operator with the%
wildcard. I have a tableorders
with aTEXT
field nameditem_id
. This works:Adding the
%
wildcard in any of the following ways will fail:The error is the same for the 3 examples:
Adding single quotes for any of the
%
expressions above does not solve the issue.Another similat issue that I'm getting is when I try to perform a
SELECT
with theIN
operator. Given an array of ids, e.g:[1, 2, 3]
How should I correctly write/pass arguments todb.all
?:The above snippet produces the following error:
Is there any documentation on how to write these types of queries?
Thanks in advance,
Lucas.
The text was updated successfully, but these errors were encountered: