At 10:33 AM -0800 11/29/01, Shankar Unni wrote:
>>Well, Paul, i think he means using source in an .sql script.
>>Yes you can, Shankar. I used it several times for several reasons :)
>>And u can envoke your sql script the same as you use your other
>>-- in source.sql file:
>># or \. query.sql
>Thanks - that last one (using \.) worked. Using "source" doesn't. In
>the above example, if you had the line
> source query.sql
>in source.sql, then you can't do
>mysql> source source.sql
>ERROR 1064: You have an error in your SQL syntax near 'source
>query.sql' on line 1.
> \. query.sql
>works. So that lets me get on with the scripts.. Thanks again.
Ah. If that's the case, then perhaps you are being bitten by the
% mysql --help
Named commands are disabled. Use \* form only, or
use named commands only in the beginning of a line
ending with a semicolon (;) Since version 10.9 the
client now starts with this option ENABLED by
default! Disable with '-G'. Long format commands
still work from the first line.
Named commands are enabled. Opposite to -g.
Note that the "source" line you show above doesn't end with a semicolon.