Link to home
Start Free TrialLog in
Avatar of asi
asi

asked on

Paradox DDL

hello

Is there a way to receive from Paradox Sql - DDL -
i.e : the create query - to create table.

thank u
Asi
Avatar of marcoszorrilla
marcoszorrilla

Read this information from Paradox.

CREATE TABLE is supported with the following limitations:

Column definitions based on domains are not supported.
     Constraints are limited to PRIMARY KEY for Paradox tables. Constraints are unsupported in dBASE tables.

For example, the following statement creates a Paradox table with a PRIMARY KEY constraint on the LAST_NAME and FIRST_NAME columns:

CREATE TABLE "employee.db"
     (
     LAST_NAME CHAR(20),
     FIRST_NAME CHAR(15),
     SALARY NUMERIC(10,2),
     DEPT_NO SMALLINT,
     PRIMARY KEY(LAST_NAME, FIRST_NAME)
     )

The same statement for a dBASE table should omit the PRIMARY KEY definition:

CREATE TABLE "employee.dbf"
     (
     LAST_NAME CHAR(20),
     FIRST_NAME CHAR(15),
     SALARY NUMERIC(10,2),
     DEPT_NO SMALLINT
     )

Creating Paradox and dBASE tables

You create a Paradox or dBASE table using Local SQL by specifying the file extension when naming the table:

".DB" for Paradox tables
     ".DBF" for dBASE tables

If you omit the file extension for a local table name, the table created is the table type specified in the Default Driver setting in the System page of the BDE Configuration Utility.



Best Regards.
Marcos.
Avatar of asi

ASKER

perhaps my question was not clear.
My purpose is to receive from existing paradox table the CREATE TABLE statment , this way i can more easily copy the table structure of paradox to other database
With code yes, but DDL I'm not sure.

procedure TForm1.Button1Click(Sender: TObject);
var
 Table2  : TTable;
begin
 Table1.FieldDefs.Update;
 Table1.IndexDefs.Update;
 Table2 := TTable.Create(nil);
 Table2.DatabaseName := Table1.DatabaseName;
 Table2.TableName := 'NewTable';
 Table2.TableType := Table1.TableType;
 Table2.FieldDefs.Assign(Table1.FieldDefs);
 Table2.IndexDefs.Assign(Table1.IndexDefs);
 Table2.CreateTable ;
end;

Best Regards.
Marcos.

Avatar of asi

ASKER

We try to convert paradox to oracle.
This way lead to many errors like fields does not exsist etc....

thank u
Asi
You could try Datapump that comes with Delphi...
Avatar of kretzschmar
or tbatchmove . . .
Avatar of asi

ASKER

tbatchmove . . is not very clear , is there any exmaple how to use it ?
ASKER CERTIFIED SOLUTION
Avatar of TOndrej
TOndrej

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial