I've tried sequences, but if there is an error, the sequence
cannot be rolled back in any easy way and there are "gaps" in 
the database :(

Stacy.


> not related to your problem, but
> use a sequence.
> the max(num+1) is a bad idea.






> --- Stacy Mader <[EMAIL PROTECTED]> wrote:
> >
> > Hi all.
> >
> > Using DBI 1.28 and DBD::Oracle 1.12 compiled against
> > Oracle 8.1.7,
> > I have the following:
> >
> > use strict;
> > use DBI;
> >
> > $text = "This is a test.\n"x6000;
> >
> > $sth = $dbh->prepare(qq{
> >
> >   DECLARE next NUMBER;
> >
> >   BEGIN
> >
> >   SELECT MAX(NUM+1) INTO next FROM REPORT;
> >
> >   INSERT INTO EXCESS (ID,TEXT)
> >     VALUES (next,:text)
> >       RETURNING next INTO :rv;
> >
> >   END;
> >
> > });
> >
> > $sth->bind_param(":text","$text", { ora_type => 112
> > });
> > $sth->bind_param_inout(":rv",\$rv, 5);
> > $sth->execute();
> >
> > print "$rv\n";
> >
> > $dbh->disconnect;
> >
> >
> > This script fails at the execute statement with the
> > message:
> >
> > DBD::Oracle::st execute failed:  (DBD ERROR:
> > LOB refetch attempted for unsupported statement
> > type)
> >
> >
> > This I don't understand. The table 'EXCESS' is
> > defined with two columns,
> > ID (type number) and TEXT (type CLOB). Any clues?
> >
> >
> > Regards,
> >
> >       Stacy.
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com

Reply via email to