Dynamic creation of tables at runtime

Is creating a table dynamically at runtime based on user interactions good or bad for a web application? (I say java, but the question probably refers to more).

+5
source share
5 answers

Tables, as a rule, are crucial for user interaction with the database. Therefore, the lack of tables is fatal.

It follows that creating tables on the fly at runtime is bad practice because it means there is no guarantee for the user. If the CREATE TABLE statement does not work, for some reason the user is populated.

, -, . , .

, . , Oracle , . : , USERNAME , WHERE clause USERNAME=USER.

, DDL , . . : , . .

+3

, . , , .

, , , , .

, , .

+3

SQL-Server, , , .. , , -.

, , - .

0

, - :

table_username(
id, 
userfield1, 
userfield2, 
ect...
)

- :

table_userfields(
id
userid
fieldname
fieldvalue
)

, , , varchar.

, .

0

All in all, this is not a good idea if your users are not good data designers. Most users do not create good database designers. The average user will not think about such things as making the right choice of data types and keys, developing coding schemes, analyzing dependencies, or applying normalization principles. Creating good data models is difficult, so it is usually left to specialists.

0
source

All Articles