@param sql: dictionary with pre-created sql queries for various cases (for selecting records). Some of these queries will be picked depending on the case
@param sql_queries: a list of sql queries to be executed to select records to reformat.
@param cds_query: a search query to be executed to select records to reformat
@param process_format:
@param process:
@param recids: a list of record IDs to reformat
@return: None
"""
write_message("Processing format %s"%fmt)
t1=os.times()[4]
start_date=datetime.now()
### Query the database
###
task_update_progress('Fetching records to process')
ifprocess_format:# '-without' parameter
write_message("Querying database for records without cache...")
without_format=without_fmt(sql)
recIDs=intbitset(recids)
ifcds_query['field']!=""or \
cds_query['collection']!=""or \
cds_query['pattern']!="":
write_message("Querying database (CDS query)...")
ifcds_query['collection']=="":
# use search_pattern() whenever possible, as it can search
# even in private collections
res=search_pattern(p=cds_query['pattern'],
f=cds_query['field'],
m=cds_query['matching'])
else:
# use perform_request_search when '-c' argument has been
# defined, as it is not supported by search_pattern()