Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can anybody code a faster processing update statement 1

Status
Not open for further replies.

Bigced21

Programmer
Feb 5, 2003
76
US
Can anybody code a faster processing update statement then the one I have here. So for its up to an hour in processing. I need to work on my coding skills for fast and efficient queries.

UPDATE hbc_boiler_inspection
SET hbc_boiler_inspection.PAID_flag = 1
FROM hbc_boiler_inspection, hbc_zImport, hbc_boiler
WHERE hbc_boiler_inspection.boiler_id = hbc_boiler.id
AND hbc_boiler.state_no = hbc_zImport.state_no
OR hbc_zImport.FEE > 1
OR hbc_zImport.FEE = 'OLD'
OR hbc_zImport.FEE = 'PDINS'
OR hbc_zImport.FEE = 'PAID'
 
You have to pay attention on the possible values of hbc_zImport.FEE, especially for the > 1 test.
I guess your intents was something like this:
Code:
UPDATE hbc_boiler_inspection
SET hbc_boiler_inspection.PAID_flag = 1
FROM hbc_boiler_inspection, hbc_zImport, hbc_boiler
WHERE hbc_boiler_inspection.boiler_id = hbc_boiler.id
AND hbc_boiler.state_no = hbc_zImport.state_no
AND (hbc_zImport.FEE > 1
  OR hbc_zImport.FEE = 'OLD'
  OR hbc_zImport.FEE = 'PDINS'
  OR hbc_zImport.FEE = 'PAID')

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top