Close the cursor before execution of statement to avoid the past state
interfering with current query