Friday, March 26, 2010

Forms 11g bug in dynamic sql execution (EXEC_SQL) while generating CSV output

In our Oracle Forms application, we provide an option to the user to generate CSV output from the data queried on the screen. For this what we do is capture the SQL Query from the Data Block of the form along with the user defined predicates and use dynamic sql execution (EXEC_SQL) to fetch the data from the database and write the data in to a text file with extension .CSV and use web.showdocument() built in to show the generate CSV file on the client machine. This was working fine in Forms 10g.



When we attemted to migrate our application, we landed in trouble. That is due to a bug in Forms 11g, EXEC_SQL.DESCRIBE_COLUMN did not raise invalid_column_number exception, which is very essential while working with dynamic SQL because at the time of programming the programmer does not know the exact number columns.



Actually we spent several hours in identifying the issue. After identifying this issue, communicated with Oracle Support. As usual, after taking a long time Oracle accepted it as a defect and keep on working on that.



In the mean while, I developed a PJC (Pluggable Java Component) to generate the CSV file. For this PJC to work, I passed the user name, password along with the query. It works fine and a little faster than the EXEC_SQL.



The only difference here is it is running on a new database session whereas the older method was working on the same same session.

No comments:

Post a Comment