If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > query with parameter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-13-08, 09:24
dimis2500 dimis2500 is offline
Registered User
 
Join Date: Jan 2005
Posts: 362
query with parameter

I use mysql command prompt and I use the query with parameter as oracle, meaning type
Code:
select a from mytable where a=@a
where @a I will give at command prompt when the prompt will ask for that, how can I do that?
Reply With Quote
  #2 (permalink)  
Old 05-13-08, 10:08
dimis2500 dimis2500 is offline
Registered User
 
Join Date: Jan 2005
Posts: 362
I find this
Code:
PREPARE stmt1 FROM 'SELECT * from `shop3` where dealer=?';
 SET @a = 'a';
 EXECUTE stmt1 USING @a;
 DEALLOCATE PREPARE stmt1;
How can I set the command promp to ask for the value?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On