Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: Incorrect syntax near '['.

    Hi

    I'm getting an error while executing a create table query in Sybase 1.2.5.1

    Error message :

    [DataDirect][ODBC Sybase Wire Protocol driver][SQL Server]Incorrect syntax near '['.

    Query :

    CREATE TABLE member_status_summary ( [cancel] varchar (3) NOT NULL , [categories] varchar (100) NOT NULL , [count] int )

    Is the column names should not be surrouned by square brackets ? Is this the error ? Any help ?

    thanks,
    Sam

  2. #2
    Join Date
    Mar 2004
    Posts
    205
    It is Sybase 12.5.1

  3. #3
    Join Date
    Jul 2004
    Posts
    61
    You should use double quotation marks "" insteed of [] to surround table name, column name,...

    Ex:
    CREATE TABLE "member_status_summary" ( "cancel" varchar (3) NOT NULL , "categories" varchar (100) NOT NULL , "count" int )

    Thi Nguyen

  4. #4
    Join Date
    Aug 2004
    Posts
    8
    Dude Sammy....
    use " ... double quotes instead of the [] to surround yer col names and stuff will wurk fine!

    ~Keep on rollin

  5. #5
    Join Date
    Mar 2004
    Posts
    205
    I'm not using any reserved words in column names. Do I have to use " (double quotes) ? Please see
    http://manuals.sybase.com/onlinebook...659;pt=25659#X

  6. #6
    Join Date
    Mar 2004
    Posts
    205
    I'm not using any reserved words in column names. Do I have to use " (double quotes) or [ (square brackets) in column names ? Please see
    http://manuals.sybase.com/onlinebook...659;pt=25659#X

  7. #7
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    COUNT is an identifier but might work in a CREATE TABLE statement.

    CREATE TABLE member_status_summary ( cancel varchar (3) NOT NULL , categories varchar (100) NOT NULL , count int )

    I'd make cancel a CHAR since it's so tiny. Or maybe even a BIT if it's a 1/0 Y/N sort of question.
    Thanks,

    Matt

Posting Permissions

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