MySql table has a prefix but following function does not add the prefix to entrez_hash table. It generates error while importing pubmed records.
Error displayed is:
user warning: Table 'csbpm_main.entrez_hash' doesn't exist query: SELECT pubmed_id,md5 FROM entrez_hash WHERE pubmed_id IN (19625175,19564027,19327504)
Thanks
function entrez_get_hashes(Array $pubmed_ids) {
if (!empty($pubmed_ids)) {
$placeholders = implode(',', array_fill(0, count($pubmed_ids), '%d'));
$sql = "SELECT pubmed_id,md5 FROM entrez_hash "
. "WHERE pubmed_id IN ($placeholders)";
$result = db_query($sql, $pubmed_ids);
while (($row = db_fetch_array($result)) !== FALSE) {
$hashes[$row['pubmed_id']] = $row['md5'];
}
} else {
$hashes = array();
}
return $hashes;
}
Comments
Comment #1
rpandey1 commented2 related issue:
a) similar error (table not found) for entrez_hash (again does not add table prefix).
b) fails at _db_query($sql); Changing it to db_query($sql); [see removed _ ] fixed the error.
if (!empty($values)) {
$sql = 'REPLACE INTO entrez_hash VALUES ' . rtrim($values, ',');
_db_query($sql);
}
Comment #2
stefan freudenberg commentedThanks. It is in HEAD now. I am going to make another beta release this week.
Comment #3
stefan freudenberg commented