Subject RE: [firebird-support] Re: Problem in Bulk Insertion in Firebird - Please Help
Author Alan McDonald
> > > Now after i created the external table,
> > > i queried the table like select col1,col2 from ext_table
> > > while(reader.read())
> > > {
> > > (a) getvalues
> > > (b) typecast it
> > > (c) insert into my real table.
> > > }
> > Here is where you have made a mistake...
> > Use the server to do the work.
> > Use a single statement to insert all rows from your external table,
> > something like:
> > insert into Table (ColumnA, ColumnB, ColumnC) select ColumnA, ColumnB,
> > ColumnC from ExternalTable
> But i also have to typecast the columns values.
> In my external table two fields are of type char[19] and char[256];
> They contain biginteger value and string each
> Now my internal table contains bigint and varchar()
> so i have to contert the values to these before inserting..
>
> Any idea..? Please help me..

if you have an external table, then ALL fields are of type CHAR.
They will be typecast automatically to the internal field type upon
insertion.
You will get exceptions if the values can;t be converted.
Alan