Streaming data with named pipes

To load a large amount of data, use a named pipe to stream the data to external tables or to the nzload command. The nzload command loads the data as it fills the pipe and does not exit until it receives the end-of-file indicator. The stdin option is supported for the nzload command.

About this task

The following procedure shows how to use a named pipe to load tables with the nzload command. In the commands, substitute your own pipe, database, table, file, and folder names.

Procedure

  1. Create a zero-length, named pipe file by issuing the Linux® mkfifo command:
    mkfifo mypipe
  2. In a background session, issue the following command:
    nzload -db my_db -t my_table -delim "|" -df /export/home/my_db/mypipe
  3. In a foreground session, issue the following command:
    cat /export/home/nz/my_db/my_table.dat > mypipe