Thanks all for helping me. ;)

Unfortunately, I can't use DBI. Due to some constraints,
I have to use the shell script to query the DB.

sample output from script

primary_only_automation_enable_KJ_create or replace procedure primary_only_a
utomation_enable()
begin
-- Disable the automations that should not be running when in secondary mode
--alter trigger group automatic_backup_system set enabled true;
alter trigger group primary_only_triggers set e_KJ_
profile_write_KJ_create or replace procedure profile_write(in now UTC, in s
Char(16), in d Char(16), in j Char(16), in g Char(4), in an Char(32), in who Cha
r(64), in val Char(32))
begin
write into profiler_report values( to_char(now)+' [status='+s+', journals='+j+',
detai_KJ_
EvalCountThresh_KJ_create or replace procedure EvalCountThresh (in Occurrenc
eTime Integer) executable '/app/netcool/omnibus/utils/CountThreshold.pl' host 'd
evcrb' user xxxx group xxx arguments OccurrenceTime_KJ_
primary_only_automation_disable_KJ_create or replace procedure primary_only_
automation_disable()
begin
-- Disable the automations that should not be running when in secondary mode.
-- Requires tuning for local requirements
alter trigger group audit_config set enabled false;
alter trigger g_KJ_

I want output as filenamed primary_only_automation_enable with content as

create or replace procedure primary_only_automation_enable()
begin
-- Disable the automations that should not be running when in secondary mode
--alter trigger group automatic_backup_system set enabled true;
alter trigger group primary_only_triggers set e

and so on

Thanks again for help. btw Apologies for not formatting my earlier post and appreciate efforts from all to still help.


In reply to Re^2: export table to text. by kirtivardhan
in thread export table to text. by kirtivardhan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.