471,325 Members | 1,513 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

need query

In one table iam having id,itemid,availableQuantity -Iam showing this details in grid.

In grid iam having another column Alloted Qty....So,If i enter data in alloted qty then

Click on save the data will be saved in one table (A) which is having all these fields and at the same time it should update remaining tables:

Such as B,C

then the trigger on storedprocedure i have to write so that while clicking save

in B table insert the same data but those column names are diff,Such as in A...

id,itemid,availableQuantity,allotedQty - A

No,id,Qty,Qtyalloted -B
In C Table (Main table),the fields are - we are having the same fields as in A but one extra field to know the CurrentQty (availableQty - Alloted Qty)
So,Based on the alloted Qty the currentQty Should be Updated

So While Inserting in A the data should be Updated in C
Intially both availableQty and currentQty are same ,But while inserting the data should be updated such as

If available qty is 14 , Alloted Qty In grid is 12
Initially in C id,itemid,availableQuantity, currentQty
then the data in C is initially

id -1
itemid-A
Available Qty-14
CurrentQty-14

Now from frontend 12 is given then the data in A :

So inserting the record in database such that

id,itemid,availableQuantity,allotedQty

1 A 14 12
In table B:

No,id,Qty,Qtyalloted

1 A 14 12

In Table C (i have to update the CurrentQty which is intially 14)

id -1
itemid-A
Orginal Qty-14
CurrentQty-14-12 =2
Thanks


Jun 27 '08 #1
0 922

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by lawrence | last post: by
9 posts views Thread by netpurpose | last post: by
10 posts views Thread by L. R. Du Broff | last post: by
3 posts views Thread by pbd22 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.