Mario Sanchez wrote:

hello everyone,

can you please point me to a package or script that will first determine
the columns of a database table, then output well formed XML? condition: i
do not know in advance the columns of the table.

example output where "field" = actual field name

<table>
  <rec1>
        <field1>foo</field1>
        ...
        <fieldn>foobar</fieldn>
  </rec1>
  <rec2>
        <field1>poo</field1>
        ...
        <fieldn>poobar</fieldn>
  </rec2>
  ....
</table>

OR something similar.

i know that it can be written rather straightfowardly, but better to see
if the wheel is already invented.
May be tricky. Different RDBMS have different ways of extracting table information. For MySQL it's 'describe table'. For MSSQL, it's:
|SELECT c.name, c.isnullable, c.length, c.colstat, t.name type
 FROM syscolumns c, systypes t, sysobjects o
 WHERE o.name = '$table' AND o.id = c.id AND c.xtype = t.xtype


|
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to