sql - Workflow control in mysql or oracle -
in mssql, can submit batch query statements workflow control, this:
declare @num int select @num = 100 if @num > 0 begin select @num = @num + 1 end
how in mysql or oracle (without procedure or function).
you can't use if ... then
in official mysql outside of stored programs.
you can, however, in mysql-compatible mariadb, starting in version 10.1 (currently in beta).
now 1 can use
begin
,if
,case
,while
,loop
,repeat
statements directly in sql scripts , mysql command line prompt — outside of stored programs.https://blog.mariadb.org/mariadb-10-1-1-compound-statements/
Comments
Post a Comment