• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 494
  • Last Modified:

Paradox DDL

hello

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

thank u
Asi
0
asi
Asked:
asi
  • 3
  • 2
  • 2
  • +1
1 Solution
 
marcoszorrillaCommented:
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.
0
 
asiAuthor Commented:
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
0
 
marcoszorrillaCommented:
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.

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

thank u
Asi
0
 
TOndrejCommented:
You could try Datapump that comes with Delphi...
0
 
kretzschmarCommented:
or tbatchmove . . .
0
 
asiAuthor Commented:
tbatchmove . . is not very clear , is there any exmaple how to use it ?
0
 
TOndrejCommented:
yes, see Help\Examples\BatchMv and BatchMv2 subdirectories
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now