Sybase Hack Needed: selecting an arbitrary set of key/value pairs
Don't ask why, but I need a query that will allow me to return an arbitrary result-set of key/value tuples in Sybase 9.0.2.2451.

Here is an example of how to do what I'm looking for in Postgres:

    CREATE TYPE kvp AS (key text,val text);

    SELECT
      (src.pair).key,
      (src.pair).val
    FROM
      (SELECT
         unnest(array
         [
           ('1','First Option'),
           ('2','Second Option'),
           ('cows','Cows')
         ]::kvp[]) AS pair) src;

...which produces this result:

     key  |      val      
    ------+---------------
     1    | First Option
     2    | Second Option
     cows | Cows
    (3 rows)

I feel doubtful Sybase is capable of this kind of hackery, but if there are any geeks out there who know how to make this happen, I'd love to see how!
Sybase Hack Needed: selecting an arbitrary set of key/value pairs
===

Don't ask why, but I need a query that will allow me to return an arbitrary result-set of key/value tuples in Sybase 9.0.2.2451.

Here is an example of how to do what I'm looking for in Postgres:

    CREATE TYPE kvp AS (key text,val text);

    SELECT
      (src.pair).key,
      (src.pair).val
    FROM
      (SELECT
         unnest(array
         [
           ('1','First Option'),
           ('2','Second Option'),
           ('cows','Cows')
         ]::kvp[]) AS pair) src;

...which produces this result:

     key  |      val      
    ------+---------------
     1    | First Option
     2    | Second Option
     cows | Cows
    (3 rows)

I feel doubtful Sybase is capable of this kind of hackery, but if there are any geeks out there who know how to make this happen, I'd love to see how!