mysql problem

This is a discussion on mysql problem within the MySQL Database forums, part of the Database Forums category; Hi, I have what I imagine to be a very simple problem while importing an sql file into my database. ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-30-2006
edgy
 
Posts: n/a
Default mysql problem

Hi, I have what I imagine to be a very simple problem while importing an sql
file into my database. the error that shows up is this:

MySQL said:

#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
'SELECT configuration_group_id FROM configuration_group WHERE co




here is what it is trying to process:



INSERT INTO `configuration` ( `configuration_id` , `configuration_title` ,
`configuration_key` , `configuration_value` , `configuration_description` ,
`configuration_group_id` , `sort_order` , `last_modified` , `date_added` ,
`use_function` , `set_function` )
VALUES (
'', 'Number Of Prices Per Products', 'XPRICES_NUM', '1', 'Number of prices
per products<br><br><b>WARNING: Changing this value will delete prices entry
in products table!</b><br><br><b>Every groups that use a deleted price will
use product default price.</b>', (

SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B'
), '31', '2003-11-11 18:33:04', '0000-00-00 00:00:00', 'tep_update_prices',
'tep_cfg_pull_down_prices('
), (
'', 'Allow Guest To See Prices', 'ALLOW_GUEST_TO_SEE_PRICES', 'false',
'Allow guests to view default prices', (

SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B'
), '32', '', '2004-03-15 14:59:05', NULL ,
'tep_cfg_select_option(array(\'true\', \'false\'),'
), (
'', 'Guest Discount', 'GUEST_DISCOUNT', '0', 'Guest discount', (

SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B'
), '33', '', '2004-03-15 14:59:05', NULL , ''
), (
'', 'Special price (products price hiding)', 'SPECIAL_PRICES_HIDE', 'false',
'Special price (products price hiding)', (

SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B'
), '34', '', '2004-03-15 14:59:05', NULL ,
'tep_cfg_select_option(array(\'true\', \'false\'),'
), (
'', 'New customer Enable', 'NEW_CUSTOMERS_ENABLED', 'false', 'Enable or
disable new customers after their registration', (

SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B'
), '35', '', '2004-03-15 14:59:05', NULL ,
'tep_cfg_select_option(array(\'true\', \'false\'),'
);



could anybody point me in the right direction? Unfortunately, I can't seem
to find the version of MySQl my host is using (dotster.com)...

Thanks for any help. I also apologize if this is the wrong forum for this
type of question.





--------------------------------------------------------------------------------





Reply With Quote
  #2 (permalink)  
Old 10-30-2006
Jerry Stuckle
 
Posts: n/a
Default Re: mysql problem

edgy wrote:
> Hi, I have what I imagine to be a very simple problem while importing an sql
> file into my database. the error that shows up is this:
>
> MySQL said:
>
> #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
> 'SELECT configuration_group_id FROM configuration_group WHERE co
>

<snip>

The version of MySQL is quite important here. What does phpinfo() show
you?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #3 (permalink)  
Old 10-30-2006
edgy
 
Posts: n/a
Default Re: mysql problem


"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com...
> edgy wrote:
>> Hi, I have what I imagine to be a very simple problem while importing an
>> sql
>> file into my database. the error that shows up is this:
>>
>> MySQL said:
>>
>> #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
>> 'SELECT configuration_group_id FROM configuration_group WHERE co
>>

> <snip>
>
> The version of MySQL is quite important here. What does phpinfo() show
> you?
>


Hi Jerry,
ok, I asked the customer support and they gave me this info:
mysqld Ver 4.0.18-standard
phpMyAdmin 2.8.0.4

Thanks for taking the time!


Reply With Quote
  #4 (permalink)  
Old 10-30-2006
Jerry Stuckle
 
Posts: n/a
Default Re: mysql problem

edgy wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com...
>
>>edgy wrote:
>>
>>>Hi, I have what I imagine to be a very simple problem while importing an
>>>sql
>>>file into my database. the error that shows up is this:
>>>
>>>MySQL said:
>>>
>>>#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
>>>'SELECT configuration_group_id FROM configuration_group WHERE co
>>>

>>
>><snip>
>>
>>The version of MySQL is quite important here. What does phpinfo() show
>>you?
>>

>
>
> Hi Jerry,
> ok, I asked the customer support and they gave me this info:
> mysqld Ver 4.0.18-standard
> phpMyAdmin 2.8.0.4
>
> Thanks for taking the time!
>
>


That makes it simple. Subselects aren't supported before MySQL 4.1.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #5 (permalink)  
Old 10-31-2006
edgy
 
Posts: n/a
Default Re: mysql problem


"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:H_2dnU6X4pvGd9jYnZ2dnUVZ_rednZ2d@comcast.com. ..
> edgy wrote:
>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>> news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com...
>>
>>>edgy wrote:
>>>
>>>>Hi, I have what I imagine to be a very simple problem while importing an
>>>>sql
>>>>file into my database. the error that shows up is this:
>>>>
>>>>MySQL said:
>>>>
>>>>#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
>>>>'SELECT configuration_group_id FROM configuration_group WHERE co
>>>>
>>>
>>><snip>
>>>
>>>The version of MySQL is quite important here. What does phpinfo() show
>>>you?
>>>

>>
>>
>> Hi Jerry,
>> ok, I asked the customer support and they gave me this info:
>> mysqld Ver 4.0.18-standard
>> phpMyAdmin 2.8.0.4
>>
>> Thanks for taking the time!
>>
>>

>
> That makes it simple. Subselects aren't supported before MySQL 4.1.
>
> --

ok, I see.. any hints on rewriting this?


Reply With Quote
  #6 (permalink)  
Old 10-31-2006
Jerry Stuckle
 
Posts: n/a
Default Re: mysql problem

edgy wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:H_2dnU6X4pvGd9jYnZ2dnUVZ_rednZ2d@comcast.com. ..
>
>>edgy wrote:
>>
>>>"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>>news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com...
>>>
>>>
>>>>edgy wrote:
>>>>
>>>>
>>>>>Hi, I have what I imagine to be a very simple problem while importing an
>>>>>sql
>>>>>file into my database. the error that shows up is this:
>>>>>
>>>>>MySQL said:
>>>>>
>>>>>#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
>>>>>'SELECT configuration_group_id FROM configuration_group WHERE co
>>>>>
>>>>
>>>><snip>
>>>>
>>>>The version of MySQL is quite important here. What does phpinfo() show
>>>>you?
>>>>
>>>
>>>
>>>Hi Jerry,
>>>ok, I asked the customer support and they gave me this info:
>>>mysqld Ver 4.0.18-standard
>>>phpMyAdmin 2.8.0.4
>>>
>>>Thanks for taking the time!
>>>
>>>

>>
>>That makes it simple. Subselects aren't supported before MySQL 4.1.
>>
>>--

>
> ok, I see.. any hints on rewriting this?
>
>


Edgy,

Hmmm, I think I screwed up. You're doing an INSERT, not a SELECT, and
the SELECT should be valid.

I'm not sure about your use of parens, though - I think you may have
some balancing problems. Maybe something more like: (reformatted a
little to better suit my liking :-) )

