MySQL Forums
Forum List  »  General

Passing variable to SQL script
Posted by: Robert Hammer
Date: June 28, 2007 02:50PM


I'd like to pass in a parameter to a sql query at execution time using mysql command line. Something like this:

>mysql -uuser-ppw < run.sql &1='2007-06-28'

Where &1 is part of a where clause in run.sql.

I don't want to use the -e option since the actual SQL is quite long.

I know this can be done in Oracle .. how would I do this with MySql?

Thanks in advance.

Options: ReplyQuote

Written By
Passing variable to SQL script
June 28, 2007 02:50PM

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.