Lazarus

Free Pascal => Database => Topic started by: secretk on September 05, 2018, 09:25:43 pm

Title: autofill columns - question
Post by: secretk on September 05, 2018, 09:25:43 pm
I have a table in mysql with about 52 columns.

i have a formula that fills the first column with data.
- How can i fill the rest of the column with data based on the formula of the first column without writing the same code 52 times?
- How to do previous but by filling the amount of columns based on a value given in a edit or combobox?

(I use Zeos Access and mysql)
Title: Re: autofill columns - question
Post by: valdir.marcos on September 06, 2018, 12:25:49 am
I have a table in mysql with about 52 columns.

i have a formula that fills the first column with data.
- How can i fill the rest of the column with data based on the formula of the first column without writing the same code 52 times?
- How to do previous but by filling the amount of columns based on a value given in a edit or combobox?

(I use Zeos Access and mysql)
Prepare a small sample with TBufDataset showing where you are now and we will help you to improve that.
Then, you can adapt that for you real MySQL project.
Title: Re: autofill columns - question
Post by: orionyx on September 24, 2018, 11:17:33 pm
First, it looks like what you have is a spreadsheet, not a table.
Any table with 52 columns is probably not renormalized.
Any table where 51 columns can be computed from the first one - which is what you seem to be saying - has 51 redundant columns.
Reconsider your work after a little reading up on database design.
TinyPortal © 2005-2018