Enabling Data Extraction Options

Use the data extraction options with care.

Warning!  

If you set the extract options, then execute a SELECT statement, and then execute a second SELECT statement without changing the extract file name, the output of the second SELECT overwrites the output of the first SELECT. Each time you execute a SELECT statement, whether it is one second later or a week later, extract starts over again, unless the Temp_Extract_Append option is set ON.

Also be aware that the extract options are set for the connection. If you set the extract options and another user connects to the database using the same connection, the extract facility is also enabled for that user. Your extraction output can be overwritten by another user on the same connection.

Similarly, if another user logs in using the same user ID, the output of queries run by this user is directed to the extract file until the option is disabled. If you are using extract, be sure to run your request from a unique user ID.

  1. In a separate location, save any old output extract you need to retain.
  2. Remove any previously used extract files.
  3. Set the extraction options you require, making sure to set Temp_Extract_Name1 to the file path that is to receive the output.
  4. Issue a SELECT statement to extract the data you require.
  5. Reset Temp_Extract_Name1 to the empty string, or disconnect if set temporarily, when you are finished making extractions.