...NULL THEN 'and state =' || &state else ' ' END) ||
(CASE WHEN &city IS NOT NULL THEN 'and city =' || &city else ' ' END) ,1,3)
sql_stmt = 'select * from tablename' || CASE WHEN SUBSTR(where_clause,1,3)='and' THEN 'where ' || SUBSTR(where_clause,4)...