Document the right use of named parameter substitution in N1QL
Description
Environment
Release Notes Description
Activity

Beth Favini September 19, 2023 at 7:00 PM
This ticket is being closed as part of the docs team’s effort to increase focus on relevant doc work. We are closing all open tickets that were created before January 2022. This bulk change will help us better manage a large historical backlog and identify high-priority issues. We’ve tagged all tickets closed as part of this effort with the label bulkclosed20230919. We encourage you to reopen this and any other ticket you think is still relevant.

Sriram Melkote December 5, 2020 at 5:17 PMEdited
@Jon Strabala to clarify, I'd like this bug to be utilized for N1QL folks to document positional and named parameters within N1QL language (and so the bug now has no relation to eventing) – i.e., address the below portion of Gautham's comment:
— I recollect that there was page in documentation describing the clauses (such as WHERE, FROM etc.) only after which the named parameter substitution was permissible. But I'm unable to find it now.
If reusing this bug this way is confusing, please let me know, I can close and open a fresh bug exclusively for N1QL docs.

Jon Strabala December 4, 2020 at 7:40 PMEdited
@Simon Dew just so you know both styles "positional parameter(s)" and "named parameter(s)" are fully described in the scriptlet "basicN1qlPreparedSelectStmt"
https://docs.couchbase.com/server/current/eventing/eventing-handler-basicN1qlPreparedSelectStmt.html
On Nov 3, I also updated https://docs.couchbase.com/server/current/eventing/eventing-language-constructs.html#n1ql_call to show both styles.
@Sriram Melkote or @Simon Dew if your happy please resolve this.
Alternatively @Sriram Melkote if you want better documentation surrounding inline N1QL and variables - as opposed to the N1QL() function and positional and named parameters please let me know and I will work on clarifying that.

Jon Strabala October 16, 2020 at 10:38 PM
@Sriram Melkote I have no problem doing this in the docs, but I have only been able to get positional parameters to work if you or the team can provide me a sample I will update the docs and Simon can clean my work up.

Sriram Melkote October 14, 2020 at 7:26 AMEdited
The lack of understanding around named/positional parameters is causing a lot of confusion. Can we please prioritize documenting where named/positional parameters can and cannot appear in parameterized queries?
We also need to call out behavior of PREPARE statement in regard to named/positional parameters if it has different restrictions than the underlying statement that is being prepared.
Thank you!
Details
Assignee
Simon DewSimon DewReporter
Gautham BanasandraGautham BanasandraLabels
Story Points
1Components
Fix versions
Affects versions
Priority
CriticalInstabug
Open Instabug
Details
Details
Assignee

Reporter

Labels
Story Points
Components
Fix versions
Affects versions
Priority
Instabug
PagerDuty
PagerDuty Incident
PagerDuty
PagerDuty Incident
PagerDuty

Sentry
Linked Issues
Sentry
Linked Issues
Sentry
Zendesk Support
Linked Tickets
Zendesk Support
Linked Tickets
Zendesk Support

Please document the right usage for named parameter substitution for N1QL queries. The following query throws a syntax error regarding the use of named parameter substitution -
UPDATE myBucket USE KEYS["myDocId"] SET $myCounter = $myCounter + 1;
error is as follows -
[ { "code": 3000, "msg": "syntax error - at $myCounter", "query_from_user": "UPDATE destination USE KEYS[\"myDocId\"] SET $myCounter = $myCounter + 1;" } ]
I recollect that there was page in documentation describing the clauses (such as WHERE, FROM etc.) only after which the named parameter substitution was permissible. But I'm unable to find it now.