Import Data - SQL

Results 1 to 3 of 3

Thread: Import Data - SQL

  1. #1
    codechick Guest

    Default Import Data - SQL

    Hokay, I&#039;m trying to update certain fields from one table to another in a SQL database and as you can see by the code below I&#039;m having some difficulty. I&#039;m only updating a small number of fields in the books table and when I tried a simple SELECT statement it balked at adding null into the ID column.<BR><BR>SELECT INTO as below is giving me a whole new problem - ie "Cannot run SELECT INTO in this database."<BR><BR>Anyway, any & all suggestions about the syntax for transferring certain fields from one table into another (matching the ID so that it goes into the correct record) I would be very appreciative!<BR><BR>Thanks<BR><BR><BR><BR>SELECT newBks_100400$.ISBN, newBks_100400$.pub_date, newBks_100400$.pages, <BR>newBks_100400$.size, newBks_100400$._index, newBks_100400$.category_1, <BR>newBks_100400$.category_3, books.pf_id <BR>INTO books<BR>FROM newBks_100400$, books <BR>WHERE books.dealer_sku = newBks_100400$.item_no<BR>and = newBks_100400$.title

  2. #2
    Join Date
    Dec 1969

    Default RE: Import Data - SQL

    How about this syntax approach....instead of [select into], try insert [table].field<BR> select [field] from [table] where this = that

  3. #3
    codechick Guest

    Default RE: Import Data - SQL

    K that&#039;s all well & good, I got this far, but can&#039;t compare the dealer_sku from the books table with the item_no in the newBks table. They need to match before the information can be entered so that it&#039;s inserted into the correct record.<BR><BR>The error I get with this is:<BR>The column prefix &#039;books&#039; does not match with a table name or alias name used in the query.<BR><BR>Any suggestions?<BR><BR>INSERT books (ISBN, pub_date, pages, size, index_, category_1, category_3)<BR>SELECT ISBN, pub_date, pages, size, _index, catagory_1, catagory_3<BR>FROM newBks_100400$<BR>WHERE books.dealer_sku = newBks_100400$.item_no<BR>and = newBks_100400$.title

Posting Permissions

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