List:MySQL on Win32« Previous MessageNext Message »
From:sinisa@mysql.com Date:March 8 2000 12:41pm
Subject:Re: Multiple Inserts
View as plain text  
On Wed, 08 Mar 2000, S. R. wrote:
>Actually I did have the "values" keyword in there.. I mistyped.. Here is
>what some of my sql looks like:
>
>INSERT INTO MasterEventsUpdate VALUES (90051417,90000123,150502,'UCLA Bruins
>vs. Arizona  ','Women\'s College
>Basketball.','','2000-02-19','1899-12-30',0,'','','','','2000-01-24','');
>INSERT INTO MasterEventsUpdate VALUES (90051418,90000052,150600,'Spring
>Livestock Show','','','2000-02-09','',0,'','','','','2000-01-24','');
>INSERT INTO MasterEventsUpdate VALUES
>(90051419,90000052,150600,'KVHW','','','2000-02-10','',0,'','','','','2000-0
>1-24','');
>INSERT INTO MasterEventsUpdate VALUES (90051420,90000052,150600,'Ohio
>Players','','','2000-02-11','',0,'','','','','2000-01-24','');
>INSERT INTO MasterEventsUpdate VALUES
>(90051421,90000052,150600,'Anthrax','','','2000-02-12','',0,'','','','','200
>0-01-24','');
>INSERT INTO MasterEventsUpdate VALUES (90051422,90000052,150600,'Fu
>Manchu','Songs about pinball, cars and strange
>people.','','2000-02-12','',0,'','','','','2000-01-24','');
>INSERT INTO MasterEventsUpdate VALUES (90051423,90000052,150600,'George
>Thorogood','','','2000-02-18','',0,'','','','','2000-01-24','');
>
>Here is the error I get when I try to execute this:
>You have an error in your SQL syntax near ';
>INSERT INTO MasterEventsUpdate VALUES (90051418,90000052,150600,'Spring
>Lives' at line 1

HI!

YOu get that error, because all char and char derived attributes in MySQL
should be quoted.

Also, if you want to insert several rows, run a single INSERT command for all
of them. 

It is much more efficient.

Regards,

Sinisa

+----------------------------------------------------------------------+
| TcX  ____  __     _____   _____  ___     ==  mysql@stripped            |
|     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic          |
|    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sinisa@stripped     |
|   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaka, Cyprus             |
|  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____                             |
|  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                            |
|             /*/             \*\                Developers Team       |
+----------------------------------------------------------------------+
Thread
Error 1030 ?C. Javier Castro Peña5 Mar
  • Re: Error 1030 ?sinisa@mysql.com5 Mar
  • Multiple InsertsS. R.6 Mar
    • Re: Multiple Insertssinisa@mysql.com6 Mar
  • Re: Error 1030 ?C. Javier Castro Peña6 Mar
    • Re: Error 1030 ?sinisa@mysql.com6 Mar
  • Re: Error 1030 ?C. Javier Castro Peña6 Mar
  • Re: Multiple InsertsS. R.6 Mar
    • Re: Multiple InsertsPeter Carter7 Mar
  • Re: Multiple InsertsS. R.8 Mar
    • Re: Multiple Insertssinisa@mysql.com8 Mar
RE: Multiple InsertsJosé Ostos Turner9 Mar