[Info-vax] Can DCL be enhanced to report why a qualifier is ambiguous ?
Phillip Helbig undress to reply
helbig at asclothestro.multivax.de
Sat May 29 06:04:05 EDT 2021
In article <s8t1sq$f2e$1 at dont-email.me>,
=?UTF-8?Q?Jan-Erik_S=c3=b6derholm?= <jan-erik.soderholm at telia.com>
writes:
> >>> One of the Linux shells does spell checking. I think its a terrible idea.
> >>
> >> Like this?
> >>
> >> $ sql shwo table
> >> %SQL-I-SPELLCORR, identifier SHWO replaced with SHOW
> >> User tables in database with filename SQL$DATABASE
> >> ARTLAB
> >> DB_SUBMIT
> >> DW101T
> >> ...
> >> ...
> >
> > Now *that's* a bad idea -- automatically substituting what the user said
> > with what s/he might have meant, although I suppose it can't do much
> > damage in a show command.
With SHOW, there is little danger.
> > I hope that that "drool database" doesn't get
> > automatically turned into "drop database" and there went the whole
> > enchilada.
>
> SQL> crea datatase file test;
> %SQL-I-SPELLCORR, identifier DATATASE replaced with DATABASE
> SQL>
>
> SQL> drool datatase file test;
> drool datatase file test;
> ^
> %SQL-F-LOOK_FOR_STMT, Syntax error, looking for a valid SQL
> statement, found DROOL instead
> SQL>
>
>
> SQL> drol datatase file test;
> %SQL-I-SPELLCORR, identifier DROL replaced with DROP
> %SQL-I-SPELLCORR, identifier DATATASE replaced with DATABASE
> SQL>
>
> Have worked like this for 20+ years and I guess there have never
> been any reason to change it.
Note also that, in Rdb, not only are INSERT, DELETE, UPDATE, and
(trivially) SELECT reversible via ROLLBACK, but also things like CREATE
TABLE and, yes, even DROP DATABASE. So even here there is not a huge
danger. Apparently the match has to be pretty close before it is
replaced, and there is little possibility that the intent was actually
something else.
> Note that this is only in the interactive SQL interface, not when
> using SQL in application code.
Right.
More information about the Info-vax
mailing list