cockroachdb / cockroachdb/docs
SQL Statements Doc Update : PREPARE / EXECUTE / DEALLOCATE
- Dominant language
- HTML
- Stars
- 212
- Forks
- 476
- Avg merge
- 40m
- Merged PRs (30d)
- 3
Description
Re: [SQL Statements](https://cockroachlabs.com/docs/v21.2/sql-statements.html)
## Issue Description
There is no documentation on the following statements:
* `PREPARE`
* `EXECUTE`
* `DEALLOCATE`
Per internal discussion, these statements are supported.
Related PostgreSQL doc is
https://www.postgresql.org/docs/current/sql-prepare.html
## Suggested Resolution
Document the `PREPARE`, `EXECUTE`, and `DEALLOCATE` statements.
Here is an example of using these statements, using the `cockroach demo` command:
```
demo@127.0.0.1:26257/movr> select count(*) from users where city='seattle';
count
---------
6
(1 row)
Time: 2ms total (execution 2ms / network 0ms)
demo@127.0.0.1:26257/movr> prepare q1 (string) as select count(*) from users where city=$1;
PREPARE
Time: 1ms total (execution 1ms / network 0ms)
demo@127.0.0.1:26257/movr> execute q1 ('seattle');
count
---------
6
(1 row)
Time: 2ms total (execution 2ms / network 0ms)
demo@127.0.0.1:26257/movr> deallocate q1;
DEALLOCATE
Time: 1ms total (execution 0ms / network 0ms)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.