Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to transform an Oracle database into a Delphi database? 1

Status
Not open for further replies.

fll

Programmer
May 7, 2002
30
BE
I would like to transform an oracle database into a Delphi database. How should I do?


thanks in advance

laurent

;-)
 
mmm.

What database do you want to use in Delphi?

Does the Oracle DB have data in it you want to port?

If there's no data, you could probably generate a script from Oracle (can you?) and run that in the new database, perhaps, eg SQLServer - it would need some tweaking though.

We need more details.

lou
[penguin]
 
You can leave the database in Oracle, and just connect to it through Delphi, you can either use the standard built in components, or get 3rd party data access components to retrieve the data (we use the Direct Oracle Access components for doing this as we found tem to be faster than the standard ones)
 
Thanbs Robertio. There's me over engineering again, I'd just assumed he didn't or wouldn't have access to said database.

So, Laurent, if you do have access, do as Robertio says.

lou
 
thank you lou and Robertio

laurent
 
Some points, Delphi itself has no Database, it supports comercial available databases. Although you could create your own database with the file of in combination with record in pascal.

In general what we do is creating a delphi program that is linked to an existing database to manipulate the information. With your Delphi program you can insert, delete, view, generate graphs and report, do custom processing among other things.

Like Robertio said leave the information in Oracle, or convert the data to another format, like SQL-Server, Interbase or maybe even a desktop system like access or paradox, although downsizing to a desktop system could result in loss of data consistency and integrity.

Regards Steven van Els
SAvanEls@cq-link.sr
 
do as Robertio says

Cheers Lou, think I might just print that out and stick it on the wall in the office :-D


Steven, have you used files of records before? I'm planning on throwing a little (unofficial) utility for recording our times on track days and not wanting to have to put a database on the timers laptop I was just going to save the values in a csv and store them in an array while the cars were on track (3 timing points and 30 cars at 10 runs a car is not alot of data anyway) You've now got me thinking if that might be a better way of doing it (hadn't even crossed my mind before)...
 
Yes I am using this structure a lot, the advantage is that nobody can see what it is inside unless you have the code.
If you do not need browsing and editing of the structure it is quite handy. I use it for storing data of a TreeView Utility in combination with Autodesk Whip.
In general I mount a little table for inserting the values and after that I convert it to a file.

Below is the code for retrieving the data in a TTable

Code:
type
  DataRecord = Record
    Level : byte;
    FileName : string[80];
    HelpString : string[20];
  end;

var
  RetrieveFM: TRetrieveFM;
  FileDir: string;
  XRec: DataRecord;
  DataFile : File of DataRecord;



implementation

{$R *.dfm}

procedure TRetrieveFM.Button1Click(Sender: TObject);
begin
  FileDir := ExtractFilePath(Application.ExeName) + 'List.dta';
  AssignFile(DataFile, FileDir);
  {$I-} Reset(dataFile); {$I+}
  if IOResult <> 0 then Application.Terminate;
  if table1.IsEmpty then  //mount table
  begin
    Table1.DisableControls;
    while not EOF(DataFile) do
    begin
      Read(Datafile,XRec);
      Table1.Insert;
      Table1.FieldByName('FileName').AsString := xRec.FileName;
      Table1.FieldByName('HelpString').AsString := xRec.HelpString;
      Table1.FieldByName('Level').AsInteger := xRec.Level;
      Table1.Post;
    end;
    CloseFile(DataFile);
    Table1.EnableControls;
  end;
end;

Regards Steven van Els
SAvanEls@cq-link.sr
 
Thanks for that Steven, I'll e-mail it on home and have a play around with it between the football matches at the weekend :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top