Progress. Changing nature of trace call was a big help.  Thanks

Enclosed is trace output from web, versus from command line ( repetition cut 
out).
How do I fix ?  Why is oracle_home & SID different when coming from the
web versus from the command line ?  Perhaps I should place Env 
variables to set these things back into script to get more clear data.

**********
connect from web ( which doesnt authenticate) ...
*******************************************
    DBI 1.14-nothread dispatch trace level set to 3
    -> DBI->connect(dbi:Oracle:orat1, system, ****, HASH(0x17e1a34))
    -> DBI->install_driver(Oracle) for perl=5.006 pid=2244 ruid=0 euid=0
       install_driver: DBD::Oracle loaded (version 1.06)
    New DBI::dr (for DBD::Oracle::dr, parent=, id=)
    dbih_setup_handle(DBI::dr=HASH(0x1a5ae8c)=>DBI::dr=HASH(0x1a04410), 
DBD::Oracle::dr, 0, Null!)
    dbih_make_com(Null!, DBD::Oracle::dr, 84)
    <- install_driver= DBI::dr=HASH(0x1a5ae8c)
    -> connect for DBD::Oracle::dr (DBI::dr=HASH(0x1a5ae8c)~0x1a04410 'orat1' 
'system' **** HASH(0x17ef1bc))
2   -> debug in DBD::_::common for DBD::Oracle::dr 
(DBI::dr=HASH(0x1a04410)~INNER)
2   <- debug= 3 at Oracle.pm line 90.
Trying to fetch ORACLE_HOME and ORACLE_SID from the registry.
Found ORCL @ C:\ORANT.
    New DBI::db (for DBD::Oracle::db, parent=DBI::dr=HASH(0x1a04410), id=)
    dbih_setup_handle(DBI::db=HASH(0x1a043bc)=>DBI::db=HASH(0x1c4177c), 
DBD::Oracle::db, 1a5f044, Null!)
    dbih_make_com(DBI::dr=HASH(0x1a04410), DBD::Oracle::db, 676)

    ERROR EVENT 0 ' (DBD: login failed, check your config, e.g. 
ORACLE_HOME/bin on your PATH etc)' on DBI::db=HASH(0x1a043bc)
    <- connect= undef at DBI.pm line 408.
    -> errstr in DBD::_::common for DBD::Oracle::dr 
(DBI::dr=HASH(0x1a5ae8c)~0x1a04410)
    <- errstr= ' (DBD: login failed, check your config, e.g. ORACLE_HOME/bin 
on your PATH etc)' at DBI.pm line 409.
    <> DESTROY ignored for outer handle DBI::db=HASH(0x1a043bc) (inner 
DBI::db=HASH(0x1c4177c))
    -> DESTROY for DBD::Oracle::db (DBI::db=HASH(0x1c4177c)~INNER)
         DESTROY for DBI::db=HASH(0x1c4177c) ignored - handle not initialised
    <- DESTROY= undef at unknown location!
    -- DBI::END
    -> disconnect_all for DBD::Oracle::dr (DBI::dr=HASH(0x1a5ae8c)~0x1a04410)
    <- disconnect_all= '' at DBI.pm line 450.
    -> DESTROY in DBD::_::common for DBD::Oracle::dr 
(DBI::dr=HASH(0x1a04410)~INNER)
    <- DESTROY= undef during global destruction.
    <> DESTROY for DBI::dr=HASH(0x1a5ae8c) ignored (inner handle gone)

