Board index » delphi » Exporting from Interbase 6.01

Exporting from Interbase 6.01

Hi guys,

I need a product that allows me to pump my main interbase table into comma
delimited text. I am having huge problems doing this so far.

The table is 2.7m records and 42 fields (about 800mb of text)

So far I have tried to build my own delphi based apps for this but both
produce inconsistant results with various numbers of records missing.

First I used 'save to text' function of DevExpresses Quantum Grid Suite, its
fast but loses records, then I used the SME export suite, which is terribly
slow and loses records too. Both I'm sure are fine for smaller datasets.

I tried using datapump that comes with delphi setting up a standard alias
with an ASCCII driver, thats no good, the text file it produces isnt
delimited.

Any ideas/products out there?

Cheers,

Andy.

 

Re:Exporting from Interbase 6.01


Have you tried EMS QuickExport http://www.quickexport.net or any
third-party Interbase Administration Tool (EMS QuickDesk, IB Expert, ...)?

Thomas

"Andy Murphy" <a...@rating-software-company.co.uk> schrieb im Newsbeitrag
news:3bf10ae9_1@dnews...

Quote
> Hi guys,

> I need a product that allows me to pump my main interbase table into comma
> delimited text. I am having huge problems doing this so far.

> The table is 2.7m records and 42 fields (about 800mb of text)

> So far I have tried to build my own delphi based apps for this but both
> produce inconsistant results with various numbers of records missing.

> First I used 'save to text' function of DevExpresses Quantum Grid Suite,
its
> fast but loses records, then I used the SME export suite, which is
terribly
> slow and loses records too. Both I'm sure are fine for smaller datasets.

> I tried using datapump that comes with delphi setting up a standard alias
> with an ASCCII driver, thats no good, the text file it produces isnt
> delimited.

> Any ideas/products out there?

> Cheers,

> Andy.

Re:Exporting from Interbase 6.01


If you want to do the export in Delphi you can try the code at the end of
this message. If yo want to use the DataPump try creating the empty ASCII
file and schema file first and see if you can get comma delimited output.
That works with the BatchMove component but I have not tried it with
DataPump.

procedure dgExportTableDelimited(
            DataSet: TDataSet;
            AsciiFilePath: String;
            Delimiter, Separator: Char);
{Exports a dataset as a delimited text file.
 Parameters:
   DataSet:       The data to be exported.
   AsciiFilePath: The text file path and name.
   Delimiter:     The character placed around non-
                  numeric field values, usually a
                  double quotation mark.
   Separator:     The character placed between
                  fields, usually a comma.

Quote
}

var
  AsciiFile:   System.Text;
  I:           Integer;
  LastField:   Integer;
begin
  Assign(AsciiFile, AsciiFilePath);
  Rewrite(AsciiFile);
  LastField := DataSet.FieldCount - 1;
  while not DataSet.EOF do
  begin
    for I := 0 to LastField do
    begin
      {If the field is not numeric write the opening
       delimiter character.}
      if not (DataSet.Fields[I].DataType in
        [ftBCD, ftCurrency, ftFloat, ftInteger, ftSmallInt, ftWord]) then
        Write(AsciiFile, Delimiter);
      {Write the field value.}
      Write(AsciiFile, DataSet.Fields[I].AsString);
      {If the field type is not numeric write the
       closing delimiter character.}
      if not (DataSet.Fields[I].DataType in
        [ftBCD, ftCurrency, ftFloat, ftInteger, ftSmallInt, ftWord]) then
        Write(AsciiFile, Delimiter);
      {If this is not the last field write the
       separator character.}
      if I < LastField then
        Write(AsciiFile, Separator);
    end; {for}
    {Write the carriage/line feed at the end of
     this record.}
    Writeln(AsciiFile, '');
    DataSet.Next;
  end; {while}
  System.Close(AsciiFile);
end;

--
Bill
(TeamB cannot answer questions received via email)

Re:Exporting from Interbase 6.01


No I havent, thanks i'll have a look.
Do any of these do the pump the other way round ?

i.e. asterix delimited text to IB?

Thanks,

Andy

Re:Exporting from Interbase 6.01


Many thanks Bill, I will give it a try.

Re:Exporting from Interbase 6.01


Quote
Andy Murphy wrote:
> I need a product that allows me to pump my main interbase table into comma
> delimited text. I am having huge problems doing this so far.

You could try IB_ISQL (freeware from www.ibobjects.com).  You can set
options for text delimiter, separator and date/time format.

Regards,
Aage J.

Re:Exporting from Interbase 6.01


Quote
Andy Murphy wrote:

> No I havent, thanks i'll have a look.
> Do any of these do the pump the other way round ?

> i.e. asterix delimited text to IB?

        TIBImportDelimitedFile in IBX does this.  Help is on the "Example" link
in the help for TIBBatch.

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Re:Exporting from Interbase 6.01


Thanks Craig I'll look into it, I tend to  use IBO but theres always a first
time <g>

Re:Exporting from Interbase 6.01


Thanks

Re:Exporting from Interbase 6.01


Hmm I looked into it, it doesnt give any examples of how to use it in
anyway,

Anyone any ideas how to use TIBInputDelimitedText ?

Re:Exporting from Interbase 6.01


Quote
Andy Murphy wrote:

> Anyone any ideas how to use TIBInputDelimitedText ?

        ...as I wrote in my message:

Quote
"Craig Stuntz (TeamB)" wrote:

>         Help is on the "Example" link in the help for TIBBatch.

        :)

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Re:Exporting from Interbase 6.01


yeah ive seen that, that example is about:
TIBInputRawFile;

I'm after some examples of how to use:

TIBImportDelimitedFile;

as per usual the high quality delphi help gives:

TIBInputDelimitedFile performs batch input of data from delimited files.

Unit

Description

Use a TIBInputDelimitedFile object to perform batch input of data from
delimited files.

which dont really help much at all.

At the moment i'm bouncing 6m records (* delimited) into MSAcess97 and then
using datapump to pump them into IB every two months, there has gotta be a
better way to do this.

All ideas much appreciated.

Thanks.

Re:Exporting from Interbase 6.01


Actually further to that, I did just try the RAW example from the TIBatch
Help page, and it wouldn't compile.

Delphi had no idea what a 'TIBInputRawFile' was.

Thanks

Re:Exporting from Interbase 6.01


Quote
Andy Murphy wrote:

> yeah ive seen that, that example is about:
> TIBInputRawFile;

> I'm after some examples of how to use:

> TIBImportDelimitedFile;

        Well, it's nearly identical (they are both subclasses of the same
component), but this question should really be in
borland.public.delphi.database.interbaseexpress.

Quote
> Actually further to that, I did just try the RAW example from the TIBatch
> Help page, and it wouldn't compile.

> Delphi had no idea what a 'TIBInputRawFile' was.

        Then you need to add IBSQL to your uses clause.

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Re:Exporting from Interbase 6.01


Thanks. I knew it would be something stupid like that <g>

Other Threads