Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Rules for choosing a delimiter

kalvaro's profile image kalvaro posted 9 years ago in Running SQL scripts Permalink
I've noticed that HeidiSQL uses // as delimiter when dumping code for stored routines. Is it a safe choice to use in my own code? I have a little PHP script that generates SQL dumps and I want to make sure the dumps are valid no matter the code.

P.S. Other possibilities seem to be $$ (MySQL Workbench) and ;; (mysqldump).

ansgar's profile image ansgar posted 9 years ago Permalink
Slash should be safe in PHP code. Back slash would be unsafe i think.
kalvaro's profile image kalvaro posted 9 years ago Permalink
I was referring to the script output, not the PHP code itself. I guess I'll try double slash: it's not a valid syntax element in SQL and I suppose it doesn't count as delimiter if it's found inside a comment or a quoted string.

Please login to leave a reply, or register at first.