How can I query for a contract id from within an Update

@cohen.avraham
Please check out previous discussion about implementing query function in the context of an Update on this thread.