Hi All,
I am trying to write a For loop for an update statement. My Update query works fine. The variable is the productname.
UPDATE
[LicenseHarvesting].[dbo].[LicenseCosting]
SET
[LicenseCosting].RecoveredCost = (SELECT count(*)
FROM [LicenseHarvesting].[dbo].[LicenseHarvestingStatusTable]
where Productname = 'ABC' and [LicenseHarvestingStatusTable].ActionbySCO = 'Delete')*(Select [LicenseCosting].[LicenseCost] from [LicenseHarvesting].[dbo].[LicenseCosting] where [LicenseCosting].[ProductName] = 'ABC')
where [LicenseCosting].[productName] = 'ABC';
===========================================
This will give all the product name from the table.Begin
for i in (select [LicenseCosting].[ProductName])
Loop
My Update Query ---
end loop;
end;
Can anyone help me in this pls.
Priyabrata