dbTalk Databases Forums  

user input

mailing.database.mysql mailing.database.mysql


Discuss user input in the mailing.database.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stan Cook
 
Posts: n/a

Default user input - 04-11-2005 , 07:49 PM






How do you write a query which will stop ans wait
for user input?


Stan

Reply With Quote
  #2  
Old   
Bill Karwin
 
Posts: n/a

Default Re: user input - 04-11-2005 , 09:07 PM






Stan Cook wrote:
Quote:
How do you write a query which will stop ans wait for user input?
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.


Reply With Quote
  #3  
Old   
Stan Cook
 
Posts: n/a

Default Re: user input - 04-11-2005 , 10:34 PM



That's what I suspected.... Thanks...


Regards...
Stan

Bill Karwin <bill (AT) karwin (DOT) com> wrote:
Quote:
Stan Cook wrote:

How do you write a query which will stop ans wait for user input?


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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.