MySQL Forums
Forum List  »  Newbie

User passed variables in sql scripts
Posted by: Fernando Salgado
Date: March 28, 2005 09:03AM

Hi,

I Need to make an sql script to erase data based on time, to do so i need the user to tell me how long should i keep old data, this should look like this:

Script: "Erase data longer than: (months)"
User: 12
Script "DELETE FROM DATA WHERE TIME < DATE_SUB(CURDATE(),INTERVAL 12 MONTH)"

How do i get the user typed value and put it into the script, using mysql command line client?

If mysql command line client canĀ“t do that, wich program can i use to do that?

Thanks!!

Options: ReplyQuote


Subject
Written By
Posted
User passed variables in sql scripts
March 28, 2005 09:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.