Re: Syntax error? What syntax error??
Posted in 1997
Topics: Platform-Specific Issues
Jacob Salomon wrote: > > OnLine 7.13.UC5 > HP-UX 10.10 Model 869 > > I'm having grief from an update command that worked in the stores > database but is failing with a syntax error in my live database. > <SNIP> > 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); Sub-selects need to be in brackets (). So does your value list in the second example. So it should read: 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)); I haven't tested this statement, but it should work. You might hit a problem with column names as well. If so, simply use the syntax table.column in your select from customer. Hope that helps, -- Mark. +------------------------------------------------------------------+ |Mark D. Stock - The West Solutions Group http://www.west.co.za | | The Informix FAQ is at http://www.iiug.org | |mailto:marks@west.co.za +-----------------------------------------+ |Tel: +27 11 803 2151 |If it doesn't work, force it! | |Fax: +27 11 803 2189 |If it breaks, it needed replacing anyway!| |Cell: +27 83 250 2325 |Well, that's how I code anyway! | +------------------------+-----------------------------------------+