Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFMX 8+mySQL5.0.67 Infile null value errors

New Here ,
Nov 26, 2008 Nov 26, 2008
I'm moving an app from MX7 mySQL 4 to MX 8 and mySQL5.0. I have a query that does an infile insertion.
CODE:
<cfquery.....>
load data infile '#loadpath##loadfile#' replace into table #sourcetable# fields terminated by '|' Lines terminated by '\r\n' ignore 1 lines;
</cfquery>

From what I read all infile fields are processed as strings. This creates a warning when a field value is going into an integer, date etc. Under cf7/my4 the errors exist but the cfquery tag seemed to just ignore them and everything worked fine.

Under mx8/my5 the errors are throwing an exception and I have not been able to figure out how to get around it. MySQL5 by default is in strict mode which I tried removing in my.ini as well as adding "TRADITIONAL" as the mode. Neither worked.

Using a SQL client I did run the same infile commands against mySQL5 and got the expected results of errors with all the inserts completing. However when doing it through cfquery it halts on the warning.

Any ideas of how to get cfquery or the driver to ignore a warning (vs an error) in MX8? Any other ideas of things I could try?

Thanks in advance,
Greg
TOPICS
Database access
624
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 26, 2008 Nov 26, 2008
are the field values in your data enclosed by any character?
you need to add ENCLOSED BY '[your character]' to the FIELDS clause then...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 26, 2008 Nov 26, 2008
LATEST
No the data is not enclosed, just delimited by a |. Like I mentioned, it worked fine with MX7/my4 (possibly using a my3 driver I think). No other changes have been made other than the minor thing of a new server..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources