On Wed, May 7, 2008 at 10:51 AM, Lamb Joseph <[EMAIL PROTECTED]> wrote:
> I am creating a simple tool that will query one table and retrieve the > data. Then this tool will turn the data into insert statements. > > I was wondering if there was a way to retrieve the table name from the > statement handle? > > Similar to print "SQL statement contains $sth->{NUM_OF_FIELDS} columns\n"; > > but like this > > print "SQL statement table name is $sth->{TABLENAME} \n"; > Over and above Alexander's cogent (but gentle - the SQL could have been a lot more complex than that) rebuttal, there's another question for you: How did you decide which table to build the 'SELECT * FROM $table' query from? Can't you keep tabs on the table name from that? (Succinctly - no, you can't tell the table name from the statement handle because, in general, there isn't a single table name to report.) -- Jonathan Leffler <[EMAIL PROTECTED]> #include <disclaimer.h> Guardian of DBD::Informix - v2008.0229 - http://dbi.perl.org "Blessed are we who can laugh at ourselves, for we shall never cease to be amused."