开发者

SQL batch separators in various DBMSes

开发者 https://www.devze.com 2022-12-18 06:38 出处:网络
I\'m continuing my quest on creating a database migration framework, and I\'m currently trying to implement proper support for native (platform-dependent) SQL scripts.

I'm continuing my quest on creating a database migration framework, and I'm currently trying to implement proper support for native (platform-dependent) SQL scripts.

From a SQL Server standpoint I know that a single .sql may contain several batches of SQL separated by GO terminators. GO itself is not a valid T-SQL keyword/whatever and is used purely to separate batches.

What I want to know is this: what keywords/identifiers/etc. are used to separate batches in other DBMSes, like SQLite, Oracle, etc., if any.

EDIT In SQL Server, batches are used both to group and to separate statements. For example, CREATE SCHEMA statement should be the first statement in a b开发者_StackOverflowatch, so it should be preceded by the GO keyword/identifier. I assume other systems have same concepts.


PL/SQL (Oracle) uses /


If by 'Batch' you mean a single file containing more than one SQL "statement" (e.g. a group of insert or update statements) then you can use a ; to separate them in MySQL

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号