Home > database >  10 w level data validation, want to use a function to perform validation and returns a custom record
10 w level data validation, want to use a function to perform validation and returns a custom record

Time:09-25

Background: the development of an imported check function, because of the large amount of data, in order to facilitate the batch, so the front desk through the import documents, to realize the database corresponding to the batch of documents information

Problems existing in the current project: because of the large amount of data, early didn't consider such a problem, cause the import function for a long time did not response and an error, even memory explosion, GC automatic recycle all not a line, so want to call a stored function to the 10 w level number through into the oracle stored function to carry on the batch, check, information processing of the documents at the same time, the information you need to merge into a record return,


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Dear leaders, I have two problems need leaders to help me here:
1, to the storage function, the parameter is an array List, how can I get in oracle this definition? And return values, I want to a record return, so that I can take an object on the Java side to receive the corresponding field information, but at present there is a problem, return the information, the field name don't know how to define in oracle,

More than 2, the optimization of memory approach is correct? - this leaflet number directly to the storage function to deal with, I don't need definition so many objects in Java, don't need a for loop that much, then I do addition and subtraction last saved again,

CodePudding user response:

With the front desk processing data into a file, and file import database so that no

CodePudding user response:

Using SQLLDR loaded directly to the temporary table, the data and then the batch data of temporary tables, rather than use stored procedures to receive the data,

CodePudding user response:

reference 1st floor wandier response:
with the front desk processing data into a file, and file import database so that no any

Memory is not enough, a virtual machine memory footprint is too much, because the import number query returns the amount of data is too big

CodePudding user response:

The stored procedure, this is not suitable for cycle may slow instead more burden on the background, can all the data are loaded into the database in the temporary table, then call a stored procedure to determine the final insert formal table, check the data in the table behind mark the failure

CodePudding user response:

refer to the second floor jdsnhan response:
use SQLLDR directly loading the data into a temporary table, then the batch data of temporary tables, rather than use stored procedures to receive data,


Have not used this way, you said any examples to a?

CodePudding user response:

reference 4 floor sxq129601 response:
the stored procedure, this is not suitable for cycle may slow instead more burden on the background, can all the data are loaded into the database in the temporary table, then call a stored procedure to determine the final insert formal table, check failure data in the table behind mark the


Meaning in building a database table as the temporary storage of data, put all the import data into a temporary table, then to the database is handled?
  • Related