I would like to call a .sql file from a .sh file in linux. The .sql file will contain queries to MySQL database.
I am able to call the .sql file by running .sh file in linux, but the sql query is not working. Below is my syntax. The select statement is throwing below error.
./sample.sql: line 4: syntax error near unexpected token `from'
echo "this is shellscript calling sql" ./sample.sql
set pages 999 set lines 999 set colsep | select * from sampletable;
expected result should be similar to a normal select * from xxx statement