Changed SQLQuery to send publicationId