Subject | Re: [IBO] BatchOutput/Input |
---|---|
Author | Don Gollahon |
Post date | 2004-02-26T06:12:16Z |
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@......
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;
_________________________________________
Don Gollahon
dlgllhn@...
ICQ#: 115831669
"What in Eternity does it matter?"
_________________________________________
"Helen Borrie" <helebor@...> wrote in message
news:5.2.0.9.2.20040226154541.0207bfe8@......
> At 10:28 PM 25/02/2004 -0600, you wrote:can
> >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
> >include the blob fields.It will export the query result to a text file or raw data file. Then you
> >
> >If their is a way to do this in IBO, please let me know.
>
> What exactly does it do?
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;
>--
> Helen
>
>
_________________________________________
Don Gollahon
dlgllhn@...
ICQ#: 115831669
"What in Eternity does it matter?"
_________________________________________