[ic] Importing tables...

Dylan Oliver doliver@hampshire.edu
Thu, 15 Mar 2001 12:39:57 -0600


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 15 March 2001 12:15, you wrote:
> I am using the Construct template with the default databases.  With that in
> mind, I am trying to import to the products table a new list of items with
> the fields sku, description and price.  Then I will go back and manually
> edit those items to add quantity discounts, images, etc.
>
> When I try to import this data from a tab-delimited txt file, I get a FATAL
> ERROR - Non-existent table 'sku description price'

> What would be causing this error?

It would help if you posted the command that produced the error. I am not 
very MySQL-savvy, but am sure it would work to make a tab-delimited file 
including all of the fields expected by the demo's database. Tab past the 
fields you don't want to fill out and enter the sku, description, and price 
where they fit. Then 

mysql> LOAD DATA LOCAL INFILE 'data.txt' INTO TABLE products

A quick check into the MySQL documentation yielded this: 

If you wish to load only some of a table's columns, specify a field list:
mysql> LOAD DATA INFILE 'persondata.txt'
           INTO TABLE persondata (col1,col2,...);

You must also specify a field list if the order of the fields in the input 
file differs from the order of the columns in the table. Otherwise, MySQL 
cannot tell how to match up input fields with table columns.

- -- 
Dylan Oliver
   http://stout.hampshire.edu/~dao99
Global View International
   http://www.globalview-intl.com
Do you know how little you know? 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjqxDH0ACgkQ7U8r0TCZf4E9wQCcD/TdZPlf0N/8tFce9oAm5y6S
GoYAnizlBcGXE9FvsC6wxSkPWkbLMBpE
=CtXq
-----END PGP SIGNATURE-----