Page 1 of 1

Firebird 2 - TIBCLoader - Boolean

Posted: Wed 27 Jan 2016 14:09
by Jean-Christophe
Hello,

I have a dataset with several Boolean Fields i need to transpose into a Firebird 2.3 to 2.5.5 database.

Declaring fields and executing TIBCLoader is really easy but how can I handle Boolean fields ?

Many thanks in advance for any hint or example you can provide me with.

Re: Firebird 2 - TIBCLoader - Boolean

Posted: Tue 02 Feb 2016 07:53
by Jean-Christophe
I was using "LoadFromDataset", but using "Load" with "OnGetColumnData" did the job, while locating myself the data like this :

Code: Select all

if Row<>myIBCQuery.RecNo then myIBCQuery.RecNo := Row;
Is locating the rec number the good way, or does it take too much time for the procedure to be efficient ?

Re: Firebird 2 - TIBCLoader - Boolean

Posted: Fri 12 Feb 2016 13:28
by ViktorV
Please clarify the point of your question concerning work with boolean fields.
To load data using the Load method and the OnGetColumnData event handler, you can use the following recommendations:
1. Execute myIBCQuery.First before calling the TIBCLoader.Load method.
2. In the OnGetColumnData event handler, execute the following code:

Code: Select all

procedure TForm.IBCLoaderGetColumnData(Sender: TObject;
  Column: TDAColumn; Row: Integer; var Value: Variant; var IsEOF: Boolean);
begin
  IsEOF := Row > myIBCQuery.RecordCount;
  Value := myIBCQuery.Fields[Column.Index].Value;
  if (Column.Index = myIBCQuery.FieldCount - 1) and (Row < myIBCQuery.RecordCount) then
    myIBCQuery.Next;
end;