Home  >  Q&A  >  body text

mysql 建立存储过程要写delimiter,后面的$$是什么意思呢?

ringa_leeringa_lee2742 days ago1064

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-04-17 15:48:08

    This is the correct way to write a stored procedure and can be executed successfully. Compared with the error message in the above picture, DELIMITER is added. Let me briefly explain the purpose of this command. In MySQL, each line of command ends with ";", and it will automatically execute after pressing Enter. Execution, in the stored procedure, ";" often does not mean the end of the instruction, it will run immediately, and DELIMITER originally means ";", so use this command to convert ";" to "//", so that only "//" is received "Only when the instruction is completed can it be executed

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:48:08

    delimiter tells the mysql interpreter whether the command has ended and whether it can be executed.
    By default, delimiter is a semicolon;, and it will be executed when a semicolon is encountered. The double dollar sign after
    tells mysql to execute again when it encounters a double dollar sign

    reply
    0
  • Cancelreply