Sorry for my English first of all. I have a problem and need help. I have a simple tool made by myself on c#. This tool makes connect to local or remote firebird server (v.2.5). And my tool can create specified .fdb file (database) somewhere on the server.
Also i have a file with sql-statements (create table, triggers and so on). I want to execute this file after database was created. Executing this file will fill stucture of user database - not data, only structure. But then i try to execute my sql-script - firebird server sends me Sql Error Code = -104 Token unknow line xxx column xxx. Thats lines and columns pointered me on next create-table sql statement, for example:
CREATE TABLE tb1(
col1 INTEGER NOT NULL,
col2 VARCHAR(36)
);
/* On next create statement will be an error */
CREATE TABLE tb2(
col1 INTEGER NOT NULL,
col2 VARCHAR(36)
);
If i will leave only one create statement in my file - all will be good... I don't know how i explained (it's clear or not)) - another words - why i can't execute full query with many create statements by one transaction? There is my main method wich executes quiry:
public static string Do(string conString, string query)
{
using (FbConnection conn = new FbConnection())
{
try
{
conn.ConnectionString = conString;
conn.Open();
FbTransaction trans = conn.BeginTransaction();
FbCommand cmd = new FbCommand(query, conn, trans);
cmd.ExecuteNonQuery();
trans.Commit();
}
catch (Exception ex)
{
System.Windows.MessageBox.Show(ex.ToString());
return "Transaction Fail";
}
}
return "Transaction Commited";
}
There is a query is my sql-file.