I just had a terrible thought: what if Oracle (I am an Informix DBA)
uses uppercase by default instead of lowercase. At the top of your
program (next to "use DBI;") put "use Data::Dumper;". After the fetch
put
print Dumper($case);
This will print the contents of $case to the screen. I believe you will
find that the keys to hash are in uppercase. I wish I had though of
this sooner.
On Thu, 2002-05-30 at 16:26, Lance Prais wrote:
> I have no Idea to why this would not work:
>
> Here is my Output that I print:
> --------------------------------------------------------->
> --------------> SR(DAILY_SR_FILE): 1-999961088
> --------------> SR(bulk):
> --------------> User Id(name):
> --------------> COUNT : 752
>
> As you can see it is reading the file but not placing it in the SQL.
>
> Here is the code I use to do this: Below you find some code that is very
> similar to this with the exception it reads form the database and puts it
> into an array the SQL and works. The thing is I wrote this therefore
> understand how it works. Thank you again for your help, I am getting
> frustrated with this issue.
>
> while(my $ln = <BULK> ) {
> chomp $ln;
> $ln =~ s/\s//g; #remove all whitespace characters
> print "--------------------------------------------------------->
> \n";
> print "--------------> SR(DAILY_SR_FILE): $ln\n";
>
> my $get_case_text = $dbh->prepare("
> SELECT
> a.sr_num sr_num,
> a.sr_title sr_title,
> a.sr_stat_id sr_stst_id
> FROM
> s_srv_req a
> WHERE sr_num = " . $dbh->quote($ln)
> );
>
>
> $get_case_text->execute or $dbh->errstr;
>
> #use hashrefs instead of 17 variables
> my $case = $get_case_text->fetchrow_hashref();
> $get_case_text->finish;
>
> print "--------------> SR(bulk): $case->{sr_num}\n";
> print "--------------> TITLE(bulk): $case->{sr_title}\n";
> print "--------------> COUNT : $line\n";
> $line++;
> }
> _____________OTHER CODE____________________________
>
> $count=0;
>
> my $get_count = $dbh->prepare("select count(nvl((sr_num),0)) from
> s_srv_req");
> $get_count->execute || $dbh->errstr;
> ($rowid_count) = $get_count->fetchrow_array();
> $get_count->finish;
> print "Total number of records to extract: $rowid_count\n";
> #$dbh->disconnect;
> #exit();
>
> my $get_next_logid = $dbh->prepare("select nvl((sr_num),0) from s_srv_req");
> $get_next_logid->execute || $dbh->errstr;
>
> open(BULK, "> $bulk_load_filename");
> while (($sr_num) = $get_next_logid->fetchrow_array()) {
> $count=$count+1;
> if ($sr_num==0) {
> $dbh->disconnect;
> exit();
> }
> my $get_case_text = $dbh->prepare("
> SELECT
> a.sr_num sr_num,
> a.sr_title sr_title,
> a.sr_stat_id sr_stst_id
> FROM
> s_srv_req a
> WHERE sr_num = ?");
>
> $get_case_text->execute($sr_num) || $dbh->errstr;
> ($sr_num,$sr_title,$sr_stat_id) = $get_case_text->fetchrow_array();
> $get_case_text->finish;
> }
> ETC...
> -----Original Message-----
> From: Chas Owens [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 30, 2002 2:32 PM
> To: Lance Prais
> Cc: Janek Schleicher; [EMAIL PROTECTED]
> Subject: RE: Problem reading a file and passing a variable
>
> On Thu, 2002-05-30 at 14:29, Lance Prais wrote:
> > Janek,
> > I tried that originally with the same results. I am perplexed to why
> this
> > is happening, anyone have any ideas?
> >
> >
> > Thanks
> > Lance
> >
>
> Try this. I have no idea why it would work and the other wouldn't, but
> it is worth a try.
>
> $ln =~ s/\s//g; #remove all whitespace characters
> my $get_case_text = $dbh->prepare("
> SELECT
> a.sr_num sr_num,
> a.sr_title sr_title,
> a.sr_stat_id sr_stst_id
> FROM
> s_srv_req a
> WHERE sr_num = " . $dbh->quote($ln)
> );
>
>
> $get_case_text->execute or $dbh->errstr;
>
> --
> Today is Setting Orange the 4th day of Confusion in the YOLD 3168
> P'tang!
>
> Missile Address: 33:48:3.521N 84:23:34.786W
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
Today is Sweetmorn the 5th day of Confusion in the YOLD 3168
Today is also Syaday
Missile Address: 33:48:3.521N 84:23:34.786W
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]