what is the purpose of this, if i may ask?
is it a kind of live back-up you are trying to perform?
you are probably better of doing it on the mysql end instead
on in cf...
if you are not on a shared host, of course...
more to the point of your question:
a <cfquery> can only connect to ONE dsn at a time - you
can't query 2
datasources with one <cfquery> tag.
a SELECT query returns an alphabetical list of columns in
queryname.columnlist variable. but that is all the info it
returns about
the columns - just their names, in uppercase.
to create a copy of the table in your other dsn, you will
need to know a
lot more about the columns and their data in the original
table:
datatypes, value lengths, default values, charset and
collation, table
type, indexes and other constraints, etc etc etc.
the only sure way to get all that data is by querying various
tables in
the information_schema database (a mysql system db which
holds info
about all the databases on the same mysql server) for data
about that
particular db and table... it is NOT a piece of cake.
so, my .02$ for you will be: if you have access directly to
mysql
utilities on your server - use them to create a sql dump of
the table,
then use that dump to create that table in your other dsn.
this, actually, can be done in cf, by invoking mysqldump.exe
with proper
arguments via <cfexecute> tag. check out mysql
reference manual for
detailed info on using mysqldump.exe command-line interface.
hope this helps...
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
... View more