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

rpandey1’s picture

2 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);
}

stefan freudenberg’s picture

Thanks. It is in HEAD now. I am going to make another beta release this week.

stefan freudenberg’s picture

Assigned: Unassigned » stefan freudenberg
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.