Home > database >  Dynamic SQL table
Dynamic SQL table

Time:09-29

In powbuilder, dynamically create a table, which requires the name of the user can own named table, SQL statements should be how to write?

CodePudding user response:

Pick up points

CodePudding user response:

Give you an example:
The CREATE TABLE S
(SNO CHAR (4) NOT NULL,
SNAME CHAR (20) NOT NULL,
SADDR CHAR (20)
PRIMARY KEY (SNO));

CodePudding user response:

I want s to change, is every building table let s into a character I want to do

CodePudding user response:

How no one answered

CodePudding user response:

The SQL statements embedded into a function,
User's table name through a user interface to function parameters,

CodePudding user response:

How to do ah, don't understand

CodePudding user response:

To study the

CodePudding user response:

Still don't understand, function should be how to write

CodePudding user response:

Give you a suggestion:

You'd better build two tables in database (or three)

Respectively is:
1, tabledictionary keep information such as the table name
2, columndictionary save field name information, if save the field type and length etc. There is no need for a third table, otherwise you can keep the field type and so on to the third list
3, the COLUMNATTRIBUTE preservation field type and length, etc.

Through these two or three tables can manage with the custom table, as to build table statements need according to the different database to dynamically build, this should not be too difficult
  • Related