How to load data from another sql file into a main sql file? - MYSQL I am trying to process the scripts dbcreate_f.sql and dbload_f.sql to create and to load data into a script solution6.sql.
I am doing this in MYSQL command line.
In solution6.sql I have two statements:
source dbcreate_f.sql;
source dbload_f.sql;

These two files contain data to create tables and insert data into those tables. These two files are perfectly fine - no errors.
The problem I have though is when I run the actual solution6.sql script in MYSQL command line.
My steps are as shown:
tee solution6.rpt; 
source solution6.sql;

However, when the script processes in the command line I receive this error message everytime data is attempting to be inserted into each tabe:
ERROR 1146 (42S02): Table 'bh576.AIRLINE' doesn't exist 

I have run both the dbcreate_f.sql and dbload_f.sql script in mysql workshop and they run perfectly. The  problem only occurs in the command line interface.
POSSIBILITY #1
You need to check the table to see if it is damaged or corrupt
Please run the following:
USE bh576
SHOW TABLES LIKE 'AIRLINE';
SHOW CREATE TABLE AIRLINE \G

The first 2 Lines will verify the presence of AIRLINE.frm
The SHOW CREATE TABLE AIRLINE \G will reach out and attempt to retrieve AIRLINE.frm metadata. If this command complains by giving you that error
ERROR 1146 (42S02): Table 'bh576.AIRLINE' doesn't exist

Then, the table is broken in terms of its attachment to the InnoDB data dictionary.
If you get this to work in MySQL Workshop every time, then a corrupt table is not the problem.
POSSIBILITY #2
You need to make sure you are standing in a database.
It may be possible that the target database is not set in the dbcreate_f.sql script.
Before running the scripts, run this:
mysql&gt; SELECT database();

This should return the name of the database you are loading.
If this comes back as NULL just change to the target database before running
USE mydb
source dbcreate_f.sql
source dbload_f.sql