Basically I took the parens out from around your SELECT statements
(they're not needed) and tried to ensure they were balanced around your
values - one set of parens around each set of values, and one set around
all the values.

Not having your database schema I can't test it, but something like this
should be close.

One other thing - can you get it to work with one set of values (instead
of 4)? When having trouble like this I generally get a single set
working then add the others later.


INSERT INTO `configuration`
(`configuration_id` ,
`configuration_title` ,
`configuration_key` ,
`configuration_value` ,
`configuration_description` ,
`configuration_group_id` ,
`sort_order` ,
`last_modified` ,
`date_added` ,
`use_function` ,
`set_function` )
VALUES (
(
'',
'Number Of Prices Per Products',
'XPRICES_NUM', '1',
'Number of prices per products<br><br><b>WARNING: Changing this
value will delete prices entry in products table!</b><br><br><b>Every
groups that use a deleted price will use product default price.</b>',
SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B' ,
'31',
'2003-11-11 18:33:04',
'0000-00-00 00:00:00',
'tep_update_prices',
'tep_cfg_pull_down_prices('
),
(
'',
'Allow Guest To See Prices',
'ALLOW_GUEST_TO_SEE_PRICES',
'false',
'Allow guests to view default prices',
SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B',
'32',
'',
'2004-03-15 14:59:05',
NULL ,
'tep_cfg_select_option(array(\'true\', \'false\'),'
),
(
'',
'Guest Discount',
'GUEST_DISCOUNT',
'0',
'Guest discount',
SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B',
'33',
'',
'2004-03-15 14:59:05',
NULL ,
''
),
(
'',
'Special price (products price hiding)',
'SPECIAL_PRICES_HIDE',
'false',
'Special price (products price hiding)',
SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B',
'34',
'',
'2004-03-15 14:59:05',
NULL ,
'tep_cfg_select_option(array(\'true\', \'false\'),'
),
(
'',
'New customer Enable',
'NEW_CUSTOMERS_ENABLED',
'false',
'Enable or disable new customers after their registration',
SELECT configuration_group_id
FROM configuration_group
WHERE configuration_group_title = 'TotalB2B',
'35',
'',
'2004-03-15 14:59:05',
NULL ,
'tep_cfg_select_option(array(\'true\', \'false\'),'
));

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #7 (permalink)  
Old 10-31-2006
edgy
 
Posts: n/a
Default Re: mysql problem


"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:c-adnQ65gb_-PtvYnZ2dnUVZ_oCdnZ2d@comcast.com...
> edgy wrote:
>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>> news:H_2dnU6X4pvGd9jYnZ2dnUVZ_rednZ2d@comcast.com. ..
>>
>>>edgy wrote:
>>>
>>>>"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>>>news:XqOdnYMQrPgG7djYnZ2dnUVZ_u-dnZ2d@comcast.com...
>>>>
>>>>
>>>>>edgy wrote:
>>>>>
>>>>>
>>>>>>Hi, I have what I imagine to be a very simple problem while importing
>>>>>>an sql
>>>>>>file into my database. the error that shows up is this:
>>>>>>
>>>>>>MySQL said:
>>>>>>
>>>>>>#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
>>>>>>'SELECT configuration_group_id FROM configuration_group WHERE co
>>>>>>
>>>>>
>>>>><snip>
>>>>>
>>>>>The version of MySQL is quite important here. What does phpinfo()
>>>>>show you?
>>>>>
>>>>
>>>>
>>>>Hi Jerry,
>>>>ok, I asked the customer support and they gave me this info:
>>>>mysqld Ver 4.0.18-standard
>>>>phpMyAdmin 2.8.0.4
>>>>
>>>>Thanks for taking the time!
>>>>
>>>>
>>>
>>>That makes it simple. Subselects aren't supported before MySQL 4.1.
>>>
>>>--

>>
>> ok, I see.. any hints on rewriting this?

>
> Edgy,
>
> Hmmm, I think I screwed up. You're doing an INSERT, not a SELECT, and the
> SELECT should be valid.
>
> I'm not sure about your use of parens, though - I think you may have some
> balancing problems. Maybe something more like: (reformatted a little to
> better suit my liking :-) )
>
> Basically I took the parens out from around your SELECT statements
> (they're not needed) and tried to ensure they were balanced around your
> values - one set of parens around each set of values, and one set around
> all the values.
>
> Not having your database schema I can't test it, but something like this
> should be close.
>
> One other thing - can you get it to work with one set of values (instead
> of 4)? When having trouble like this I generally get a single set working
> then add the others later.
>
>

<snip>

Hi Jerry,

thanks for your help, but I still couldn't get past the syntax errors, and
Irealize I have absolutely no chance of figuring this out without spending a
few days reading the manual, so I was able to get something else that
hopefully solved the issue I was having with my database.

Thanks for your help though...it seems like an interesing language to study
at some point.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:22 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0