Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    10

    Unanswered: how to get the headers of informix table?

    hi all,
    i want to get the headers of an informix table,i ve tried the commands:
    describe mytable;
    info columns for mytable;
    the last one works with informix version 4,the version of my informix server is 7.and i use jdbc to connect with informix.
    thanks for the help

  2. #2
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    183
    Hi,

    The INFO command should still wortk (I thoughy). The problem you have is the JDBC driver (I think). I would suggest reading the information directly from the systables. For example if you wish to retrieve the columns in a table you could do:

    SELECT colname
    FROM syscolumsn
    WHERE tabid = (SELECT tabid
    FROM systables
    WHERE tabname = '<tablename>')
    ORDER BY colno

    If you use a version prior to 9.40 you shuld also select colno to do the order by, it is a new feature in 9.40 to order the result set on a column /expression you do not select.

    Hope this can do the trick,

    Rob Prop

  3. #3
    Join Date
    Mar 2004
    Posts
    10

    thanks

    thanks for your help,we ve found another solution with using ResultSetMetaData rsmd = RS.getMetaData();
    rsmd.getColumnName(i)
    thank you.




    Originally posted by RobP
    Hi,The INFO command should still wortk (I thoughy). The problem you have is the JDBC driver (I think). I would suggest reading the information directly from the systables. For example if you wish to retrieve the columns in a table you could do:

    SELECT colname
    FROM syscolumsn
    WHERE tabid = (SELECT tabid
    FROM systables
    WHERE tabname = '<tablename>')
    ORDER BY colno

    If you use a version prior to 9.40 you shuld also select colno to do the order by, it is a new feature in 9.40 to order the result set on a column /expression you do not select.

    Hope this can do the trick,

    Rob Prop

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •