Dear All,
I tried to use Oracle text DBI access between text files to Oracle
literature database. The database has a lot of XML files and long strings
of
data. The code is shown below. After I ran this code, I got good correct
return data from Oracle text database. but I got error message. Does anyone
have ideas about how to deal with this error?
DBD::Oracle::st execute failed: ORA-29902: error in executing
ODCIIndexStart() routine
ORA-20000: interMedia Text error:
DRG-50901: text query parser syntax error on line 2, column 1 (DBD ERROR:
OCIStmtExecute) at mapping2pmid.pl line 80, <list_file
> line 1.
DBD::Oracle::st fetchrow_array failed: ERROR no statement executing (perhaps
you need to call execute first) at mapping2pmid.pl li
ne 84, <list_file> line 1.
DBD::Oracle::st execute failed: ORA-29902: error in executing
ODCIIndexStart() routine
Thanks!
The in input file call : PMID_list file was:
The influence of the sparteine/debrisoquine genetic polymorphism on the
disposition of dexfenfluramine~
The effect of psychotropic drugs on gonadotrophin excretion in man~
Observations on the incidence of following of visual and auditory stimuli in
naive mallard ducklings (Anas platyrhynchos)~
Technical note on two rates of mixed marriage~
The transport of prey by ants~
Plasma levels of thioridazine and metabolites are influenced by the
debrisoquin hydroxylation phenotype~
Disposition of fluvoxamine in humans is determined by the polymorphic CYP2D6
and also by the CYP1A2 activity~
Polymorphic drug oxidation in humans~
Competitive inhibition of sparteine oxidation in human liver by
beta-adrenoceptor antagonists and other cardiovascular drugs~
That Perl program is :
# Oracle interface
use DBI;
# declare arguments
( $login, $list_filename, $output_filename) = @ARGV;
# output message and exit if arguments are missing
if ( $#ARGV < 2) {
print "\n";
print "USAGE: \n";
print " mapping2pmid.pl <username>/<password>@<database> <title
list> <output file>\n";
print "\n";
exit(1);
}
# get the database login info
@split1 = split "\@", $login;
$database = $split1[1];
@split1 = split "\/", $split1[0];
$db_user = $split1[0];
$password = $split1[1];
# open the output file
open ( out_file, ">$output_filename") || die "Can't open
$output_filename\n";
# open the loader file
open ( list_file, "$list_filename") || die "Can't open
$list_filename\n";
# connect to the database
$dbh_eds_read = DBI->connect( "dbi:Oracle:".$database, $db_user,
$password);
$dbh_eds_read->{LongReadLen} = 5000000;
# export a document for each Title
$count = 0;
while ( $line = <list_file>) {
@TITLE = split "~", $line;
foreach $title ( @TITLE) {
$status = &ConvertDocument( $title);
if ( $status == 0) {
$count++;}
print ".";
}
}
# print "\n";
# print "$title documents exported to $line\n";
$dbh_eds_read->disconnect();
exit(0);
# #
----------------------------------------------------------------------------
--
sub ConvertDocument {
my ( $title) = @_;
# build the select command
$select_command = "select pmid \n" .
"from ml02_viewer.medline \n" .
"where CONTAINS(ARTICLETITLE,'$title')>0 \n" ;
# execute the commandn prepare the command
$sth_select = $dbh_eds_read->prepare( $select_command);
# output the message and exit if error
# execute the select command
$sth_select->execute();
my @row;
while (@row = $sth_select ->fetchrow_array())
{
print out_file "@row \n";
$counter++;
if (($counter % 1000) == 0)
{
print "Processed $counter records \n";
}
}
}