Page 1 of 1

Output stream, spooling

Posted: Tue 28 Dec 2021 11:26
by ValgardurGudjonsson
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.

Re: Output stream, spooling

Posted: Thu 30 Dec 2021 13:32
by MaximG
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.

Re: Output stream, spooling

Posted: Thu 30 Dec 2021 16:35
by ValgardurGudjonsson
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.

Re: Output stream, spooling

Posted: Fri 31 Dec 2021 11:58
by MaximG
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

Re: Output stream, spooling

Posted: Mon 03 Jan 2022 11:23
by ValgardurGudjonsson
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.

Re: Output stream, spooling

Posted: Wed 09 Feb 2022 11:12
by MaximG
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.

Re: Output stream, spooling

Posted: Tue 22 Feb 2022 13:12
by chavberate
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.

Re: Output stream, spooling

Posted: Thu 24 Feb 2022 12:39
by MaximG
Indeed, a standard dataset component cannot provide a unified text output from disparate queries. This task can be accomplished by using specialized reporting components.