Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 958 Bytes

db_scripts_sql.adoc

File metadata and controls

19 lines (13 loc) · 958 Bytes
The Structure of SQL Scripts

Create and update SQL scripts are text files with a set of DDL and DML commands separated by the "^" character. The "^" character is used, so that the ";" separator can be applied as part of complex commands; for example, when creating functions or triggers. The script execution mechanism splits the input file into separate commands using the "^" separator and executes each command in a separate transaction. This means that, if necessary, it is possible to group several single statements (e.g., insert), separated by semicolons and ensure that they execute in a single transaction.

Tip

The "^" delimiter can be escaped by doubling it. For example, if you want to pass ^$` to a statement, the script should contain `^^[0-9\s]$.

An example of the update SQL script:

link:../../../../../source/dbms/dbscripts_3.sql[role=include]