Output stream, spooling

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ValgardurGudjonsson
Posts: 4
Joined: Tue 28 Dec 2021 10:56

Output stream, spooling

Post by ValgardurGudjonsson » Tue 28 Dec 2021 11:26

I have a set of old queries (from the 1990's) - and to get results user would open an (old) Oracle tool, run multiple queries in one go and then either manually save the output to a file to generate a big report - or using the SPOOL command to output directly to a file.

Eventually I want to break this up and generate a "proper" report.

Meanwhile I need a temporary solution, is there any ODAC component than can achieve this? I did have a look, but not sure what I should be looking for..

A typical and very much simplified, example would be - the main select-from-tables repeated about 10 times for different queries with different result sets:

Code: Select all

SET FEEDBACK OFF
SET SPACE 1
SET ECHO OFF
SPOOL FILENAME

SET HEADING OFF
SELECT ' ' FROM DUAL;
SELECT 'Section header' FROM DUAL;
SET HEADING ON

SELECT Audkenni, Texti FROM Daemi;

SPOOL OFF
I assume I can omit the SET and SPOOL commands, but to is there a way to get the content in one text stream?
I have tried a few "workarounds" but there is always something.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Output stream, spooling

Post by MaximG » Thu 30 Dec 2021 13:32

Creating reports of any complexity can be realized using components specially designed for these purposes. You can use ODAC with the most popular systems such as FastReport, QuickReport, and PerortBuilder. Examples of using reporting systems are given in our Demo.

ValgardurGudjonsson
Posts: 4
Joined: Tue 28 Dec 2021 10:56

Re: Output stream, spooling

Post by ValgardurGudjonsson » Thu 30 Dec 2021 16:35

Thank you for your reply,

As I explained - I realize I should be using dedicated tools, this is the way I normally implement reports, and the way I will implement in future releases.

I am asking this because there is an urgent call for a temporary solution that can be used to run dozens of reports that have been produced this way for decades. There is not time to implemente every report using proper tools.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Output stream, spooling

Post by MaximG » Fri 31 Dec 2021 11:58

The only way to save data from a dataset is to call SaveToXML for each query : https://docs.devart.com/odac/devart.dac ... tream).htm

ValgardurGudjonsson
Posts: 4
Joined: Tue 28 Dec 2021 10:56

Re: Output stream, spooling

Post by ValgardurGudjonsson » Mon 03 Jan 2022 11:23

Thank you for the reply, probably there is no solution in your components, but this is not a dataset in any sense, this is a text output from multiple queries, each with it's own result set, different columns, and then some headlines between.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Output stream, spooling

Post by MaximG » Wed 09 Feb 2022 11:12

As I understand, you want to combine output from multiple queries into a single text output. You can use OraQuery to run queries and save the results to a file in the XML format, which you can later parse and produce a report.

chavberate
Posts: 1
Joined: Tue 22 Feb 2022 13:08

Re: Output stream, spooling

Post by chavberate » Tue 22 Feb 2022 13:12

MaximG wrote: Fri 31 Dec 2021 11:58 The only way to save data from a dataset is to call SaveToXML for each query : Spider Solitairehttps://docs.devart.com/odac/devart.dac ... tream).htm
Thank you for answering, however this is a text output from several searches, each with its own result set, columns, and headers.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Output stream, spooling

Post by MaximG » Thu 24 Feb 2022 12:39

Indeed, a standard dataset component cannot provide a unified text output from disparate queries. This task can be accomplished by using specialized reporting components.

Post Reply