Skip to content

Instantly share code, notes, and snippets.

@jrwarwick
Last active October 4, 2016 16:32
Show Gist options
  • Select an option

  • Save jrwarwick/8dbb7ef0dd7592ccf939d7c6a2aa8dee to your computer and use it in GitHub Desktop.

Select an option

Save jrwarwick/8dbb7ef0dd7592ccf939d7c6a2aa8dee to your computer and use it in GitHub Desktop.
Row generator targeting an output size if exported to CSV
--Row generator query to give us a rougly n MB output to CSV, as specified in the first term of the connect by clause
--thanks to excellent inspiration and resource from Natalka Roshak, https://blogs.oracle.com/sql/entry/row_generators_part_2
select level, rownum,'zero_one_two_three_four_five_six_seven_eight_nine_ten_eleven_twelve_thirteen_fourteen_fifteen' number_names ,1234567890 ten_digit_number --about 115 bytes per row once csv'd
from dual
connect by level <= ( 80 * (1048576 / 112))
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment