I have an sql file with certain parameters which I need to make as generic ones.
Below is the code base in C:\sql\main.sql:
SET @NAME = 'XYZ'
source C:/abc.sql
I need all the occurences of NAME to be replaced by XYZ in abc.sql file.Which basically contains a set of insert statements.I ran the below command :
mysql -u myusername -p DB < C:\sql\main.sql
But after executing it throws and error saying:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE C:/abc' at line 2
All I need to do is call an sql file C:\abc.sql in C:\sql\main.sql and then execute C:\sql\main.sql . Can anyone help me on this?