Update Statement
Posted in 2001
Topics: General Discussion
Hi All, Hope someone out there can help me with this one, it's driving me mad! Does anyone have any idea, why the statement below would not work, I just get the error " 522: Table (dblog1.eire) not selected in query." I've tried also making the first line UPDATE admin.subc, dblog1.eire but but still no luck, I've read through the Informix SQL guide, but It doesn't give me an clues?? UPDATE admin.subc SET admin.subc.deal_key = "NVD" WHERE dblog1.eire.chas = admin.subc.CHAS_KEY; Any help greatly appreciated! Best Regards to all, Kirk
Hi, how about this ? update admin.subc set admin.subc.deal_key = "NVD" where exists ( select 1 from dblog1.eire where dblog1.eire.chas = admin.subc.chas_key ); The statement might be faster if you would use the select-statement in an ordinary sub-query: where admin.subc.chas_key in ( select dblog1.eire.chas from dblog1.eire ); But I'm afraid that the select would return too much rows. Regards Stefan Kirk Davis wrote: > > Hi All, > > Hope someone out there can help me with this one, it's driving me mad! > > Does anyone have any idea, why the statement below would not work, I just > get the error " 522: Table (dblog1.eire) not selected in query." > > I've tried also making the first line > UPDATE admin.subc, dblog1.eire but > > but still no luck, I've read through the Informix SQL guide, but It doesn't > give me an clues?? > > UPDATE admin.subc > SET admin.subc.deal_key = "NVD" > WHERE dblog1.eire.chas = admin.subc.CHAS_KEY; > > Any help greatly appreciated! > > Best Regards to all, > Kirk -- Stefan Weideneder Phone: +49 89/3565478-2 --------------- --- Fax: +49 89/3565478-3 ------------- ------ mailto:/stefan@weideneder.de --- -------- http://www.weideneder.de -----