PDA

View Full Version : Insert Into command help


antila
08-11-2009, 10:21 AM
Hi,

I am a newbie with MySql and I am looking for some help.

I am using this command with MySQL Version: 5.0.45 :

insert into `jos_sobi2_item` select itemid, title,0, NULL, 1, 0, 1, 0, '2009-08-07 00:00:00', '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, 62, '', '', '', NULL, '\neditor = \nexpired = \nexpired_time = ', '85.244.66.120', '2009-08-07 00:00:00', 62, '85.244.66.120', '', '' from jos_sobi2_import_items;

I am getting a syntax error.

I will appreciate some help to make a similar command for MySQL ver. 5.

Thanks in advance.

abduraooft
08-11-2009, 10:23 AM
I am getting a syntax error.

I will appreciate some help to make a similar command for MySQL ver. 5. Please post the complete error message that your are getting.

antila
08-11-2009, 10:29 AM
Hi, abduraooft

Thanks for your quickly reply.

I am getting this error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
insert into `jos_sobi2_item` select itemid, title,0, NULL, 1, 0, 1, 0, '2009' at line 1

and Line 1 is this::

insert into `jos_sobi2_item` select itemid, title,0, NULL, 1, 0, 1, 0, '2009-08-07 00:00:00', '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, 62, '', '', '', NULL, '\neditor = \nexpired = \nexpired_time = ', '85.244.66.120', '2009-08-07 00:00:00', 62, '85.244.66.120', '', '' from jos_sobi2_import_items;

Thanks in advance.

abduraooft
08-11-2009, 10:38 AM
I assume you've copied the query from browser's output.
Just press one or two backspace/delete at the beginning of your query editor. Just manually add some letters, in case the above deletes some letters from the actual query.

antila
08-11-2009, 02:05 PM
I am trying to run that commands through the attached file.

Do I need to fix something ?

abduraooft
08-11-2009, 02:36 PM
Your file appears to be encoded in utf8. Have a try after changing it ti ANSI
(You may use the "Save as" dialog from notepad and choose the Encoding Or use notepad++ and change the encoding from Format menu)