Subject | Re: [firebird-support] Re: Problem in Bulk Insertion in Firebird - Please Help |
---|---|
Author | Uwe Grauer |
Post date | 2007-02-13T13:26:54Z |
Manish Lal Joshi wrote:
http://www.ibphoenix.com/main.nfs?a=ibphoenix&s=1161533681:8791&page=ibp_native_external
Uwe
> Dear Svein Erling Tysvaer,For the use of external tables look here:
>
> Okai i searched for a while and found out that prepared statements and
> also bulkwise transaction committing can reduce this time taken.
> And i implemented it too.
> Guess what,the performance increased.
> Previously 1 mins 21 secs was required for a particular task.
> But now it only requires 16 secs.
> No as you have suggested for using EXTERNAL TABLES.
> I was exploring that too but i got stuck.
> For test i did it like this:
>
> in C#
> TextWriter twriter = new StreamWriter(@"c:\EXTERNALTABLES\ext1");
> for (int i = 0; i < 10; i++)
> twriter.WriteLine(i);
> twriter.Close();
>
> After that i tried to assign this ext1 file as EXTERNAL TABLE like this
> command.CommandText = @"CREATE TABLE TEMP1 EXTERNAL FILE
> 'c:\EXTERNALTABLES\ext1'(ID INTEGER);";
> command.ExecuteNonQuery();
>
> It exexuted well but
> when i tried to query table TEMP1 then i returned result but
> not as expected.
> It gave me garbage result
> I did it like this:
> command.CommandText = @"SELECT ID FROM TEMP1";
> FbDataReader reader= command.ExecuteReader();
> while (reader.Read())
> {
> int iii=reader.GetInt32(0);
> }
>
> The outputs were:
> 822742320
> 221383181
> 168637194
> 889851188
> ..
> ..
>
> I think i am missing something..
> Like the structure of file that i have to define.. but how..?
> Please help me if you know..?
>
> I want to compare all the results and then implement the method..
>
> Thanks
>
>
http://www.ibphoenix.com/main.nfs?a=ibphoenix&s=1161533681:8791&page=ibp_native_external
Uwe