Board index » delphi » How to create a Interbase table at runtime?

How to create a Interbase table at runtime?

In the application I have to give user the possibility of creating a new
Interbase table based on the selection from a set of columns (or fields)
together with their respective types.

As far as I know, in dBASE III, one can first create a database composed
of all the information,  such as filed name, field type, field length,
decimal place, about the database which is going to be created. Then use
the command CREATE DatabaseName EXTENDED.

How to implement the same task in Delphi?

Thank you,

Minghui Wang

 

Re:How to create a Interbase table at runtime?


Quote
Wang <w...@amadeus.statistik.uni-dortmund.de> wrote:
>In the application I have to give user the possibility of creating a new
>Interbase table based on the selection from a set of columns (or fields)
>together with their respective types.

>As far as I know, in dBASE III, one can first create a database composed
>of all the information,  such as filed name, field type, field length,
>decimal place, about the database which is going to be created. Then use
>the command CREATE DatabaseName EXTENDED.

>How to implement the same task in Delphi?

>Thank you,

Wang,

You would have to write your own code to assemble the elements. Your
logic would have to have a list of types and other syntax elements and
you would have to create the string for the CREATE TABLE command.
(Perhaps someone will be able to suggest a component or utility that
does this.)

Once you have the string, however, the problem is how to use it. I
have never tried this, but you may be able to do this in a query using
the ExecSQL method instead of Open. Put the string in the SQL property
and use the ExecSQL method to launch it.

It may also be possible to do this with a stored procedure and tables
like you suggest for dBase III, but I don't know the technique.

Phil Cain

--

Other Threads