Subject Steps for Bulk insert / upload text file for INSERT from EXT TABLE
Author blizzardb2001
I am trying to insert a list of seats (e.g. 01A, 02A .. 06P) into TblSeats on the server.
So to insert say, 96 seats (01A to 06P) means 96 inserts and it's taking a long time, especially in the field where internet access may be lousy.

From what I understand my options are:
1. Stored Procedure or
2. Upload a TXT file into a temporary table on the Firebird Server, and get it to do the insert that way.

Problem with 1 is that the creation of the seat name is hard to translate into STORED PROCEDURE code (you can get an idea of the Delphi code for this below if you like).

problem with 2 is I don't know how. Can you provide some proper instructions? I can generate the TEXT file without your help but I'll need to know the format.

Below is the Delphi code in case you can do a stored procedure:
============
//Explanation: The user gives 3 inputs: 1. The device ID, 2. The number of Rows (e.g. 15 as in A to P) 3. The number of columns (e.g. 6 as in 1 to 6)

k := edtRows.AsInteger;
l := edtColumns.AsInteger;
with QrySeats do
begin
for j := 1 to l do
for i := 1 to k do
begin
insert;
fieldbyname('DeviceID').asinteger := QryDevice.FieldByName('ID').AsInteger;
if length(inttostr(i)) > 1 then
fieldbyname('SeatNumber').AsString := inttostr(i) + Char(65 + j - 1)
else
fieldbyname('SeatNumber').AsString := '0' + inttostr(i) + Char(65 + j - 1);
post;
end;
end;