As Sergey notes, a cursor is closed like any table. (Once it is closed, the cursor disappears - it works like a temporary table).
Two more considerations:
You might just keep it open, until next time. If you repeat the same SELECT command into the same cursor, it will simply overwrite the previous one.
If you keep cursors or tables open in a form that uses a private datasession, the cursor or table will close automatically as soon as the form closes.
>I used a lot of Select ... from ... into cursor ... in my app.
>
>>USE (d_purchase) ALIAS i_purchase IN 0
>SELECT * FROM i_purchase WHERE dInv>=startdate AND dInv<=enddate INTO CURSOR c_purchase
>USE IN i_purchase
>
>USE (d_sales) ALIAS i_sales IN 0
>SELECT * FROM i_sales WHERE dInv>=startdate AND dInv<=enddate INTO CURSOR c_sales
>USE IN i_sales
>
>
>and so on...
>to capture the transactions from other app (difference dbc) to my app.
>
>I wonder if I will end up with out of memory problem.
>
>how can I release the cursor?
>
>thanks for the help.
>
>regards,
>
>Jerry
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)