Re: DBI error checking not working

From: Mladen Gogala (gogala_at_sbcglobal.net)
Date: 02/12/05

  • Next message: Igor Korolev: "RE: Cannot Insert into Oracle"
    Date: Sat, 12 Feb 2005 22:05:59 GMT
    
    

    On Fri, 11 Feb 2005 16:39:29 +0000, patrickg wrote:

    > Hey all - new to Perl and DBI, so just trying to get an understanding of
    > things. I copied some sample code from the Perl DBI book in the error
    > checking section, but I can't seem to get any of the error messages that I
    > expect. Instead, the program crashes and I get the popup box stating " Perl
    > Command Line Interpreter has encountered a problem and needs to close.". Can
    > someone tell me why none of these error messages are are being displayed
    > when I deliberately make a typo (ie. bad password, malformed SQL, etc) to
    > cause an error? (I've tried all the combinations of setting the PrintError
    > and RaiseError).
    >

    Your program is correct and works. It executes on my FC3 workstation
    with Perl 5.8.5, DBI 1.47, DBD::Oracle 1.16 and Oracle 10.1.0.3. Here
    is the execution output:
    $ ./ttt
    DEPT DEPTNO
    DEPT DNAME
    DEPT LOC
    BONUS ENAME
    BONUS JOB
    BONUS SAL
    BONUS COMM
    SALGRADE GRADE
    SALGRADE LOSAL
    SALGRADE HISAL
    POETRY FILE_ID
    POETRY FILE_DESC
    POETRY FILE_DATA
    EMP EMPNO
    EMP ENAME
    EMP JOB
    EMP MGR
    EMP HIREDATE
    EMP SAL
    EMP COMM
    EMP DEPTNO
    ADODB_LOGSQL CREATED
    ADODB_LOGSQL SQL0
    ADODB_LOGSQL SQL1
    ADODB_LOGSQL PARAMS
    ADODB_LOGSQL TRACER
    ADODB_LOGSQL TIMER
    $

    The only change made to your program was that I changed the TNS
    descriptor from orcl->local, which is what I use on my machine.
    If your program doesn't work on your machine, you have problems with
    the perl installation itself.

    $ perl -v

    This is perl, v5.8.5 built for i386-linux-thread-multi

    Copyright 1987-2004, Larry Wall

    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.

    Complete documentation for Perl, including FAQ lists, should be found on
    this system using `man perl' or `perldoc perl'. If you have access to the
    Internet, point your browser at http://www.perl.com/, the Perl Home Page.

    $ perl -e 'use DBI; print $DBI::VERSION,"\n"';
    1.47
    $ perl -e 'use DBD::Oracle; print $DBD::Oracle::VERSION,"\n"';
    1.16

    $ sqlplus scott/tiger

    SQL*Plus: Release 10.1.0.3.0 - Production on Sat Feb 12 17:04:50 2005

    Copyright (c) 1982, 2004, Oracle. All rights reserved.

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options

    SQL>

    $ uname -a
    Linux medo.noip.com 2.6.10-1.760_FC3 #1 Wed Feb 2 00:14:23 EST 2005 i686 athlon i386 GNU/Linux
    $

    -- 
    Bug, noun: Son of a glitch
    

  • Next message: Igor Korolev: "RE: Cannot Insert into Oracle"

    Relevant Pages