Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    3

    Unanswered: Error in SQL syntax (REQUIRE)

    Hi All,

    I tried to execute this code and error pops up. I need to create a table field name REQUIRE however REQUIRE is a reserve command for mySQL. Anyone know how to deal with this?

    CREATE TABLE TB_RFP_REQUIRE (
    RFP_ID int(10) unsigned default NULL,
    RFP_REQUIRE_ID int(10) unsigned default NULL,
    REQUIRE varchar(80) default NULL
    ) TYPE=MyISAM;

    Thanx in advance!

    Regards,
    Mar

  2. #2
    Join Date
    Apr 2004
    Location
    Europe->Sweden->Stockholm
    Posts
    71
    Quote Originally Posted by marsulein
    I need to create a table field name REQUIRE however REQUIRE is a reserve command for mySQL. Anyone know how to deal with this?
    Use another name. You can not name a variable "int" in C, "function" in PHP or "for" in Ada and you can not call a column "REQUIRE" in SQL. You need to call it something else. Reserved words are reserved, and there is no way around it. Why can't you just use another name?

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    just use backticks, e.g. `REQUIRE`
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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