We are currently developing a client/server application that is to use
different DBMSs (Oracle, Sybase, Watcom etc.) in various installations.
For partitioning the printing of large reports, and to be able to
resume printing from the middle of a report after failure, we want to
store the keys of the rows for the report in an ordered table.
The column "seq_no" in this table represents the position of the row in
the report. This (or a similar) SQL works with other DBMSs:
INSERT INTO report_table ( seq_no, a_column, another_column)
SELECT sequence_a.NEXTVAL, a_column, another_column
FROM table_A
ORDER BY a_column ASC
Oracle, however, does not allow an ORDER-clause in INSERT statements.
We could solve the problem using Cursors, but we fear the performance
of such a solution.
Does anybody know a way around this problem ?
Any help would be greatly appreciated.