HELP - select into statement

Results 1 to 2 of 2

Thread: HELP - select into statement

  1. #1
    Join Date
    Dec 1969

    Default HELP - select into statement

    I&#039;ve posted becfore about copying a table from one database to another but have never gotten a positive response. However, I found the "select into" statement which allegedly lets you do it. I can&#039;t figure out the syntax though. Here is the example statement I copied:<BR><BR>SELECT Suppliers.* INTO Suppliers IN &#039;Backup.mdb&#039; <BR>FROM Suppliers; <BR> <BR><BR>Now what exactly are each of these for elements? Which is the source table, the destination table, source db, destination db.<BR><BR>Also, will this work with MySQL or only with Access? Can it be configured so that both databases connect via ODBC (in the example it seems only one is).<BR><BR>Thanks,<BR><BR>Jarrod<BR>info@jtwebmas

  2. #2
    Join Date
    Dec 1969

    Default The IN clause is not standard SQL...;s pretty much strictly MS&#039;s invention.<BR><BR>See here for what MySQL supports:<BR><BR><BR><BR>The closest it comes is the INTO OUTFILE syntax, which produces a .csv file (or variation thereof), *not* another table in another database (though you can then use LOAD DATE INFILE with another table/db to read the data back in).<BR><BR>And no, you can&#039;t cross database boundaries with IN (excepting that you can work with any database type the JET engine recognizes, I guess).<BR><BR>******************************<BR>< BR>&#062; SELECT Suppliers.* INTO Suppliers IN &#039;Backup.mdb&#039; FROM Suppliers; <BR>&#062; Now what exactly are each of these for elements? <BR>&#062; Which is the source table, <BR>&nbsp; &nbsp; &nbsp; &nbsp; [whatever DB is connected].Suppliers<BR>&nbsp; &nbsp; &nbsp; &nbsp; as used in "SELECT Suppliers.*"<BR>&#062; the destination table, <BR>&nbsp; &nbsp; &nbsp; &nbsp; [Backup.mdb].Suppliers<BR>&nbsp; &nbsp; &nbsp; &nbsp; as used in "INTO Suppliers"<BR>&#062; source db, <BR>&nbsp; &nbsp; &nbsp; &nbsp; Whatever DB the connection is connected to from which you execute this statement.<BR>&#062; destination db.<BR>&nbsp; &nbsp; &nbsp; &nbsp; Backup.mdb<BR><BR><BR>

Posting Permissions

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