Solved

Paradox DDL

Posted on 2002-07-10
8
470 Views
Last Modified: 2012-06-27
hello

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

thank u
Asi
0
Comment
Question by:asi
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 3

Expert Comment

by:marcoszorrilla
ID: 7144162
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
 

Author Comment

by:asi
ID: 7144234
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
 
LVL 3

Expert Comment

by:marcoszorrilla
ID: 7144481
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:asi
ID: 7145297
We try to convert paradox to oracle.
This way lead to many errors like fields does not exsist etc....

thank u
Asi
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 7146971
You could try Datapump that comes with Delphi...
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7179544
or tbatchmove . . .
0
 

Author Comment

by:asi
ID: 7179564
tbatchmove . . is not very clear , is there any exmaple how to use it ?
0
 
LVL 8

Accepted Solution

by:
TOndrej earned 25 total points
ID: 7179567
yes, see Help\Examples\BatchMv and BatchMv2 subdirectories
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question