Subject Re: [IBO] BatchOutput/Input
Author Helen Borrie
At 12:12 AM 26/02/2004 -0600, you wrote:
>I'm sending this again. Lost part of the message in the last post:
>
>"Helen Borrie" <helebor@...> wrote in message
>news:5.2.0.9.2.20040226154541.0207bfe8@......
> > At 10:28 PM 25/02/2004 -0600, you wrote:
> > >It would be nice if IBO had a BatchOutput/Input like IBX does. This is a
> > >convenient way to transfer data samples from one site to another without
> > >sending the whole table. The nice thing about IBX's feature is that it
>can
> > >include the blob fields.
> > >
> > >If their is a way to do this in IBO, please let me know.
> >
> > What exactly does it do?
>
>It will export the query result to a text file or raw data file. Then you
>can send it to the remote site and import the same file. Works even if some
>of the fields are blobs. These are methods of the TIBSQL component of IBX.
>
>Assume that you have two IBDatabase connections with an IBSQL component
>associated with each (named IBSQL1 and IBSQL2, here). The connections are
>active and transactions started. The columns described by the select
>statement and the insert statement must be of the same size and type for a
>"RAW" transfer.
>
>Here is a raw file conversion example:
>
>procedure TForm1.Button1Click(Sender: TObject);
>
>var
> Filename : String;
> RawOutput : TIBOutputRawFile;
> RawInput : TIBInputRawFile;
>begin
> IBSQL1.Sql.Text := 'Select firstname, lastname from people';
> IBSQL2.Sql.Text := 'Insert into people (firstname, lastname) values
>(:first, :last)';
> Filename := 'DataFile.RAW';
> RawOutput:= TIBOutputRawFile.Create;
> try
> RawOutput.FileName := FileName;
> IBSQL1.BatchOutput(RawOutput);
> finally
> RawOutput.Free;
> end;
>
> RawInput := TIBInputRawFile.Create;
> try
> RawInput.FileName := FileName;
> IBSQL2.BatchInput(RawInput);
> finally
> RawInput.Free;
> end;
> IBSQL2.Transaction.CommitRetaining;
>end;

OK, what's described above is just the TIB_Datapump component. It has a
selecting tib_cursor for the source query and an executing tib_cursor for
the destination. You can replace or add rows in the destination.

Datapump out and datapump in == batch output/input

It looks as if IBX is borrowing the old BDE's terminology for exporting -
"BatchMove", etc. which, as I recall, the BDE borrowed from dear old native
Paradox and THAT goes back to before some of you little darlings were born
:-) Anything that targets more than one row is a "batch". LOL!

I'd be intrigued to know about "exporting data including blobs to a text
file". A text blob to a text file I can relate to. An image blob to an
image file I can relate to. An image blob transported as a text file using
blob filters to convert it to/from CHARACTER SET OCTETS for transporting I
can relate to. Casting regular data to character and exporting it as
delimited or fixed format text records I can relate to. But something like
a text format that includes both data and blobs I can't relate to...maybe
they have some Paradox-ish format that keys a "blob file" to a text file
containing ordinary data...or maybe a kind of "mini-gbak".

Helen