Hello Sir
I have Error with the following tables one is [INCOME] And one is[Stock].
Income table Columns.
Date ItemID ItemType Amount DriverName TruckNo
---------------------
Stock Table columns.
Itemid ItemName ItemType Amount
-----------------------------------
Now when i enter record to income table
and income itemid not = to stock itemid then
itemid,itemName ,ItemType,Amoun t Should be insert to the Stock table.
elsif income itemid = to stock itemID then
the stock the stock table should be update.
it means that income table amount Should Plus To Stock table amount
stock.amoutn + income.amount.
i try the following code but it does not work.
---------------------------------
-----------------------------------
Please sir give me the Exact Answer
Thank you in advance.
I have Error with the following tables one is [INCOME] And one is[Stock].
Income table Columns.
Date ItemID ItemType Amount DriverName TruckNo
---------------------
Stock Table columns.
Itemid ItemName ItemType Amount
-----------------------------------
Now when i enter record to income table
and income itemid not = to stock itemid then
itemid,itemName ,ItemType,Amoun t Should be insert to the Stock table.
elsif income itemid = to stock itemID then
the stock the stock table should be update.
it means that income table amount Should Plus To Stock table amount
stock.amoutn + income.amount.
i try the following code but it does not work.
---------------------------------
Code:
declare
begin
if :income.itemid<>:stock.itemid then
insert into stock(itemid,itemname,itemtype,amount)
values(:income.itemid,:income.itemname,:income.itemtype,:income.amount);
elsif :income.itemid=:stock.itemid then
update stock set amount=amount+:income.amount where itemid=:stock.itemid;
commit_form;
go_block('Income');
execute_query;
go_block('stock');
Execute_query;
end if;
end;
Please sir give me the Exact Answer
Thank you in advance.
Comment