| |

VerySource

 Forgot password?
 Register
Search
View: 1238|Reply: 9

How to modify the data in the inventory table at one time in the warehouse management software?

[Copy link]

2

Threads

12

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Unknown

Post time: 2020-1-4 14:00:01
| Show all posts |Read mode
When entering the storage order, you can enter multiple records in DBGrid1 at one time. I want to modify the corresponding records in the inventory table when saving. modify?
Reply

Use magic Report

0

Threads

16

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-1-4 14:03:02
| Show all posts
Yes, you can use batch processing, I suggest you go to 2ccc.com to download an example to see, it is relatively simple
Reply

Use magic Report

2

Threads

12

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 United States

 Author| Post time: 2020-1-4 14:18:01
| Show all posts
Can you say something specific, or give a code, I did not find relevant content.
Reply

Use magic Report

2

Threads

12

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-5 00:21:01
| Show all posts
// Modify the existing quantity in the inventory table
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add ('Select * from RukuTmp');
ADOQuery1.Open;
// Find all data from the temporary table
ADOQuery1.First;
while not ADOQuery1.Eof do
begin
  ADOQuery2.Close;
  ADOQuery2.SQL.Clear;
  ADOQuery2.SQL.Add ('Select * from Kucun where ChID =: a');
  ADOQuery2.Parameters.ParamByName ('a'). Value: = ADOQuery1.fieldbyname ('ChID'). AsString;
  ADOQuery2.Open;
  ADOQuery2.Edit;
  ADOQuery2.FieldByName ('Kcsl'). AsFloat: = ADOQuery2.fieldbyname ('Kcsl'). AsFloat
    + ADOQuery1.fieldbyname ('Rksl'). AsFloat;
  ADOQuery2.Post;
  ADOQuery1.Next;
end;
Reply

Use magic Report

0

Threads

40

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-5 08:42:01
| Show all posts
update Ku village set KC SL = Ku village.KC SL + Ru library tmp.RK died from Ku village, Ru library tmp where Ku village. CH ID = Ru library tmp.CH ID
Reply

Use magic Report

0

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 Japan

Post time: 2020-1-5 11:36:01
| Show all posts
Sum with SUM
with ADOQuery1 do
begin
  close;
  sql.clear;
  sql.add ('update Kucun set Kcsl = c.Kcsl from (select ChID, sum (Kcsl) as Kcsl from RukuTmp group by ChID) c, warehouse where Kucun.ChID = c.ChID');
  execsql;
end;
Reply

Use magic Report

2

Threads

12

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-5 13:06:01
| Show all posts
xclzc17()
I tried, your method is wrong, you cannot join two tables after Update.
Reply

Use magic Report

0

Threads

40

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-5 13:33:01
| Show all posts
What do you mean?
Reply

Use magic Report

0

Threads

40

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-5 13:36:01
| Show all posts
What database? What does it mean that two tables cannot be joined?
Reply

Use magic Report

2

Threads

12

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-5 14:27:01
| Show all posts
I am an Access database, and I am prompted at runtime:
Syntax error (operator missing) in query expression 'Kucun.Kcsl + RukuTmp.Rksl from Kucun'.

So I judge it is ', RukuTmp' is not recognized by the program, can I only follow one table after the update?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list