Results 1 to 3 of 3

Thread: Joined update

  1. #1
    Join Date
    Apr 2004
    Location
    NJ United States
    Posts
    4

    Exclamation Unanswered: Joined update

    HI all,

    I need to update a table from data in a view. I am using version 6.1.

    UPDATE shipto INNER JOIN discounts ON shipto.strfnbr=discounts.strfnbr SET stfield2 = discounts.(char(stdiscprice)) WHERE shipto.stfield2 is null

    I get:

    SQL0104N An unexpected token "UPDATE shipto INNER" was found following

    "BEGIN-OF-STATEMENT".

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: Joined update

    Originally posted by maddog260013
    HI all,

    I need to update a table from data in a view. I am using version 6.1.

    UPDATE shipto INNER JOIN discounts ON shipto.strfnbr=discounts.strfnbr SET stfield2 = discounts.(char(stdiscprice)) WHERE shipto.stfield2 is null

    I get:

    SQL0104N An unexpected token "UPDATE shipto INNER" was found following

    "BEGIN-OF-STATEMENT".
    I think this should work:

    update shipto
    set stfield2 = (
    select char(stdisprice) from discounts
    where discounts.strfnbr=shipto.strfnbr
    )
    where stfield2 is null

  3. #3
    Join Date
    Apr 2004
    Location
    NJ United States
    Posts
    4

    Re: Joined update

    This was just what I needed. Thank you n_i!


    Originally posted by n_i
    I think this should work:

    update shipto
    set stfield2 = (
    select char(stdisprice) from discounts
    where discounts.strfnbr=shipto.strfnbr
    )
    where stfield2 is null

Posting Permissions

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