Hi,
I have a simple Paradox table:
CREATE TABLE A_TEST
(
Item CHAR(30),
ItemValue INTEGER,
PRIMARY KEY (Item)
)
And a similar table in PostgreSQL but the itemvalue field a bigint rather than integer.
When I call UniLoader.LoadFromDataset I get the error:
EPgError with message 'insufficient data left in message'
It works OK if I have integer in source and destination tables.
Is there a way I can load integer field values into the bigint fields on PostgreSQL please?
Regards, Paul.
PostgreSQL and UniLoader
Hello
I created the follow table:
And insert data by the following code:
All data was inserted successfully.
You can try to insert your data by the following code:
I created the follow table:
Code: Select all
CREATE TABLE my_test
(
Item character(30) NOT NULL,
ItemIntValue integer,
ItemBigIntValue bigint,
CONSTRAINT pk_my_test PRIMARY KEY (item)
)
Code: Select all
procedure TForm1.UniLoader1PutData(Sender: TDALoader);
var
i: integer;
begin
for i := 1 to 10 do
begin
UniLoader1.PutColumnData('Item', i, 'item' + IntToStr(i));
UniLoader1.PutColumnData('ItemIntValue', i, i);
UniLoader1.PutColumnData('ItemBigIntValue', i, i);
end;
end;
You can try to insert your data by the following code:
Code: Select all
procedure TForm1.UniLoader1PutData(Sender: TDALoader);
begin
SourceDataSet.First;
while not SourceDataSet.Eof do
begin
UniLoader1.PutColumnData('Item', SourceDataSet.RecNo, SourceDataSet.FieldByName('Item').AsVariant);
UniLoader1.PutColumnData('ItemValue', SourceDataSet.RecNo, SourceDataSet.FieldByName('ItemValue').AsVariant);
SourceDataSet.Next;
end;
end;