Forum > Database

[CLOSED] Firebird-SQL

<< < (4/4)

rvk:
He could also just create fields for those KEY_NAMEs in SAMPLES itself
if for every record in SAMPLES there is only one record per KEY_NAME.

But that goes against the principle of normalizing the database  ::)

Zvoni:
I think he wrote early on, that he can‘t do that since the „column“-name (key) might change

rvk:

--- Quote from: Zvoni on April 09, 2023, 06:13:42 am ---I think he wrote early on, that he can‘t do that since the „column“-name (key) might change

--- End quote ---

Yes

--- Quote from: egsuh on April 03, 2023, 03:24:05 pm ---Yes, this design is ugly. I've not implemented yet. Just thinking over. Problem is the "property" names may change, so that I cannot fix fields at design time.
--- End quote ---

But when that happens... ANY SQL with fixed values of KEY_NAME will become invalid too.

Yes, you can put those fields in a json blob, but you'll loose the ability to do a select on them (if you used the values).

And putting only the key_names there is kind of useless because a simple

--- Code: SQL  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---SELECT DISTINCT KEY_NAME FROM SAMPLE_DATAwill retrieve the key names too after which you can build the SQL.


egsuh:
Thanks a lot for all the advices.
There would be many projects, and the key_names will differ from project to project, but the same within each project.
I can manage it by creating or altering a view for each project. Record numbers would not be "very" large. Possibly there might be several hundred K projects, but in most cases hundreds or thousands, at most. Only have to write "saving" procedures. Many thanks again. 

Navigation

[0] Message Index

[*] Previous page

Go to full version