Re: Syntax error? What syntax error??
Posted in 1997
Jacob Salomon wrote: [cut] } Now, I try it on a table in the live database, but this time I am } propagating several columns: } update foggy_stor } set (country, old_acct, cust_type, call_alloc, ship_lead) } = (select country, old_acct, cust_type, call_alloc, ship_lead } from customer c } where c.customer = foggy_stor.customer); } } Aside from the number of columns involved, the only difference is the } parentheses around the list of columns to be updated. And this is a } syntax requirement. Anyway, when I run the above update, I get this } error output: } } update foggy_stor } set (country, old_acct, cust_type, call_alloc, ship_lead) } = (select country, old_acct, cust_type, call_alloc, ship_lead } # ^ } # 201: A syntax error has occurred. } # At the risk of someone having answered this already: Put an extra set of parentheses around the select statement. The first set will be interpreted as the parentheses required for the column list after the equals [=] in the update, the second will be to enclose the select statement (which happens to be for all the columns in the update statement). Tim