SQL - Data Definition Language (DDL)
About
DDL is a sql subset that manages the database metadata.
You can execute DDL statements with a SQL Request.
Example/HowTo
List
- CREATE,
- ALTER,
- DROP
DDL vs the CREATE operation
With a DDL, you create a SQL Object with the CREATE statement with the create operation, you can
- create table by copy
- create view from a list of files containing Select statements.
Execution
If you execute a SQL fetch that contains DDL statements, you will get the following results.
id count statement error_code error_message
-- ------------ ---------------------------------------------------- ---------- -------------
1 0 create table ddl_table_test\n(\n column_name inte 0
2 0 alter table ddl_table_test\n owner to postgres;\n 0
A DDL script is an runtime and therefore is executed:
- at access/runtime
- or via the execute operation
Example of execution at runtime
- with the print command. If you print it 2 times, they will execute 2 times.
tabul data print (create_ddl.sql@cd)@sqlite
Note
Auto-commit
DDL statements auto-commit, so they can't be rolled back