• 0

[MySql SQL] What is the DELIMITER about?!


Question

Im confident with SQL and normally use SQL Server. But im messing about with MySql and having a nightmare with some simple stored procedures.

One minute my code is fine, the next it has syntax errors - AND I HAVENT CHANGED THE CODE!

The error points at the first line reading 'DELIMITER $$' - what is this DELIMITER for? I tried taking it out before and it didnt work. Can anyone shine a light here?

3 answers to this question

Recommended Posts

  • 0

MySQL uses a special character (the "delimiter") to mark the end of a command. When loading the stored procedure into memory, MySQL parses that file and treats the input characters literally. Therefore, when it encounters the delimiter while loading the file, it begins executing the stored procedure as if you had just typed it into the console. And since the file hasn't finished loading yet, you get errors. In order to prevent this, it is necessary to change the delimiter to something else temporarily in order to suppress immediate execution. Then, after the stored procedure has been loaded into memory, change the delimiter back into what it was before.

  • 0
  $phinX said:

So, i load the script into Query Browser app. Change the $$ delimiter to //, run it, change it back to $$ and it works, yeah?

Depends on what delimiter you used inside your script file. If it is //, then yes. If it is $$, then:

Change the $$ delimiter to //,

load the script into Query Browser app,

change it back to $$,

run it

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • RoboForm 9.7.5 by Razvan Serea RoboForm is the top-rated Password Manager and Web Form Filler that completely automates password entering and form filling. RoboForm makes logging into Web sites and filling forms faster, easier, and more secure. RoboForm memorizes and securely stores each user name and password the first time you log into a site, then automatically supplies them when you return. RoboForm's powerful Logins feature eliminates the manual steps of logging into any online account. With just one click RoboForm will navigate to a Web site, enter your username and password and click the submit button for you. Completing long registration or checkout forms is also a breeze. Simply click on your RoboForm Identity and RoboForm fills-in the entire form for you. You no longer need to remember all your passwords. You remember one Master Password, and RoboForm remembers the rest. This allows you to use stronger passwords, making your online experience more secure. RoboForm uses strong AES encryption for complete data security. The all new RoboForm comes with Chrome and Safari browser support, iPhone/iPad and Android support, as well a brand new RoboForm Everywhere license for use on unlimited computers and mobile devices. RoboForm 9.7.5 changelog: Prepared for the upcoming RoboForm browser extension with New Auth. Download: RoboForm 9.7.5 | 42.1 MB (Free, paid upgrade available) View: RoboForm Website Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • NTLite 2025.06.10460 is out.
    • I understand. I am not talking about benchmarks at all, even though I probably should look into those too - I just mean historically Vivaldi was a rather sluggish chromium browser when in use compared to other chromium browsers. I am always willing to give it additional tries whenever performance improvements are mentioned in the patch notes.
    • First make whole system slow and now making it fast. That's your own doing-undoing !!
  • Recent Achievements

    • One Year In
      Vladimir Migunov earned a badge
      One Year In
    • One Month Later
      daelos earned a badge
      One Month Later
    • Week One Done
      daelos earned a badge
      Week One Done
    • Mentor
      Karlston went up a rank
      Mentor
    • One Month Later
      EdwardFranciscoVilla earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      493
    2. 2
      snowy owl
      252
    3. 3
      +FloatingFatMan
      250
    4. 4
      ATLien_0
      225
    5. 5
      +Edouard
      180
  • Tell a friend

    Love Neowin? Tell a friend!