distal-attribute
distal-attribute
distal-attribute
distal-attribute

Rules for choosing a delimiter

kalvaro posted 4 years ago in Running SQL scripts
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 posted 4 years ago
Slash should be safe in PHP code. Back slash would be unsafe i think.
kalvaro posted 4 years ago
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.