>>Jim,
>>
>>I was always using meaningful names for my cursor (like TEMP_CURS <g>). And I understand that the actual table name on the local drive is unique. But I was thinking, what if the same class gets used at the same time and the application tries to create TEMP_CURS again, where it already exists. Hence, the problem. So I am going to switch to the sys(2015) approach.
>
>Using datasession object will mean that each session can have cursors with the same name without anything interfering with anything else.
Except that at some point you may want to use the same cursor more than once in the same datasession. Typical examples would be entities appearing in roles, like in a dating agency, where we pull two of them and want to have two lookups into the same data. Or in a recursive walk down a self-referencing table - the code which selects records for one branch is the same as for any other branch; the name of the resulting cursor, however, must not be the same, and we surely cannot create a new DS for every branch - and don't need to.
I do like a mixed approach:
lcCursor="crsDates"+sys(2015)
select ... into cursor (lcCursor) ...
This gives me two things I wanted: alias is unique; alias is meaningful. During debugging, I can maybe wonder which of the six crsThisOneIsRight_2AH0TPSBR, crsThisOneIsRight_2AH0TQBFA crsThisOneIsRight_2AH0TQHC9 ... is the one I want, but I won't even try to open crsWrongOne_2AH0TR2BK.