Reputation: 109
I am using erlang odbc module to connect to mysql and it is working fine for almost all my commands like insert,delete,create,use,drop . But here i need to use the source command to load a file which contain all the commands like create and use database and create some 10 tables... but when i use it like odbc:sql_query(Database_Connection,"source filename")
i am getting error and getting disconnected. The file is present in the current directory, i tried giving both the absolute and relative path to the file. PLease do suggest how to use the source command in erlang odbc.
Upvotes: 0
Views: 263
Reputation: 700
'source' is MySQL CLI command rather than SQL one. I haven't used erlang ODBC personally, but I had similar problem when using JDBC. As far as I remember there was no other option but reading the SQL script, splitting it into separate statements and running them separately one by one.
Upvotes: 1
Reputation: 5998
there is no such 'source' sql command in mysql.
There is 'source' command in the mysql shell utlility. But it's just a command for mysql shell (to read and send sql commands to server).
Upvotes: 2