Subject | Problems with update command |
---|---|
Author | Joe Martinez |
Post date | 2004-09-24T07:18:06Z |
I wrote the following query for a customer of mine who wanted to append the
product's part number (from another table) to the product's
description. Here's what I wrote:
update products A set proddesc = proddesc || ' ' || (select first 1
vpvendpartno from vendorproducts B where B.vpupc = A.prodbarcode and
B.vpvendor = A.prodsource)
where (select first 1 vpvendpartno from vendorproducts B where B.vpupc =
A.prodbarcode and B.vpvendor = A.prodsource) is not null
Questions:
1) When I run this query, it takes FOREVER. I ended up aborting it after
about 4 hours. The PRODUCTS table has about 32,000 records, and the
vendorproducts table has about 192,000. Is there any way to modify the
above query to improve efficiency so that it doesn't take so long?
2) When my customer tried running it, he got the following error:
ISC ERROR CODE: 335544321
arithmetic exception, numeric overflow, or string truncation
What could cause that error?
Thanks,
Joe
product's part number (from another table) to the product's
description. Here's what I wrote:
update products A set proddesc = proddesc || ' ' || (select first 1
vpvendpartno from vendorproducts B where B.vpupc = A.prodbarcode and
B.vpvendor = A.prodsource)
where (select first 1 vpvendpartno from vendorproducts B where B.vpupc =
A.prodbarcode and B.vpvendor = A.prodsource) is not null
Questions:
1) When I run this query, it takes FOREVER. I ended up aborting it after
about 4 hours. The PRODUCTS table has about 32,000 records, and the
vendorproducts table has about 192,000. Is there any way to modify the
above query to improve efficiency so that it doesn't take so long?
2) When my customer tried running it, he got the following error:
ISC ERROR CODE: 335544321
arithmetic exception, numeric overflow, or string truncation
What could cause that error?
Thanks,
Joe