Tim, thanks a lot for the fast reply and useful information.

I've also tried your solution "TO_CHAR(:HeadCrncy)" yesterday but it didn't work - but 
maybe I've forgotten one to change (I've multiple :HeadCrncy inside) - however.

I've tried it again and I think it works now and I'll submit it into production.

We'll try to activate Oracle 8i (for a trace) and also to re-produce the bug with 
SQL-Plus and report it to Oracle.

If I have more info for you I'll let you know.


Thanks again for your time!


Ing. Robert Graf
IT Entwicklung

ecetra Internet Services AG
ecetra Central European e-Finance AG
Ein Unternehmen der Erste Bank-Gruppe

Mariahilfer Stra�e 121B | A-1060 Wien
Tel.: +43 1 53689 17772
Fax: +43 1 53689 17677
Mobil: +43 664 8170564
E-Mail: [EMAIL PROTECTED]
www.ecetra.com



-----Original Message-----
From: Tim Bunce [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 26, 2004 3:33 PM
To: Graf, Robert
Cc: [EMAIL PROTECTED]
Subject: Re: DBD::Oracle 1.15 crash


On Thu, Aug 26, 2004 at 11:10:00AM +0200, Graf, Robert wrote:
> Hi,
>
> the following statement
>
> SELECT :HeadCrncy FROM DUAL
> UNION ALL
> SELECT :HeadCrncy FROM DUAL
>
> $sth->bind_param(":HeadCrncy","EUR");
>
> crashes with Perl 5.8.0 and DBI (1.32-1.43) and DBD::Oracle 1.15 under Oracle 9i 
> during the first fetchrow_hashref() with the error:

(Umm "crash" isn't the right word here. It simply fails with
an error.  A crash implies something more serious, like a core dump.)

> DBD::Oracle::st fetchrow_hashref failed: ORA-24345: A Truncation or null fetch error 
> occurred (DBD ERROR: ORA-01406 error on field 1 of 1, ora_type 1) .. (environment + 
> trace log level 2 list below)

I've reproduced it. The problem is that Oracle "describes" that column as
having a max length of zero, so that's how much DBD::Oracle allocates for it.
The trace shows:

    col  1: dbtype 1, scale 0, prec 0, nullok 1, name :HEADCRNCY
          : dbsize 0, char_used 0, char_size 0, csid 1, csform 1, disize 0
    fbh 1: ':HEADCRNCY' NULLable, otype   1->  5, dbsize 0/1, p0.s0

> It has worked with Oracle 8i - but since we have switched to Oracle 9i it crashes.

Can you trace the prepare() call using Oracle 8 and show me the
corresponding lines?


> The problem is the UNION ALL. When I don't use the UNION ALL it works.

Without the UNION ALL Oracle describes the result column thus:

    col  1: dbtype 1, scale 0, prec 2000, nullok 1, name :HEADCRNCY
          : dbsize 2000, char_used 0, char_size 2000, csid 1, csform 1, disize 2000
    fbh 1: ':HEADCRNCY' NULLable, otype   1->  5, dbsize 2000/2001, p2000.s0

So there's plenty of room for a varchar.

Looks like this is an Oracle bug. Please file a TAR with Oracle.

Meanwhile, this'll work for you:

        SELECT to_char(:HeadCrncy) FROM DUAL
        UNION ALL
        SELECT to_char(:HeadCrncy) FROM DUAL

Tim.



Die Information in dieser Nachricht ist vertraulich und ausschlie�lich f�r den 
Adressaten bestimmt. Der Empf�nger dieser Nachricht, der nicht der Adressat, einer 
seiner Mitarbeiter oder sein Empfangsbevollm�chtigter ist, wird hiermit davon in 
Kenntnis gesetzt, dass er deren Inhalt nicht verwenden, weitergeben oder reproduzieren 
darf. Sollten Sie diese Nachricht irrt�mlich erhalten haben, benachrichtigen Sie uns 
bitte unverz�glich per Telefon und retournieren Sie uns die Nachricht per E-Mail/Fax.


The information contained in this e-mail is privileged and confidential and is for the 
exclusive use of the addressee. The person who receives this e-mail and who is not the 
addressee, one of his employees or an agent entitled to hand it over to the addressee, 
is informed that he may not use, disclose or reproduce the contents thereof. If you 
have received this communication by mistake, please let us know by telephone without 
delay and send it back to us by e-mail/fax.

Reply via email to