Quote:
|
Originally Posted by sathyaram_s
Check for the syntax ... But, basically, I assume this will work
update dbo.stg_joc_tbl j set office=(select s.office from dbo.REF_NA_SALES_XREF_TBL s where j.district=s.distict) and
exists (
select 1 from dbo.REF_NA_SALES_XREF_TBL s1 where j.distict=s1.district
)
|
Your code:
Code:
update dbo.stg_joc_tbl j set office=(select s.office from dbo.REF_NA_SALES_XREF_TBL s where j.district=s.distict) and
exists (
select 1 from dbo.REF_NA_SALES_XREF_TBL s1 where j.distict=s1.district
)
Produced the following error:
Code:
update db2admin.stg_joc_tbl j
Set office=(select s.office from db2admin.REF_NA_SALES_XREF_TBL s where j.district=s.distict) and
exists (select 1 from db2admin.REF_NA_SALES_XREF_TBL s1 where j.distict=s1.district);
then i thought that the parinthases were in the wrong spot so i ran the following code:
Code:
update db2admin.stg_joc_tbl j
Set office=(select s.office from db2admin.REF_NA_SALES_XREF_TBL s where j.district=s.distict and
exists (select 1 from db2admin.REF_NA_SALES_XREF_TBL s1 where j.distict=s1.district));
and got the following error
Code:
update db2admin.stg_joc_tbl j
Set office=(select s.office from db2admin.REF_NA_SALES_XREF_TBL s where j.district=s.distict and
exists (select 1 from db2admin.REF_NA_SALES_XREF_TBL s1 where j.distict=s1.district));
I have looked at the syntax in the documentation, but i havent seen anything that deals with anything this complicated. If you see it documented I would be happy to go read it if you tell me the chaperter/heading.
thanks for all of your help
Jim