Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    Malaysia
    Posts
    3

    Question Unanswered: 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

  2. #2
    Join Date
    Mar 2004
    Posts
    8

    Re: Why this Error?????

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •