variable column query in cursor?

Original text of this message