Stan Cook wrote:[color=blue]
> How do you write a query which will stop ans wait for user input?[/color]
If you mean something like the Oracle "&" prompt for user input in
SQL*Plus, I don't think the MySQL command-line interface has that feature.
You need to do this in some kind of application code. Prompt the user
for input using your favorite programming language, use their input
while constructing a SQL query, then execute that query.
Example in Bourne shell:
:
echo -n "Enter a value: "
read value
mysql mydatabase -e "select * from mytable where myfield = '$value';'
Bill Karwin <bill@karwin.co m> wrote:[color=blue]
>Stan Cook wrote:
>[color=green]
>> How do you write a query which will stop ans wait for user input?[/color]
>
>
>If you mean something like the Oracle "&" prompt for user input in SQL*Plus, I don't think the MySQL command-line interface has that feature.
>
>You need to do this in some kind of application code. Prompt the user for input using your favorite programming language, use their input while constructing a SQL query, then execute that query.
>
>Example in Bourne shell:
>
> :
> echo -n "Enter a value: "
> read value
> mysql mydatabase -e "select * from mytable where myfield = '$value';'
>
>(nb: example not tested)
>
>Regards,
>Bill K.[/color]
Comment