I was just wondering why is there a special namespace for running scripts? I
tried to run this script as a command
CREATE TABLE "Version"(
 "ID" int NOT NULL,
 "dbVersion" int NOT NULL,
 CONSTRAINT "pk_Version" PRIMARY KEY ("ID"));
CREATE TABLE "NalogPoslat"(
 "SifraNaloga" char(11) NOT NULL,
 "TipObrasca" smallint NOT NULL,
 "SifraProdajnogMesta" varchar(6) NOT NULL,
 "JMBG" char(13) NOT NULL...
but it gives me an error
Dynamic SQL Error
SQL error code = -104
Token unknown - line 8, char 1
CREATE


so it seems that this is not possible trough FBCommand. Instead, I have to
run my script trough
FirebirdSql.Data.Isql.FbScript script =
                                   new FirebirdSql.Data.Isql.FbScript((
System.IO.TextReader)sr);
                               script.Parse();
                               FirebirdSql.Data.Isql.FbBatchExecution fbe =

                                   new
FirebirdSql.Data.Isql.FbBatchExecution(
                                       (
FirebirdSql.Data.FirebirdClient.FbConnection)global.dbconn);
                               foreach (string cmd in script.Results) {
                                   fbe.SqlStatements.Add(cmd);
                               }
                               fbe.Execute()
and this is working.

However, all the other .NET providers (Sqlite,Npgsql, SqlClient) can do this
- a.k.a run multiple commands in a row from DbCommand object.
Is this Firebird limitation, intentional implementation, or something else?

Regards
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to