[Info-vax] Can DCL be enhanced to report why a qualifier is ambiguous ?
Jan-Erik Söderholm
jan-erik.soderholm at telia.com
Sat May 29 05:35:22 EDT 2021
Den 2021-05-29 kl. 00:57, skrev Craig A. Berry:
>
> On 5/28/21 5:27 PM, Jan-Erik Söderholm wrote:
>> Den 2021-05-28 kl. 20:54, skrev Simon Clubley:
>>
>>>
>>> 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. 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 that this is only in the interactive SQL interface, not when
using SQL in application code.
>
> Using a soundex algorithm or something similar to suggest what might
> have been intended and permitting the user to try again with the
> suggested alternative does make sense and is actually pretty common
> these days. For example:
>
> $ git lob
> git: 'lob' is not a git command. See 'git --help'.
>
> The most similar command is
> log
>
More information about the Info-vax
mailing list