Solved

Paradox DDL

Posted on 2002-07-10
8
468 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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