www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] operand should contain 1 column(s) for INSERT statement

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Location
    Egypt
    Posts
    65

    resolved [RESOLVED] operand should contain 1 column(s) for INSERT statement

    Hi,

    I'm trying to insert multiple columns in a table in the following format
    Code:
    INSERT INTO table_name (column1, column2, column3) VALUES ((123, 'abc', 'abc'), (123, 'abc', 'abc'), (123, 'abc', 'abc'), (123, 'abc', 'abc'), (123, 'abc', 'abc'), (123, 'abc', 'abc'))
    and getting the following exception in JSP
    java.sql.sqlexception insert operand should contain 1 column(s)

    Please help.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,175
    I don't think you want the extra pair of parentheses wrapping the rows to be inserted.
    Code:
    ... VALUES (a,b,c), (d,e,f),(g,h,i)
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Mar 2007
    Location
    Egypt
    Posts
    65
    Thanks NogDog, solved.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles