SQLPlus - spooling to multiple files from PL/SQL blocks

后端 未结 6 1015
说谎
说谎 2020-12-17 04:06

I have a query that returns a lot of data into a CSV file. So much, in fact, that Excel can\'t open it - there are too many rows. Is there a way to control spool

6条回答
  •  醉梦人生
    2020-12-17 04:49

    Have you looked at setting up an external data connection in Excel (assuming that the CSV files are only being produced for use in Excel)? You could define an Oracle view that limits the rows returned and also add some parameters in the query to allow the user to further limit the result set. (I've never understood what someone does with 64K rows in Excel anyway).

    I feel that this is somewhat of a hack, but you could also use UTL_MAIL and generate attachments to email to your user(s). There's a 32K size limit to the attachments, so you'd have to keep track of the size in the cursor loop and start a new attachment on this basis.

提交回复
热议问题