This section describes code execution in batch mode.
In batch mode, all the command logic described above is not available, only valid code for the active language can be executed.
When processing SQL code, it is executed statement by statement using the following logic: read/process/print result.
When processing non-SQL code, it is loaded entirely from the input source and executed as a unit.
-i) command-line option to configure
MySQL Shell to process the input source as if it were being
issued in interactive mode; this enables all the features provided
by the Interactive mode to be used in batch processing.
In this case, whatever the source is, it is read line by line and processed using the interactive pipeline.
It is possible to specify statements over multiple lines. When
automatically enabled when a block of statements starts like in
function definitions, if/then statements, for loops, and so on.
In SQL mode multiple line mode starts when the command
\ is issued.
Once multiple-line mode is started, the subsequently entered statements are cached.
create procedure get_actors()...
select first_name from sakila.actor;...