stephenk1973
Technical User
I have a problem with an update query, sometimes there is no record in the barcodes table and an update is not possible. How do i stop it from trying these 'null' updates.
Thanks
Stephen
update wrk_items a
set (sty_id, season, sty_num, sty_qual, bf_mat_char_val, wsty_size,lsty_size, barcode_valid =
(select b.sty_id, b.season, b.sty_num, b.sty_qual, b.bf_mat_char_val,b.wsty_size, b.lsty_size, 'Y' from barcodes b where a.sty_barcode = b.sty_barcode) where (a.sty_id = 99999 or a.sty_id is null or a.sty_id = 0)
Thanks
Stephen
update wrk_items a
set (sty_id, season, sty_num, sty_qual, bf_mat_char_val, wsty_size,lsty_size, barcode_valid =
(select b.sty_id, b.season, b.sty_num, b.sty_qual, b.bf_mat_char_val,b.wsty_size, b.lsty_size, 'Y' from barcodes b where a.sty_barcode = b.sty_barcode) where (a.sty_id = 99999 or a.sty_id is null or a.sty_id = 0)