snafu has asked for the wisdom of the Perl Monks concerning the following question:
-- snip --
$dbh = &ora_login($DB,$UN,$PW) or die("Oracle login FAILED."); $sql = "select distinct(clli) from gvc_traffic30"; $cursor = &ora_open($dbh,$sql) or die("Failed query (bad query?). $!\n +"); @MYARRAY= &ora_fetch($cursor) or die("Failed to get return from query. + $!\n"); foreach my $clli ( @MYARRAY ) { chomp($clli); $c++; if ( /\W/ ) { print "Found bad character in line $c."; } else { print "This clli appears to be OK."; } print " : $clli\n"; }
-- !snip --
The script is supposed to grab a list of items from the database that have either been stored properly or have been stored with improper characters in them. I will eventually get to fixing that but for now I am using my problem as a way or learning DBI. I am only concerned with seeing the data in the table for now (plus of course sorting each row out with non-alphanumerics in them).
I have tried for loops, foreach loops (above), and while loops (of course didn't work)...none of which seem to work so I can only assume that I am not getting the proper data into the proper data type somehow... ???
My current output is:
$ perl traffic.pl Use of uninitialized value in pattern match (m//) at traffic.pl line 3 +6. Use of uninitialized value in concatenation (.) at traffic.pl line 41. This clli appears to be OK. : $
Suggestions would be very much appreciated.
----------
- Jim
Edit: chipmunk 2001-08-20
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Oraperl for the first time... (was: Using DBI for the first time...)
by chromatic (Archbishop) on Aug 21, 2001 at 08:09 UTC | |
by snafu (Chaplain) on Aug 21, 2001 at 09:48 UTC | |
|
Re: Using DBI for the first time...
by snafu (Chaplain) on Aug 21, 2001 at 01:37 UTC | |
by htoug (Deacon) on Aug 21, 2001 at 10:50 UTC | |
by snafu (Chaplain) on Aug 21, 2001 at 18:01 UTC | |
|
Re: Using DBI for the first time...
by VSarkiss (Monsignor) on Aug 21, 2001 at 01:33 UTC | |
by chipmunk (Parson) on Aug 21, 2001 at 01:49 UTC |