Results of 1 - 10 of about 186 for Statement (0.004 sec.)
- Prepared Statements 12237
- A prepared statement is a parameterized query. The query is prepared with question marks ( ? ) or dollar symbols ( $1 ) indicating the parameters of the query. Values can then be bound to these parameters, after which the prepared statement
...can be executed using those parameters. A single query can be prepared once and executed many times. Prepared statements are useful to: Easily supply parameters to functions while avoiding string concatenation/SQL injection attacks. Speeding...up queries that will be executed many times with different parameters. DuckDB supports prepared statements in the C API with the duckdb_prepare method. The duckdb_bind family of functions is used to supply values for subsequent...execution of the prepared statement using duckdb_execute_prepared . After we are done with the prepared statement it can be cleaned up using the duckdb_destro... - https://man.mtool.work/duckdb/2.0/clients/c/prepared.html
- Complete API 11644
- This page contains the reference for DuckDB's C API. The reference contains several deprecation notices. These concern methods whose long-term availability is not guaranteed as they may be removed in the future. That said, DuckDB's develope
...name ( duckdb_result * result , idx_t col ); duckdb_type duckdb_column_type ( duckdb_result * result , idx_t col ); duckdb_statement_type duckdb_result_statement_type ( duckdb_result result ); duckdb_logical_type duckdb_column_logical_type ( duckdb_result...o_decimal ( double val , uint8_t width , uint8_t scale ); double duckdb_decimal_to_double ( duckdb_decimal val ); Prepared Statements duckdb_state duckdb_prepare ( duckdb_connection connection , const char * query , duckdb_prepared_statement * out_prepare...d_statement ); void duckdb_destroy_prepare ( duckdb_prepared_statement * prepared_statement ); const char * duckdb_prepare_error ( duc... - https://man.mtool.work/duckdb/2.0/clients/c/api.html
- CREATE TRIGGER Statement 9535
- New The CREATE TRIGGER feature was introduced in DuckDB 2.0. The CREATE TRIGGER statement registers a trigger: a set of SQL statements that run automatically in response to INSERT , UPDATE , or DELETE events on a table. Examples Record ever
...y statement that modifies a table in an audit table using a statement-level AFTER trigger. The REFERENCING OLD TABLE and NEW TABLE cla...EGER, new_val INTEGER); CREATE TRIGGER trg_audit AFTER UPDATE ON target REFERENCING OLD TABLE AS o NEW TABLE AS n FOR EACH STATEMENT INSERT INTO audit SELECT n.id, o.val, n.val FROM o JOIN n ON o.id = n.id; INSERT INTO target VALUES (1, 10), (2, 20); UPDA...rigger to changes of specific columns with UPDATE OF : CREATE TRIGGER trg_price AFTER UPDATE OF price ON products FOR EACH STATEMENT INSERT INTO price_changes DEFAULT VALUES; Drop a trigger: DROP TRIGGER trg_audit ON target; Drop a trigger if it exists: D... - https://man.mtool.work/duckdb/2.0/sql/statements/create_trigger.html
- Multiple Connections 9205
- For tests whose purpose is to verify that the transactional management or versioning of data works correctly, it is generally necessary to use multiple connections. For example, if we want to verify that the creation of tables is correctly
...multiple connections in the sqllogictests using connection labels . The connection label can be optionally appended to any statement or query . All queries with the same connection label will be executed in the same connection. A test that would verify th...e above property would look as follows: statement ok con1 BEGIN TRANSACTION statement ok con1 CREATE TABLE integers (i INTEGER); statement error con2 SELECT * FROM integers...; Concurrent Connections Using connection modifiers on the statement and queries will result in testing of multiple connections, but all the queries will still be run sequentially on a single... - https://man.mtool.work/duckdb/2.0/dev/sqllogictest/multiple_connections.html
- PREPARE, EXECUTE, and DEALLOCATE Statements 8942
- The PREPARE statement creates a prepared statement for later execution. The EXECUTE statement runs it with optional arguments. The DEALLOCATE statement removes it. For details about auto-incremented, positional, and named parameters, see Pr
...epared Statements . PREPARE Prepare a statement named query_person : PREPARE query_person AS SELECT * FROM person WHERE starts_with(name, $...name_start) AND age >= $minimum_age; Syntax EXECUTE Execute a prepared statement with named arguments: EXECUTE query_person(name_start := 'B', minimum_age := 40); Execute a prepared statement with positi...onal arguments: EXECUTE add_values(20, 22); Syntax DEALLOCATE Remove a prepared statement: DEALLOCATE query_person; The optional PREPARE keyword is accepted for PostgreSQL compatibility: DEALLOCATE PREPARE add_va... - https://man.mtool.work/duckdb/2.0/sql/statements/prepare.html
- SHOW, SHOW DATABASES, and SHOW SCHEMAS Statements 8206
- SHOW Statement The SHOW statement can also show the schema of a table, view or query, like DESCRIBE . As of DuckDB 2.0, this usage is deprecated and prints a warning; use DESCRIBE instead. New The following feature was introduced in DuckDB
...tting. 'table' : always describe a table. 'setting' : always show a setting. SET show_behavior = 'setting'; SHOW DATABASES Statement The SHOW DATABASES statement shows a list of all attached databases: ATTACH 'my.duckdb' AS my_database; SHOW DATABASES; da...tabase_name memory my_database DETACH my_database; SHOW DATABASES; database_name memory SHOW SCHEMAS Statement This statement was introduced in DuckDB 1.5. The SHOW SCHEMAS statement shows a list of all schemas across non-internal da...name schema_name current memory main true The current column indicates which schema is the default schema (set via the USE statement ).... - https://man.mtool.work/duckdb/2.0/sql/statements/show.html
- ADBC Client 8129
- Installation To use the DuckDB ADBC client, download the libduckdb archive for your platform and follow the instructions below . For Python, install the duckdb package instead, as described in the Python section . The latest stable version
...onality The DuckDB-ADBC driver implements the full ADBC specification, with the exception of the ConnectionReadPartition , StatementExecutePartitions and StatementSetSubstraitPlan functions. The first two exist to support systems that internally partition...ack Rollback any pending transactions. (AdbcConnection*, AdbcError*) AdbcConnectionRollback(&adbc_connection, &adbc_error) Statement Statements hold state related to query execution. They represent both one-off queries and prepared statements. They can be...reused; however, doing so will invalidate prior result sets from that statement. The functions used to create, destroy and set options for a statement: Function name Description Arguments Example Statem... - https://man.mtool.work/duckdb/2.0/clients/adbc.html
- PHP Client (PDO) 8129
- The PHP DuckDB PDO extension is a tertiary client and is maintained by a third-party. To use pdo_duckdb , follow the instructions below . The latest version of pdo_duckdb supports DuckDB 2.0.0. pdo_duckdb is a native DuckDB database driver
...ew PDO('duckdb::memory:'); $duckDb->exec('CREATE TABLE table1 (id INTEGER, amount DECIMAL(10, 2), description VARCHAR)'); $statement = $duckDb->prepare('INSERT INTO table1 VALUES (?, ?, ?)'); $statement->execute([1, 42.21, 'Hello DuckDB! ? ? ?']); $statem...ent = $duckDb->query('SELECT * FROM table1'); print_r($statement->fetchAll(PDO::FETCH_ASSOC)); # Array # ( # [0] => Array # ( # [id] => 1 # [amount] => 42.21 # [description] => Hello Duck...ew PDO('duckdb::memory:'); $db->exec('CREATE TABLE table1 (id INTEGER, text VARCHAR USING COMPRESSION zstd, data JSON)'); $statement = $db->prepare('INSERT INTO table1 VALUES (?, ?, ?)'); $statement->execute([1, 'Hello DuckDB ?', ['foo' => 'bar', 'baz' =>... - https://man.mtool.work/duckdb/2.0/clients/tertiary_clients/php_pdo.html
- DuckDB_% Metadata Functions 7986
- DuckDB offers a collection of table functions that provide metadata about the current database. These functions reside in the main schema and their names are prefixed with duckdb_ . The resultset returned by a duckdb_ table function may be
...used just like an ordinary table or view. For example, you can use a duckdb_ function call in the FROM clause of a SELECT statement, and you may refer to the columns of its returned resultset elsewhere in the statement, for example in the WHERE clause. T...RCHAR column_index The unique position of the column within its table. INTEGER comment A comment created by the COMMENT ON statement . VARCHAR internal true if this column is built-in, false if it is user-defined. BOOLEAN column_default The default value...nt_text The definition of the constraint expressed as a SQL-phrase. (Not necessarily a complete or syntactically valid DDL-statement.) VARCHAR expression If constraint is a check constraint, the definition of the condition being checked, otherwise NULL .... - https://man.mtool.work/duckdb/2.0/sql/meta/duckdb_table_functions.html
- sqllogictest Introduction 7250
- For testing plain SQL, we use an extended version of the SQL logic test suite, adopted from SQLite . Every test is a single self-contained file located in the test/sql directory. To run tests located outside of the default test directory, s
..._directory> and make sure provided test file paths are relative to that root directory. The test describes a series of SQL statements, together with either the expected result, a statement ok indicator, or a statement error indicator. An example of a test...e is shown below: # name: test/sql/projection/test_simple_projection.test # group [projection] # enable query verification statement ok PRAGMA enable_verification # create table statement ok CREATE TABLE a (i INTEGER, j INTEGER); # insertion: 1 affected r...ow statement ok INSERT INTO a VALUES (42, 84); query II SELECT * FROM a; ---- 42 84 In this example, three statements are executed. The... - https://man.mtool.work/duckdb/2.0/dev/sqllogictest/intro.html
DuckDB 2.0 Documentation / man.mtool.work