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

Export to Excel failed with error ORA-06502 in xlsx_builder_pkg.finish #35

Open
gorjelin85 opened this issue Nov 3, 2016 · 0 comments
Labels

Comments

@gorjelin85
Copy link

In xlsx_builder_pkg.finish function
any usage of implicit type conversion should be avoided and changed with to_char(), otherwise error ORA-06502 appears when
pls_integer variable is appended to clob t_xxx together with varchar2 variable.
The error is raised when clob t_xxx length is greater than 32767, e.g. when exporting large sets of data to Excel. For instance,

        t_xxx := t_xxx || '<autoFilter ref="' ||
            alfan_col( nvl( workbook.sheets( s ).autofilters( a ).column_start, t_col_min ) ) ||
            nvl( workbook.sheets( s ).autofilters( a ).row_start, workbook.sheets( s ).rows.first() ) || ':' ||
            alfan_col( coalesce( workbook.sheets( s ).autofilters( a ).column_end, workbook.sheets( s ).autofilters( a ).column_start, t_col_max ) ) ||
            nvl( workbook.sheets( s ).autofilters( a ).row_end, workbook.sheets( s ).rows.last() ) || '"/>';

should be changed with

         t_xxx := t_xxx || '<autoFilter ref="' ||
            alfan_col( nvl( workbook.sheets( s ).autofilters( a ).column_start, t_col_min ) ) ||
            to_char(nvl( workbook.sheets( s ).autofilters( a ).row_start, workbook.sheets( s ).rows.first() ) ) || ':' ||
            alfan_col( coalesce( workbook.sheets( s ).autofilters( a ).column_end, workbook.sheets( s ).autofilters( a ).column_start, t_col_max ) ) ||
            to_char(nvl( workbook.sheets( s ).autofilters( a ).row_end, workbook.sheets( s ).rows.last() ) ) || '"/>';       

To_char is already used somewhere inside the code, I think Anton Sheffer forgot about it in newer added features, such as autoFilter.
Unfortunately, I don't know whether he contributes to this code or not anymore and it's impossible to comment his original page , so I'm adressing to you.

@mortenbra mortenbra added the bug label May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants