-# warn $record->as_formatted;
- $sth=$dbh->prepare("insert into auth_header (authid,datecreated,authtypecode,marc,marcxml) values (?,now(),?,?,?)");
- $sth->execute($authid,$authtypecode,$record->as_usmarc,$record->as_xml_record($format));
- $sth->finish;
- }else{
- if (C4::Context->preference('NoZebra')) {
- $oldRecord = GetAuthority($authid);
- }
+ } else {
+ $auth_exists=$dbh->do(qq(select authid from auth_header where authid=?),undef,$authid);
+# warn "auth_exists = $auth_exists";
+ }
+ if ($auth_exists>0){
+ $oldRecord=GetAuthority($authid);