Click to See Complete Forum and Search --> : SQL File highlighting, impossible?


halojoy
09-25-2007, 05:07 PM
hi

I have like half a dozen editors.
Some are dedicated PHP, even commercial softwares.

I tried to view one .sql file and see if it was highlighted correctly.
But no!
Noone of these editors could correctly color the syntax of my sql file.
The problem seems to be:
\' and \\
Espcially bbcode smilies can corrupt highlighting, as well as Mother's Day.

:) If you find an editor that manage sql colors correctly,
Congratulations!
.... and please do inform me here

laserlight
09-26-2007, 07:59 AM
Any specific examples? I note that \' is not the standard way of escaping single quotes in SQL. '' (two consecutive single quotes) is the standard way.

halojoy
09-26-2007, 09:30 AM
I dont know what you mean by examples ...
I gave those examples I have seen breaks the color highlighting
in all those editors I tested ... A couple with very advanced PHP Editor functions.

So, you say that those dumps of MYSQL tables are non-standard SQL?
I will try to replace \' with 2single quotes and have a new look.

:)

stolzyboy
09-27-2007, 04:49 PM
Open up a properly formatted .sql file with notepad++. It highlights stuff like INSERT, UPDATE, SELECT, FROM, WHERE, etc...

Sxooter
09-27-2007, 06:41 PM
I dont know what you mean by examples ...
I gave those examples I have seen breaks the color highlighting
in all those editors I tested ... A couple with very advanced PHP Editor functions.

So, you say that those dumps of MYSQL tables are non-standard SQL?


Without a smilie face I can't tell whether you're joking or not. A large percentage of what comes out of MySQL is non-standard SQL. ` is not an identifier quote, " is...


I will try to replace \' with 2single quotes and have a new look.
:)

I use the text editor that comes with gnome in Fedora Core 2 (which is positively, creakily ancient) and it highlights SQL very well. It also highlights bash / sh quite nicely too.

halojoy
09-27-2007, 09:37 PM
I use the text editor that comes with gnome in Fedora Core 2 (which is positively, creakily ancient) and it highlights SQL very well. It also highlights bash / sh quite nicely too.
I know not much of MySQL or SQL. ... and I do not want know :evilgrin:
My use is practically limited to import and run sql query from files. Using phpMyAdmin.
You know those setup.sql for install some php application.

It was when doing this, and having a look at the sql code in my editor,
I discovered that the highlighting was only working until a line with single quote in.
And same in all other 5-6 editors I have.
If I was in Linux OS, I would test that gnome editor.
But for the time I use XP :eek:

Sxooter
09-27-2007, 10:13 PM
I know not much of MySQL or SQL. ... and I do not want know :evilgrin:
My use is practically limited to import and run sql query from files. Using phpMyAdmin.
You know those setup.sql for install some php application.

It was when doing this, and having a look at the sql code in my editor,
I discovered that the highlighting was only working until a line with single quote in.
And same in all other 5-6 editors I have.
If I was in Linux OS, I would test that gnome editor.
But for the time I use XP :eek:

Works fine for me, been using it for 3 years now.

But I use postgresql, where \' is not an escaped ' anymore, so I use '' for that and it works fine.

SQL is an amazing language, you'd be doing yourself a favor to learn at least a little of it.