Got the query to work with memcpy