Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Any woraround for this ....?

RE: Any woraround for this ....?

From: Robson, Peter <pgro_at_bgs.ac.uk>
Date: Wed, 04 Sep 2002 09:33:34 -0800
Message-ID: <F001.004C7A0C.20020904093334@fatcity.com>


Hee hee hee! I just LOVE that phrase 'That''s all there is to it'! (notice my correct SQL syntax here...)

Ummm, errr, well, not quite all. Just a tiny bit of in-line documentation would a) help those of us thinking about embarking on Perl, and b) further enhance your evangelical status, Jared! (Yes yes, it could probably be all worked out, but lets save some time here...)

peter
edinburgh

> -----Original Message-----
> From: Jared Still [mailto:jkstill_at_cybcon.com]
> Sent: 04 September 2002 17:14
> To: Multiple recipients of list ORACLE-L
> Subject: Re: Any woraround for this ....?
>
>
>
> Muths,
>
> I hope I'm not beginning to sound like a nag, but PL/SQL is
> not really a great tool for what you're trying to do.
>
> I *like* PL/SQL, but it does have its limits. This is one of them.
>
> What you're trying to do in PL/SQL can be done rather simply
> in Perl. The heart of a program to do this in Perl looks something
> like this:
>
> ...
> my $tabsql = q{
> select table_name
> from dba_tables
> where owner = 'SCOTT'
> };
>
> my $sth = $dbh->prepare($tabsql);
> $sth->execute;
>
> while ( my @array = $sth->fetchrow_array ) {
> my $tableName = $array[0];
> my $file = lc($tableName) . '.txt';
> new Object> my $dumpsql = qq{
> select *
> from scott.$tableName
> };
> my $dumpsth = $dbh->prepare($dumpsql);
> $dumpsth->execute;
> while ( my $aref = $dumpsth->fetchrow_arrayref ) {
> print DUMP q{'}, join(q{','},@{$aref}),q{'},qq{\n};
> }
> }
>
> That's all there is to it. You will write considerably more code to
> do that in PL/SQL, and it won't be nearly as fast.
>
> Jared - OCP and Part Time Perl Evangelist ;)
>
>
> On Wednesday 04 September 2002 03:48, Muthaiah, VSNL wrote:
> > Hi,
> >
> > I'm writing a procedure/script for extract the data of all
> the tables in a
> > schema. When I am trying to spool/write into a file, I am
> getting the
> > following error.
> >
> > ORA-20001: -20000ORA-20000: ORU-10028: line length
> overflow, limit of 255
> > bytes per line ORA-06512: at "SCOTT.EXTRACT", line 115
> > ORA-06512: at line 1
> > First I tried to spool to a file.But got the error line
> length overflow. I
> > have tried using the UTL_FILE option also. But getting the
> same error. Can
> > anyone in the list has any work around for this?
> >
> > Thanks in Advance,
> >
> >
> > Muths
>
> ----------------------------------------
> Content-Type: text/html; charset="iso-8859-1"; name="Attachment: 1"
> Content-Transfer-Encoding: quoted-printable
> Content-Description:
> ----------------------------------------
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Jared Still
> INET: jkstill_at_cybcon.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>



This e-mail message, and any files transmitted with it, are confidential and intended solely for the use of the addressee. If this message was not addressed to you, you have received it in error and any copying, distribution or other use of any part of it is strictly prohibited. Any views or opinions presented are solely those of the sender and do not necessarily represent those of the British Geological Survey. The security of e-mail communication cannot be guaranteed and the BGS accepts no liability for claims arising as a result of the use of this medium to transmit messages from or to the BGS. The BGS cannot accept any responsibility for viruses, so please
scan all attachments.                            http://www.bgs.ac.uk
*********************************************************************

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Robson, Peter
  INET: pgro_at_bgs.ac.uk

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Sep 04 2002 - 12:33:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US