Hi, I am trying to execute dynamic sql but I can't seem to get the qoutes right. My code is qry := ''SELECT * from ''|| trim(realname) ||'' where crmid like %''|| trim(crmid) ||''%''; Can anyone help? Alex