If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Why this Error?????

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-15-04, 00:07
Bassam72 Bassam72 is offline
Registered User
 
Join Date: Mar 2004
Location: Malaysia
Posts: 3
Question Why this Error?????

Hello Guys,
I am trying to write an SQL statment for MySQL database as I used to write in ORACLE database, but the problem is that I am getting an Error whenver I Lunch the statment. So anyone can help me in this matter??

The SQL statment is:

UPDATE Gatewys SET Gateway_IP = '192.168.1.2' WHERE Aliase_No = (SELECT Aliase_No FROM Gateways WHERE Gateway_IP = '0.0.0.0' ORDER BY Aliase_No LIMIT 0, 1);

The error I am getting is:

ERROR 1064: You have an error in your SQL syntax near 'SELECT Aliase_No FROM Gateways WHERE Gateway_IP = '0.0.0.0' ORDER BY Aliase_No L' at line 1


Thanks for help
Bassam72
Reply With Quote
  #2 (permalink)  
Old 03-16-04, 02:06
pekron pekron is offline
Registered User
 
Join Date: Mar 2004
Posts: 8
Re: Why this Error?????

Quote:
Originally posted by Bassam72
Hello Guys,
I am trying to write an SQL statment for MySQL database as I used to write in ORACLE database, but the problem is that I am getting an Error whenver I Lunch the statment. So anyone can help me in this matter??

The SQL statment is:

UPDATE Gatewys SET Gateway_IP = '192.168.1.2' WHERE Aliase_No = (SELECT Aliase_No FROM Gateways WHERE Gateway_IP = '0.0.0.0' ORDER BY Aliase_No LIMIT 0, 1);

The error I am getting is:

ERROR 1064: You have an error in your SQL syntax near 'SELECT Aliase_No FROM Gateways WHERE Gateway_IP = '0.0.0.0' ORDER BY Aliase_No L' at line 1


Thanks for help
Bassam72
MySql does not support nested queries other than in INSERT ... SELECT and REPLACE ... SELECT

This will update the first found entry having 0-IP
UPDATE Gateways Set Gateway_IP = '192.168.1.2' WHERE Gateway_IP = '0.0.0.0' LIMIT 1

Good luck
/pekron
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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On