in reply to DBI question

Try:
insert into bar select * from foo
Should work with any major RDBMS.

Replies are listed 'Best First'.
Re: Re: DBI question
by ProfessorHaroldHill (Initiate) on May 09, 2001 at 17:42 UTC
    Yep, but the tables are on different databases hence DBI, with two diffent dbhandles. Sorry, I should have mentioned that .. :)
      You can build the insert string with the NAME attribute of the statement handle.
      From the docs:
      `NAME' (array-ref, read-only) Returns a reference to an array of field names for each column. The names may contain spaces but should not be truncated or have any trailing space. Note that the names have the letter case (upper, lower or mixed) as returned by the driver being used. Portable applications should use the NAME_lc entry elsewhere in this document or the NAME_uc entry elsewhere in this document. print "First column name: $sth->{NAME}->[0]\n";