how to run ddl commands?

Vortex

Member
Hi, im wondering if there are any way to run ddl commands from an OracleQuery?

I want to create/alter tables from my delphi application instead of starting something like sqlplus.

Any help would be helpful!

//Christer
 
Have a look at the EXECUTE IMMEDIATE command. It allows you to run any SQL including DDL.

the following example is copied from the Oracle Documentation;

BEGIN
EXECUTE IMMEDIATE 'CREATE TABLE bonus (id NUMBER, amt NUMBER)';
END;

NOTE: This is a new feature. It exists in 8.1.5 and 8.1.6 and does not exist in 8.0.4. It is therefore probably a feature of 8i.

[This message has been edited by jpickup (edited 29 January 2001).]
 
Just place your DDL statements int the TOracleQuery.SQL and Execute it. There are no limitations!

------------------
Marco Kalter
Allround Automations
 
Back
Top