Home > Back-end >  Warehousing question
Warehousing question

Time:09-25




I now the warehouse receipt, submit only one input, too much trouble, use adoquery + datesouce + aodconnect + sql2000

I don't know in the picture above, can add check, one-time submit multiple do?

CodePudding user response:

1, establish a common storage list table, it includes choice, name, specifications, quantity, unit price, quantity, date of put in storage, and other fields, the supplier in advance entry list of commonly used objects data
Open the table 2, the warehousing, select the project, click on the selection and entry into the Treasury quantity data, such as
3, mass storage, set up a key event, through the cycle inventory list table, judgment, selection and the effective number of warehousing, through SQL statements, to the inventory table, batch scions into the inbound data,
Complete the mass storage, so roughly, for reference only,

CodePudding user response:

One-time submit multiple

Performance on the interface, is the point of you submit, box will be written to the database,

In the program, that is, you need to use multiple insert into to build insert statement, and then through the transaction to commit,


Here is a use the SQL transaction,
 

The SET IMPLICIT_TRANSACTIONS ON
DECLARE @ myerror INT - used to store the error number
The SET @ myerror=0

Insert into TBL (c1, c2,... ) values (' v1 ', 'v2,... )
SET @ myerror=@ myerror + @ @ ERROR - if an ERROR, then the ERROR accumulation number
Insert into TBL (c1, c2,... ) values (' v1 ', 'v2,... )
SET @ myerror=@ myerror + @ @ ERROR - if an ERROR, then the ERROR accumulation number
IF @ myerror> 0 - if execution error
The BEGIN
PRINT 'transfer failure, is preparing to roll back the transaction! '
The ROLLBACK TRANSACTION
END
ELSE, if no problems in the process of
The BEGIN
PRINT 'transfer success, ready to commit the transaction! '
COMMIT the TRANSACTION
END

CodePudding user response:

Use temporary table, increase a column indicates whether or not the choice, the default is 0, box, this column is 1,
When presented, screening the temporary table, find out this as 1, then add to the official table,

CodePudding user response:

reference ZBDZJX reply: 3/f
use temporary table, increase a column indicates whether or not the choice, the default is 0, box, this column is 1,
When presented, screening the temporary table, find out this as 1, and then added to the official table,


Screening of the temporary table, and find out this as 1, and then added to the official table, how to write the code?

CodePudding user response:

Assumption now shows the content of the interface is a "SQL statement generated,"

To generate a temporary table:
Select the convert (int, 0) SelFlag, * into a temporary table from (SQL) aa

Checked in the interface, SelFlag becomes 1,

Are presented, and execute the select * from a temporary table where SelFlag=1, if return record number is zero, an error; If return record number greater than zero, is circulating a a warehousing, warehousing statements before and only one record into the Treasury of basically the same way,
  • Related