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.

Usage of Arrays

3 replies [Last post]
Michael's picture
User offline. Last seen 12 years 36 weeks ago. Offline
Joined: 04/10/2008
Posts: 6

Hi All,

I want some guidance in using arrays...I have read a CSV file in which there will be multiple rows for an employee..I have read this rows and insert them at second scroll level using an CI...I got suggestions that by using arrays we can do this..can anyone guide me in this..i know that we can read each row one by one and open an CI and insert at level2...but this is not efficient...I want to store the rows related to the same employee in an array...and then insert them at a time using CI...so give me a thought on this...i m basically not understanding how to use that CreateArrayRept so help me with this..

CompShack's picture
User offline. Last seen 6 years 23 weeks ago. Offline
Joined: 12/09/2007
Posts: 167
Re: Usage of Arrays

There's no easy way to do a bulk insert using a CI! Component interface just isn't suited to do that. Your array idea wont help, I don't think.
The best way would be to write your own interface using a traditional tool like SQR or Application Engine. If you want to use bulk insert capabilities then try using file layouts and application engine.

Sorry Michael, but there isn't an easy way for this.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Michael's picture
User offline. Last seen 12 years 36 weeks ago. Offline
Joined: 04/10/2008
Posts: 6
Re: Usage of Arrays

Hi Compshack.

Thanks for your prompt reply...Wat if we load the data from the CSV file to a staging table...then is there any easy way to do this...because my manager said that the data may be loaded into a staging table..if not he said that we may have to load it into a staging table..let me know about any easy method if data is there in a staging table..Thanks.

CompShack's picture
User offline. Last seen 6 years 23 weeks ago. Offline
Joined: 12/09/2007
Posts: 167
Re: Usage of Arrays

If data is already loaded on staging tables, then you can use application engine to load the data. It should be pretty easy to do with some SQL actions. Now, using component interface to insert data will put you back where you started, and that is inserting one row of data at a time. The benefit from using this method is that all of your business logic (edits) behind your component will fire on the data being inserted, thus almost no coding to edit data will be required.

If you want bulk inserts, you would then need to add your own business logic to the data being loaded from the staging table to your core tables. If data is not already on staging tables, you will have to load them in using file layouts to read data in from your CSV file.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog