Results 1 to 4 of 4
  1. #1
    Paul279 is offline Member
    Join Date
    Oct 2012
    Posts
    34
    Rep Power
    0

    Default [HSQLDB] How to write update SQL Statement with more than one table

    Hello community,
    I have a HSQLDB-database and the update syntax is as follows:
    Java Code:
    UPDATE table SET column = Expression [, ...] [WHERE Expression];
    Now I would like to update a column, with an inner join.
    Because inner join is not supported in this update-syntax I put the relationship in the where clause:

    Java Code:
    update table1 set rang=null where table1.column1 = table2.column1;
    But HSQLDB is always saying to me that there is an syntax error: user lacks privilege or object not found: table2.column1

    But I am 100% sure, that there is a table2 with the column1. I have no mistake in writing!

    Can anybody explain me what the right syntax for my problem is?
    Cheers

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,029
    Rep Power
    6

    Default Re: [HSQLDB] How to write update SQL Statement with more than one table

    So where did you read that HSQL supports updating multiple tables in one update statement?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    Paul279 is offline Member
    Join Date
    Oct 2012
    Posts
    34
    Rep Power
    0

    Default Re: [HSQLDB] How to write update SQL Statement with more than one table

    Nowhere, but I hope there is a solution, anyhow with a (select ... join... statement)

    But my sql is not so good that i could write such a sql-statement

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,029
    Rep Power
    6

    Default Re: [HSQLDB] How to write update SQL Statement with more than one table

    Read documentation first, then write code. You need to do multiple update statements, one per table.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Prepared statement and update Table
    By Bhavana Jain in forum JDBC
    Replies: 4
    Last Post: 09-01-2012, 08:23 AM
  2. Update statement gone HeWire
    By _-Blackhawk-_ in forum JDBC
    Replies: 8
    Last Post: 10-06-2011, 11:56 AM
  3. error while using sql update statement
    By jttslg in forum Advanced Java
    Replies: 14
    Last Post: 07-03-2011, 10:38 PM
  4. Replies: 1
    Last Post: 01-10-2011, 01:44 AM
  5. Update statement not working.
    By OMFGITSROHIT in forum JDBC
    Replies: 5
    Last Post: 04-08-2010, 01:03 PM

Posting Permissions

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