[ic] Loading of SQL table failing

Schuyler W Langdon interchange-users@icdevgroup.org
Sun Sep 15 12:51:02 2002


> At 06:34 PM 9/14/2002 -0700, you wrote:
> >I'm having roubles converting from dbm to MySQL.  I have managed to bring
> >up a smaller table without any issue, but the products table will not
> >load.  I had added the additional fields, and double checked them against
> >my original products.txt, and it is perfect.  Where I may be running into
> >problems is the lack of documentation on all of the fields used in the
> >.mysql file.  Anyway, I'm stuck...
> >
> >I have the debugging enabled, if you need to see all of the
> >details...  BTW, this is 4.8.6...
> >
> >Barry
> >
> >[snip]
> >
> >- - - [14/September/2002:21:15:50 -0400] - - table 'products' failed:
> >products import failed: You have an error in your SQL syntax near ' '',
> >'', '', 'X', 'X', 'X', 'X', '', '098.pdf', 'T3')' at line 1
> >
>
> MySQL is definitely gaging on the import data step here. Perhaps you a
> trying to import empty data into a field which is defined as NOT NULL, or
> maybe there is an errant carriage return somewhere in the file, breaking a
> single row into two pieces.
[snip]

The carriage returns in a text field is a possiblity and I believe those
would have to be escaped in order to even import it directly into the mysql
database. But this has more to do with the parsing that the actual sql
statement. Usually in this case the insert would work but would put stuff in
the wrong fields. Entering empty data into a NOT NULL field is not an issue
with mysql. For performance reasons, usually you would want to make your
fields NOT NULL if possible. However, I'm not sure if ic checks for "null"
in any of its data handlilng routines. I would imagine it does not since you
usually wouldn't use a null value with text or dbm databases. Looks like the
statement may be choking on the length field, maybe there is a " or ' for
inches in that field -- try escaping those.

--
Schuyler Langdon
GatorDev