I want to create a deployment script, somehow emulate Oracle deployment scripts, where with the & param parameter you can use the previously declared parameters. I need to call this script for different users in different databases automatically.
For example, my script should be:
USE ¶m; DROP TABLE IF EXISTS `TEST` ; CREATE TABLE IF NOT EXISTS `TEST` (X INT(16)) etc....
Of course, param is what I would use in an Oracle environment.
thanks
Update:
I forgot to mention that I am currently using the Windows environment. I created a script package to call a mysql script. The easiest way, in my opinion, is to go to the mysql 2 command: 1) use the schema that I have as a parameter, and then call the script, which will create the table regardless of the schema. Unfortunately, mysql seems to understand that I want to connect to the X schema, but I don't want to call the script.
REM param is the schema and mainsql is the script SET param="%1" SET mainsql="script.sql" echo %param% echo %mainsql% mysql -u <user> --password=<psw> %param% "source %mainsql%;"
source share