Groups | Search | Server Info | Login | Register


Groups > comp.databases > #105

Re: OS-SQL-Grammar?

From Dieter Nöth <dnoeth@gmx.de>
Newsgroups de.comp.datenbanken.misc, comp.databases, comp.databases.theory
Subject Re: OS-SQL-Grammar?
Date 2011-07-07 10:04 +0200
Organization albasani.net
Message-ID <iv3pa5$gol$1@news.albasani.net> (permalink)
References <iv3nf4$jbv$2@dont-email.me>

Cross-posted to 3 groups.

Show all headers | View raw


Norbert_Paul wrote:

> is there a handy (and parseable) Open Source SQL-grammar around,
> that can be fed into a parser generator without major problems?

Did you try the BNF grammar files at
http://savage.net.au/SQL/index.html

If you happen to succeed could you please post a "how-to"?
I was looking for the same stuff some years ago (to implement a source 
code beautifier) and i failed.

> I consider ISO 9075:2003 useless for this purpose and don't get
> the point of this "standard".

They just have the wording of a law code and you must be a lawyer (or 
similar) to actually read (and understand) more than just a few 
paragraphs ;-)

> Is the following string
>
> "/* this is */ a strange comment */"
>
> a valid SQL-Comment (according to SQL 2003)?

No.
If you don't remove the double quotes it's an (very strange) identifier 
and if you remove them it should result in a syntax error because the 
comment ends after the first "*/".

The standard defines nested comments, but not all DBMSes support them:
"/* this is a /* nested */ comment */"

You probably wouldn't consider this as a valid string:
'bla' blabla'

Dieter

Back to comp.databases | Previous | NextPrevious in thread | Find similar


Thread

OS-SQL-Grammar? Norbert_Paul <norbertpauls_spambin@yahoo.com> - 2011-07-07 09:32 +0200
  Re: OS-SQL-Grammar? Nessi <nessi@nefkom.info> - 2011-07-07 09:54 +0200
  Re: OS-SQL-Grammar? Dieter Nöth <dnoeth@gmx.de> - 2011-07-07 10:04 +0200

csiph-web