Will testing \export \import commands I came into a problem in DB2 where the the export was sorting very strangely. Turns out that if i run a select query on the table i created the data is never sorted the same way. Not sure why but I can just give the query a SORT BY clause and my data is returned correctly. Problem is i can't export via a query or I have no option to sort the extracted data so the file created by the export is sorted all wrong. Would be very nice if we could create an export of a query instead of just a table.
something like
option -QUERY 'select * from table where column < 100 order by column'
Per \export man page:
\export [Option ...] [Table ...] Destination
......
If no Tables are specified, \export attempts to execute the SQL statements stored in shell's SQL buffer, and writes the result of queries to Destination.
......
I think you can achieve what you were looking for as:
shell-prompt> select * from table where column < 100 order by column
shell-prompt> \export file_name
I understand how this works now. the wording is correct. it would help to have examples in the docs
I understand how this works now. the wording is correct. it would help to have examples in the docs
Issue #6408 |
Closed |
Won't Fix |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
Per \export man page:
\export [Option ...] [Table ...] Destination
......
If no Tables are specified, \export attempts to execute the SQL statements stored in shell's SQL buffer, and writes the result of queries to Destination.
......
I think you can achieve what you were looking for as:
shell-prompt> select * from table where column < 100 order by column
shell-prompt> \export file_name