Skip to main content

Export data from table into multiple files as per table partition

  • November 6, 2014
  • 2 replies
  • 16 views

Naveen_Sidda
I would like to export table data into multiple files containing data from each partition

2 replies

Sajan_Sangraula
Forum|alt.badge.img+1
  • Participating Frequently
  • November 7, 2014
Hi Naveen, You can do the following: //get a list of all partitions for that table select distinct partition_key from partitions where projection_name in (select projection_name from projections where anchor_table_name='' //Move each partition for the table to a transient table select move_partitions_to_table('table_name','partition_key','partition_key','new_table_for_partition'); //Copy data from transient data to flat file vsql -U username -w password -F',' -c "select * from new_table_for_partition" | gzip -f > export_file.gz //move data back to source table or delete table based on requirement Sajan

Naveen_Sidda
  • Author
  • Participating Frequently
  • November 8, 2014
Thanks Sajan