Pls don't use cursor in Sybase, unless really really required. Performance will be affected very badly. It is very different from Oracle ref-cursor.
Reason is Sybase does not have row level locking. [atleast till 12.5 I know of]. Meaning it has only page-level-locking. Imagine you are working on a million row table and the data is stored in 1000 pages and you have to update 1000 rows. on worst case scenario, let us imagine each of these rows sits in different pages, then for the period of cursor run, you will be locking the entire table !!.
Most sybase cursors could be replaced with case statements in sql. looping is not a good idea in Sybase [ unless really really required ]
yes, select-case can solve many case if only proceed again within a select query... but many times, we need to extract values from select query one by one.. then cursor or looping cant be prevented.
OR any alternatives?