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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Oracle sql files with Delphi

Status
Not open for further replies.

smithberger

Programmer
Aug 25, 2005
2
US
I have been using Oracle Forms with a very old version of Oracle. We are now upgrading to Oracle 10g and can no longer afford the Forms program.

I have been studying the delphi program and have succeeded in replicating some of my forms. However, I have not been able to find an answer for the following:

Can I still run *.sql files that are stored on the database server? (They are not stored in the database.) In the past I have just called these files from the form or menu and a simple report is sent to the printer. The *.sql file contains column formats and breaks for subtotaling, etc. Is this the same as calling another program from delphi or is there another way?
 
If the .sql files contain only SQL, then you can easily pull the information into Delphi. For the query or datasource component you're using, you can do something like this in your code:

myquery.SQL.LoadFromFile('\\myserver\sql files\sql1.sql');

This will load the query into the SQL property of the component and you can then set up the parameters and run it just like you would any other query.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Thank you for your reply. I understand what you are saying, but just to confirm -- if my *.sql file contains formatting info (i.e. column headings, break points, computes, etc), then I need to use the report writing function in delphi to create the report?


 
Or you might be able to load it as an anonymous PL/SQL block - you would do the same thing to load it into the .SQL property of the query. In terms of data formatting and column headings, there's a lot that you can do from within the SQL itself, so that shouldn't be an issue. Break points and computes can also be handled from within PL/SQL. I've never worked in Oracle Forms, so I'd have to see a sample of what's in your SQL file(s) to be able to tell you for sure whether it would work.

If you're trying to present static data - data that the user can't change, then working through a report writer component is certainly an option, although not necessarily the best option.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top