[Lazarus] data matrix with thousands of columns
Leonardo M. Ramé
l.rame at griensu.com
Wed Mar 27 01:08:04 CET 2013
On 2013-03-26 21:22:26 +0100, Andrea Mauri wrote:
>
> >>
> >If you think you'll be adding columns regularly, one solution that comes
> >to my mind is this:
> >
> >1) Create a "data_columns" table:
> >
> >create table data_columns(
> > idcolumn integer,
> > column_name varchar(20),
> > primary key(idcolumn));
> >
> >2) Create the "data_rows" table:
> >
> >create table data_rows(
> > idrow integer,
> > idcolumn integer,
> > value varchar(100),
> > primary key(idrow)
> >);
> >alter table data_rows add constraint fk_idcolum foreign key(idcolumn)
> >references data_columns(idcolumn);
>
> I tried something like this but I have to insert millions of entries
> when application is running and this solution will slow enormously
> the app.
> >
>
If you know the columns in advance, nothing stops you from creating such
large tables.
--
Leonardo M. Ramé
http://leonardorame.blogspot.com
More information about the Lazarus
mailing list