Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bulk collect or FOR Loop to generate huge data #56

Open
fahadrafique opened this issue May 30, 2024 · 3 comments
Open

bulk collect or FOR Loop to generate huge data #56

fahadrafique opened this issue May 30, 2024 · 3 comments

Comments

@fahadrafique
Copy link

How can we create an Excel file using bulk collect or a straightforward for loop instead of a ref cursor?
I need to handle large data files by utilizing values directly from the loop. The current procedure doesn't allow to retrieve the counter value effectively with a ref cursor.

@mbleron
Copy link
Owner

mbleron commented May 31, 2024

You can create cells one by one within the loop by calling put*Cell procedures, but it'll be slower and more memory consuming than using a SQL data source.

What do you mean by counter value?

@fahadrafique
Copy link
Author

put*Cell is very very slow and consuming huge resources.

counter. i am referring as TOTAL PROCESSED RECORDS within the loop. which i need to display on the front end for the user to how much has been processed so far.

is there any way to get the processed records from within the refcursor, using your technique?

this below PROCESSED RECORD, i need it to get it from your refcusor somehow.

BEGIN
FOR X IN 1..100
LOOP
DBMS_OUTPUT.PUT_LINE('PROCESSED RECORDS='||X)
END LOOP;
END;

@mbleron
Copy link
Owner

mbleron commented May 31, 2024

is there any way to get the processed records from within the refcursor, using your technique?

No, it's not possible to monitor the progress.
ExcelGen is not designed that way, it is a server-side process. Once you call createFile, you have to wait for its completion, then you can retrieve the total number of rows processed via getRowCount.

Conceptually, displaying a progress would also require knowing the total amount of work (i.e. rows) in the first place, which is not possible using a cursor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants