RE: sqlplus and feedback

From: bill thater <shrekdba_at_gmail.com>
Date: Fri, 10 Jan 2014 14:38:10 -0800
Message-ID: <-5025895137664004726_at_unknownmsgid>



PERL works best. Trust me.;-)

sent from my Windows Phone
Bill"shrek" thater Oracle DBA
Shrekdba_at_Gmail.com
"one ping to rule them all
One ping to find them
One ping to bring them all
And in the mutex bind them!"



From: Jared Still
Sent: 1/10/2014 2:41 PM
To: Remigiusz Sokolowski
Cc: oracle-l
Subject: Re: sqlplus and feedback

On Fri, Jan 10, 2014 at 1:28 AM, Remigiusz Sokolowski < remigiusz.sokolowski_at_nordea.com> wrote:

> I am not sure if my answer showed on the list, but the point is to
> generate a script while get rid of any unnecessary lines in order to get
> clean answer when run it. However after generating this script I would like
> to know how many items were generated
>
>

There comes a point where trying to work around the normal operations of sqlplus to get the desired output becomes convoluted and devolves into unintelligible spaghetti code.

You may have reached that point.

Consider using a scripting language (I prefer Perl) that has built in formatting methods.

Perl is quite good at this, as it has the 'format' and related constructs for reporting, as well as printf.

Added bonus: if you are using Oracle, you already have Perl with DBI and DBD::Oracle installed.

Or consider using PL/SQL, though formatting output in PL/SQL is quite a pain IMO, as well as dealing with limited output locations, unless you just buffer and redirect.

Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist Sr Oracle DBA at Pythian
Pythian Blog http://www.pythian.com/blog/author/still/ Oracle Blog: http://jkstill.blogspot.com Home Page: http://jaredstill.com

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jan 10 2014 - 23:38:10 CET

Original text of this message