************
connect from command shell ( which works & does authenticate) ...
***********************
    DBI 1.14-nothread dispatch trace level set to 3
    -> DBI->connect(dbi:Oracle:orat1, system, ****, HASH(0x1a62a54))
    -> DBI->install_driver(Oracle) for perl=5.006 pid=2632 ruid=0 euid=0
       install_driver: DBD::Oracle loaded (version 1.06)
    New DBI::dr (for DBD::Oracle::dr, parent=, id=)
    dbih_setup_handle(DBI::dr=HASH(0x1a6a614)=>DBI::dr=HASH(0x1c86608),
    dbih_make_com(Null!, DBD::Oracle::dr, 84)
    <- install_driver= DBI::dr=HASH(0x1a6a614)
    -> connect for DBD::Oracle::dr (DBI::dr=HASH(0x1a6a614)~0x1c86608 'o
2   -> debug in DBD::_::common for DBD::Oracle::dr (DBI::dr=HASH(0x1c866
2   <- debug= 3 at Oracle.pm line 90.
Trying to fetch ORACLE_HOME and ORACLE_SID from the registry.
Found ORCL @ C:\ORANT.
Loading d:\orant/network/admin/tnsnames.ora
Found EXTPROC_CONNECTION_DATA.
Found ORAT1.
    New DBI::db (for DBD::Oracle::db, parent=DBI::dr=HASH(0x1c86608), id
    dbih_setup_handle(DBI::db=HASH(0x1c865b4)=>DBI::db=HASH(0x1ec20e0),
    dbih_make_com(DBI::dr=HASH(0x1c86608), DBD::Oracle::db, 676)
    <- connect= DBI::db=HASH(0x1c865b4) at DBI.pm line 408.
    -> STORE for DBD::Oracle::db (DBI::db=HASH(0x1ec20e0)~INNER 'RaiseEr
    STORE DBI::db=HASH(0x1ec20e0) 'RaiseError' => 1
    <- STORE= 1 at DBI.pm line 433.
    -> STORE for DBD::Oracle::db (DBI::db=HASH(0x1ec20e0)~INNER 'PrintEr
    STORE DBI::db=HASH(0x1ec20e0) 'PrintError' => 0
    <- STORE= 1 at DBI.pm line 433.
    -> STORE for DBD::Oracle::db (DBI::db=HASH(0x1ec20e0)~INNER 'AutoCom
    <- STORE= 1 at DBI.pm line 433.
    <- connect= DBI::db=HASH(0x1c865b4)
    -> prepare for DBD::Oracle::db (DBI::db=HASH(0x1c865b4)~0x1ec20e0 'S
    New DBI::st (for DBD::Oracle::st, parent=DBI::db=HASH(0x1ec20e0), id
    dbih_setup_handle(DBI::st=HASH(0x1ec2104)=>DBI::st=HASH(0x1b670ec),
    dbih_make_com(DBI::db=HASH(0x1ec20e0), DBD::Oracle::st, 240)
    dbd_st_prepare'd sql f4
    dbd_describe (for sql f4 after oci f54, lb 80, csr 0x1f1c378)...
    fbh 1: 'RNA_ID'     NO null , otype   2->  5, dbsize 22/40, p10.s0
      out: ftype 5, bufl 41. indp 0, rlen 0, rcode 0
    dbd_describe'd 1 columns (Row bytes: 22 max, 17 est avg. Cache: 309
    <- prepare= DBI::st=HASH(0x1ec2104) at oracle-perl5.pl line 40.
    -> execute for DBD::Oracle::st (DBI::st=HASH(0x1ec2104)~0x1b670ec)
    dbd_st_execute (for sql f4 after oci f8, out0)...
    dbd_st_execute complete (rc1403, w00, rpc217, eod1403, out0)
    <- execute= 217 at oracle-perl5.pl line 41.
    -> fetchrow for DBD::Oracle::st (DBI::st=HASH(0x1ec2104)~0x1b670ec)
    dbd_st_fetch 1 fields, rpc 217 (cache: 11/206/309)
    dbd_st_fetch 1 fields, rpc 217 (cache: 62/155/309)
    <- fetchrow= ( '100219' ) [1 items] at oracle-perl5.pl line 45.
    -> fetchrow for DBD::Oracle::st (DBI::st=HASH(0x1ec2104)~0x1b670ec)

*******************

<< Subj:     RE: Oracle-DBI-Win2k-Apache-want raw sql select output to browser
 Date:  4/16/2001 8:36:44 AM Pacific Daylight Time
 From:  [EMAIL PROTECTED] (Sterin, Ilya)
 To:    [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
 
 Also you should use your trace as
 DBI->trace() and insert before your connect statement, so that the connect()
 trace also is included.
 
 Ilya Sterin
 
 -----Original Message-----
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 16, 2001 3:26 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: Oracle-DBI-Win2k-Apache-want raw sql select output to
 browser
 
 
 Still need to connect to Oracle via web to get raw sql select
 output into browser.   All ideas welcome !
 
 Thanks Sapovits.  I changed to c:\\  (for correctness sake) but
  this fixes nothing & it doesn't seem to address the problem
 (but is appreciated).  I continue to get correct output ( with c:\ or c:\\ )
 running from the NT command line so this is not about
 script failure. When run from the  NT shell the script works.
 
 The problem is:  connecting via web browser & authenticating to
 Oracle via this perl/DBI script as a  cgi-bin .pl file.  This must
 be a common hurdle for the DBI/web "uninitiated" .
 
 Surely DBI'ers are working with oracle via browser & not just
 command line. Perhaps someone can define how
 connecting via browser changes config/code requirements insofar
 as  authenticating Oracle.  How can I  at least get a debug signal
 to track this script (via Oracle or perl) ?  I get no error feedback
 to the browser, web logs, or oracle log.  Perhaps I need to create
 a special user for Oracle when coming through the web - but as what?
 
 Again, it works fine as a command line perl/DBI connection script.
 
 <<
  For one thing, your ORACLE_HOME path isn't what you think.
  '\' is the escape character.  To use it in a string as a
  literal, you need to use two:
 
      $ENV{ORACLE_HOME}="c:\\orant";
 
  > -----Original Message-----
  > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  > Sent: Monday, April 16, 2001 1:52 AM
  > To: [EMAIL PROTECTED]
  > Cc: [EMAIL PROTECTED]
  > Subject: Oracle-DBI-Win2k-Apache
  >
  >
  > How do we get raw sql "select" output to display in
  >  the browser  when connecting to an Oracle DBI script?
  >
  > Have a test which executes & fine on command line but
  > same script stops @ connect line when run as cgi
  >  via browser.
  >
  > Is there something extra required ( to oracle or perl) when
  > transitioning
  > scripts from command line to authenticating via web?
  > Using system/manager ( Oracle userid/password) in
  > the connect string.  Print statements, etc work
  > leading up to DBI connect line then stops (when run
  >  from browser).
  >
  > TIA!
  >
  > *******************************************
  > the test script follows.  last working line is the print
  > statement before connect line. However, same script
  > runs to completion on NT command line. Not sure
  > how to debug this since "trace" line never gets reached.
  > ********************************************
  > #!d:/perl/bin/perl.exe -w
  >
  > print "Content-type: text/html\r\n\r\n";
  > use CGI;
  > BEGIN {
  >   $ENV{SERVER_NAME}="me.company.org";
  >   $ENV{ORACLE_HOME}="c:\orant";
  >   $ENV{ORACLE_SID}="orat1";
  >   $ENV{DBI_TRACE}=3;
  >   $ENV{PERL_DBI_DEBUG}=3;
  > }
  >       foreach $key (keys %ENV) {
  >       print "$key --> $ENV{$key}";
  > }
  >
  > foreach $dir (@INC) {
  > print "$dir\n"
  > }
  > print "\n test11 \n<\H2>";
  > %attr = (
  >  PrintError => 0,
  >  RaiseError => 1
  > );
  > my $dbh = DBI->connect("dbi:Oracle:orat1", "system",
  > "manager", \%attr )
  >     or die "cant connect: , $dbi::errstr(), \n";
  >
  > $dbh->trace(3, "dbitrace.log");
  > .
  > .
  > ********************
  >
   >>
 
 
 ----------------------- Headers --------------------------------
 Return-Path: <[EMAIL PROTECTED]>
 Received: from  rly-xd05.mx.aol.com (rly-xd05.mail.aol.com [172.20.105.170]) 
by air-xd03.mail.aol.com (v77_r1.36) with ESMTP; Mon, 16 Apr 2001 11:36:44 
-0500
 Received: from  tmtowtdi.perl.org (tmtowtdi.perl.org [209.85.3.25]) by 
rly-xd05.mx.aol.com (v77_r1.36) with ESMTP; Mon, 16 Apr 2001 11:36:25 -0400
 Received: (qmail 20944 invoked by uid 508); 16 Apr 2001 15:35:45 -0000
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 Precedence: bulk
 List-Post: <mailto:[EMAIL PROTECTED]>
 List-Help: <mailto:[EMAIL PROTECTED]>
 List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
 List-Subscribe: <mailto:[EMAIL PROTECTED]>
 Delivered-To: mailing list [EMAIL PROTECTED]
 Received: (qmail 20900 invoked from network); 16 Apr 2001 15:35:45 -0000
 Received: from ns.ciber.com (HELO exch-corp-bghd3.ciber.com) (12.10.248.2)
   by tmtowtdi.perl.org with SMTP; 16 Apr 2001 15:35:45 -0000
 Received: by exch-corp-bghd3.ciber.com with Internet Mail Service 
(5.5.2650.21)
    id <JBR90DS6>; Mon, 16 Apr 2001 09:35:18 -0600
 Received: from ideastyskxpl72 (pm588-05.dialip.mich.net [207.74.111.63]) by 
cibermail2.ciber.com with SMTP (Microsoft Exchange Internet Mail Service 
Version 5.5.2650.21)
    id 2VC30JPW; Mon, 16 Apr 2001 09:35:10 -0600
 From: "Sterin, Ilya" <[EMAIL PROTECTED]>
 To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: Oracle-DBI-Win2k-Apache-want raw sql select output to browser
 Date: Mon, 16 Apr 2001 11:38:33 -0400
 Message-ID: <[EMAIL PROTECTED]>
 MIME-Version: 1.0
 Content-Type: text/plain;
    charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 X-Priority: 3 (Normal)
 X-MSMail-Priority: Normal
 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
 In-Reply-To: <[EMAIL PROTECTED]>
 Importance: Normal
 
  >>

Reply via email to