| |

VerySource

 Forgot password?
 Register
Search
View: 881|Reply: 4

Complex issues concerning data reproduction ...

[Copy link]

2

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-3-19 15:30:01
| Show all posts |Read mode
Main table one:
boxID is the primary key,
list:
Auto ID, BoxID ..........

Associated child table of the schedule (associated by ID)
Automatic ID, mainID (Save the automatic ID of the above list)


At this time I was copying all the contents of this list according to the boxID, including the schedule and its subtables.
Because the schedule is multiple records, and the records are generated before they are generated.
In this way, only after copying, use the cursor to get the automatic ID of the detail table, and then store the corresponding sub-table records.

Is there any good way to complete the copy?
Reply

Use magic Report

0

Threads

35

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-6-24 12:00:02
| Show all posts
Don't understand what it means
Reply

Use magic Report

2

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-7-7 22:15:01
| Show all posts
It means that the three tables are related.
such as
An order form (order number)
Two ordered bills of materials (single number associated)

Three pieces of fine code number of a material (associated with the automatic ID of the two tables.)

So I want to copy the entire order form. One table and two tables are easy to handle. Press the old order number to copy to the new order number, but the three tables are troublesome. Because the second table ID is automatically generated.
Reply

Use magic Report

0

Threads

126

Posts

73.00

Credits

Newbie

Rank: 1

Credits
73.00

 China

Post time: 2020-7-8 00:45:01
| Show all posts
select * from three tables where ID= (SELECT ID FROM two tables where single number = new/old single number)
Reply

Use magic Report

2

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-8-3 21:45:02
| Show all posts
Can it be rolled back once it fails?
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