Hello,
I'm playing with TSQLite3DataSet. This is quite interesting. Like following codes, by setting (database) filename as ":memory:" it runs only within memory (as if TBufDataSet of Lazarus).
procedure TForm1.Button1Click(Sender: TObject);
var
ti: integer;
ts : string;
begin
with SQLite3DataSet1 do begin
filename := ':memory:';
TableName := 'ATest';
for ti := 0 to 150 do
FieldDefs.Add(Format('F_%d',[ti]), ftInteger);
if CreateTable then begin
Active := True;
for ti := 0 to 20 do begin
Append;
fieldbyname('f_0').AsInteger := ti;
fieldbyname('f_8').AsInteger := ti * 100;
Post;
end;
end
else showmessage('create table failed');
end;
// following codes are for saving to CSV file
SQLite3DataSet1.First;
if sd1.execute then begin
CSVExporter1.FileName := sd1.FileName;
CSVExporter1.Dataset := SQLite3DataSet1;
CSVExporter1.Execute;
end;
end;
I have three questions:
1) Does this still require "sqlite.dll"? I assume Yes.
2) I need more than about 2000 fields, up to roughly 5,000. Is there any way that I can set this to around 5000 with TBufDataSet (or any other Lazarus in-memory dataset)? i.e. I need,
for ti := 1 to 3000 do fielddefs.add.
3) SQLite says I can extend the maximum field number to 32767 by "re-compiling" sqlite3. If anybody has done already, can I get a copy of it? I cannot compile C.
And any other options that I can use to extend to more than 2000 columns in DB table format?