Results 1 to 4 of 4

Thread: Update statement error

  1. #1
    Join Date
    Mar 2004
    Posts
    84

    Update statement error

    Hi All,

    I have an update statement that when I run it I get the following error:

    LMA.SYSTEM: invalid identifier

    Update statement:

    update inna_set_system
    set (add_name, add_no,address_2, add_city, add_state, add_zip,alpha_udf8)=
    (select add_name, add_no, addr_2,add_city, add_state, add_zip,alpha_udf8
    from load_maint_addr lma)
    where inna_set_system.system = lma.system

    How can I fix it. Please help. Thanks.

  2. #2
    Join Date
    Mar 2003
    Posts
    468
    just need to bring the where clause inside the select statement.

    update inna_set_system
    set (add_name, add_no,address_2, add_city, add_state, add_zip,alpha_udf8)=
    (select add_name, add_no, addr_2,add_city, add_state, add_zip,alpha_udf8
    from load_maint_addr lma
    where inna_set_system.system = lma.system
    )

  3. #3
    Join Date
    Mar 2004
    Posts
    84

    Post 335

    I did that and now I am getting another error:

    ORA-01427: single-row subquery returns more than one row

    Please help.

  4. #4
    Join Date
    Mar 2003
    Posts
    468
    that means that the number of rows returned by
    (select add_name, add_no, addr_2,add_city, add_state, add_zip,alpha_udf8
    from load_maint_addr lma)
    is more than one
    and that it can not update a single row with more than one set of values.

    you need to fine-tune the select statement so that only one row is returned by a more exact match for the row you want to update.

Posting Permissions

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