DBI->trace(3); # Added call to trace method my $dbh = DBI->connect("DBI:Oracle:host=$host;port=$port;sid=$sid",$us +er, $password, {PrintError=>1,RaiseError=>1}) or die "Can't connect to ORACLE database:$DBI::errstr\n"; my $subj_code_query = qq{SELECT * FROM LOOKUP}; my $sth_subj = $dbh->prepare($subj_code_query); # ---A function--- sub execute_subject_query() { open(SWRT, ">SUBJECT_CODES_FOR_XML.txt"); my $rv = $sth_subj->execute(); if($rv == 0) { print "No Value Returned\n"; } else { print "subject_id\tsubject_sex\tsubject_type\n"; while( my $array_ref = $sth_subj->fetchrow_arrayref) { for(my $i=0; $i<@$array_ref;$i++) { print "$array_ref->$i\n";<STDIN>; print SWRT "$array_ref->$i\n"; } } } $sth_subj->finish(); close SWRT; }
In reply to Re: PERL DBI and oracle
by thezip
in thread PERL DBI and oracle
by hakiran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |