How to echo print statements while executing a sql script

前端 未结 6 1792
执笔经年
执笔经年 2020-12-09 00:58

We have a simple sql script which needs to be executed against a MySQL database and we would like print log statements on the progress of the script (e.g. Inserted 10 record

6条回答
  •  遥遥无期
    2020-12-09 01:36

    This will give you are simple print within a sql script:

    select 'This is a comment' AS '';
    

    Alternatively, this will add some dynamic data to your status update if used directly after an update, delete, or insert command:

    select concat ("Updated ", row_count(), " rows") as ''; 
    

提交回复
热议问题