Click here to get back home

cgi DBI Oracle errors

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
cgi DBI Oracle errors philip.kingsten 01-21-2008
Posted by philip.kingsten on January 21, 2008, 6:32 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Posted by philip.kingsten on January 21, 2008, 7:00 am
Please log in for more thread options
On 21 Jan, 11:32, philip.kings...@yahoo.com wrote:
> Hello,
> How can I get hold of the errors from a CGI below. It works fine on
> the command line - but fails silently when invoked via cgi? The query
> just ask for a describe on a table.
> Thanks for your help...
>
> Phil
>
> #!/usr/local/bin/perl
>
> use strict;
> use warnings;
> use CGI::Carp qw(fatalsToBrowser);
> use CGI ':standard';
> use DBI;
> my $dbh = DBI->connect( 'dbi:Oracle:FRED',
> 'bert', 'bert', { RaiseError => 1, AutoCommit => 0 }
> ) || die "Database connection not made: $DBI::errstr";
> ...

I now know that it is this last line that causes the problem - I get a
"cannot execute contact your sysadmin from the web server" if I
include this line - and no error if I inlcud ethe line above.
As this works on the commandline but not here I suspect the
environment - Please how can I dump the environment?


Posted by Tad J McClellan on January 21, 2008, 9:08 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. October 14, 2005, 3:08 am
Building DBD::Oracle with the new Oracle Express product. November 7, 2005, 12:19 pm
how to load a picture to an oracle database with the Load a pictureto Oracle with DBI perl module December 3, 2004, 3:37 pm
DBI , Oracle, Shutting down January 10, 2005, 8:44 pm
Oracle 10 perl and ppm September 23, 2005, 8:42 am
Anyone with experience usging ADO for Oracle? March 28, 2005, 3:54 pm
Not able to connect to oracle db using DBI ( Activestate ) April 8, 2005, 7:02 am
Connecting to oracle from perl July 21, 2005, 11:57 pm
desc $table in DBI Oracle August 1, 2005, 12:27 pm
file not found in DBD::Oracle August 30, 2005, 9:21 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap