Forum > Database

autofill columns - question

(1/1)

secretk:
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)

valdir.marcos:

--- Quote from: 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)
--- End quote ---
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.

orionyx:
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.

Navigation

[0] Message Index

Go to full version