You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

To load 1000 rows using application engine

4 replies [Last post]
Bhavya's picture
User offline. Last seen 5 years 39 weeks ago. Offline
Joined: 03/19/2012
Posts: 3

I want to load 1000 rows from a record using app engine.
It shud not stop for errors.
The process shud display error in log and continue processing.
How to achieve this?Kindly help me.

Saiyed Parwez's picture
Saiyed Parwez (not verified)
Re: To load 1000 rows using application engine

Hi,
When you write a SQL in app engine ,the app engine does not what the SQL is doing.
It simply throws the SQL to database.
If you try inserting 1000 rows at one time and if the database finds an error inbetween the insertion due to some reason -- Duplicate rows,foreign key etc.The database will stop processing it and it will rollback all the changes.So ,you will end up inserting no rows.

There may be many ways to do it :
1.Put a do select that should process only one row at a time and put the property of that step as "Continue" on error.So the Do select will loop for 1000 times.It will skip the row which has error and will load only correct row.
2.Call a unix script within the app engine ,Using EXEC function(Synchronous Mode) and use Database procedures in the script to skip errored-out rows.You may need the help of your DBAs for this.

Please let me know should you have any questions.
Thanks
Saiyed.

Saiyed Parwez's picture
Saiyed Parwez (not verified)
Re: To load 1000 rows using application engine

----Please read the first line as----

"When you write a SQL in app engine ,the app engine does not KNOW what the SQL is doing."

Thanks
Saiyed

Bhavya's picture
User offline. Last seen 5 years 39 weeks ago. Offline
Joined: 03/19/2012
Posts: 3
Re: To load 1000 rows using application engine

Hi Saiyed,

Thanks for the information.
What if we use peoplecode(using CI) for loading instead of SQL.
How do we control it in PC?

Saiyed's picture
Saiyed (not verified)
Re: To load 1000 rows using application engine

Hi,

Through CI you may skip some levels of warnings and errors but database errors can not be skipped.
The CI will fail loading it and app engine will fail.

If before hand you know what kind of errors can come .
You may load only those rows which are valid.For this you do not need a CI at all.
A SQL to get the correct set of rows is enough.
If its a case of duplicate rows being inserted then modify your SQL to filter out the duplicate rows.

If you could explain what is your requirement in more detail, i can give you a better solution...

Thanks
Saiyed.

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
4 + 13 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.