in reply to Oracle report converter

You first need to parse the .rpt-file to extract the variables and the queries. Translate these into standard SQL you then feed to the DBI/DBD-modules and obtain the resultset, which you will then format into a pretty report, perhaps through the use of a templating system.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity. - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Oracle report converter
by denzil_cactus (Sexton) on Jun 25, 2007 at 07:28 UTC
    ok I got ..thnx for the precious reply but please guide me if the file can have lot of commands like
    - .define - .declare - #nc - #t - #s - .ifnull - .print - .. - #dt - .set - .&[something] - .execute - #cl - # - .if - [chars] - #r - .[defined] - .stop - .commit - #cen - #cs - .report - #n - ( [stuff] ) - .goto - #te
    So Do I need to parse each and every line of the file?
      (Assuming the above is part of the .rpt file)

      Yes, you will have to go through the whole of the file unless you can tell beforehand that certain parts can be skipped as they contain no information you need (such as comments and the like).

      Searching on the WWW, I found the following in an Oracle Glossary:

      RPT / RPF
      Report writing and formatting tools provided with older desupported releases of Oracle. The RPT process queried the database, producing rows of data with embedded formatting commands recognized by RPF.

      What you are actually trying to do is to re-invent the functionality of the Oracle RPT / RPF process. I know nothing of Oracle, but it looks to be a tall order to me!

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James