IBM Support

Setting a hex value as a delimiter in nzsql

Question & Answer


Question

How do I specify a hexadecimal value as the field separator parameter using the nzsql -F option? 

Answer

There are various ways to specify field separator parameter for nzsql (-F option) to have a hexadecimal value as a delimiter similar to nzload.

To set the field/column delimiter to a tab, do the following:

    nzsql  -F $'\t'

To specify NO delimiter at all, do the following:
    nzsql  -F ""

To specify a delimiter STRING, use the following as an example:
    nzsql  -F "Hello World!"

To specify any binary character by entering its octal number, do the following:
    nzsql  -F $'\007' # A "bell"
    nzsql  -F $'\040' # A space. A simpler way would be -F " "

You can specify any binary/control/non-printable character by entering its value, as follows:
    nzsql  -F $'\007'                  # A "bell" -- octal notation
    nzsql  -F $'\x7'                   # A "bell" -- hexadecimal notation

From within nzsql, you can specify any binary/control/non-printable character as follows:
    \pset fieldsep '\007'              -- octal notation
    \pset fieldsep '\0x7'              -- hexadecimal notation
[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ439744

Document Information

More support for:
IBM PureData System

Software version:
1.0.0

Document number:
467033

Modified date:
17 October 2019

UID

swg21575169