0

I am trying to create an external table file from the netezza database. There is one Numeric column in the table with value 0.00. The external table file generated stores only 0 and truncates the rest of it. However, when on using nzsql from the command prompt to pull the same data it stores the entire field as it is in the database. I have tried the IGNOREZERO command when using the create external table but this flag only works if the field is char or varchar.

table field in database:

 ___________
|NUMERIC_COL|
-------------
|   0.00    |
-------------

The command used to create external table:

nzsql  -u -pw -db -c "CREATE EXTERNAL TABLE 'file' USING (IGNOREZERO false) AS SELECT numeric_col FROM table;"

output: 0

Now, if I use nzsql to select the same field

nzsql -u -pw -db  -c "SELECT numeric_col FROM table;"

output: 0.00

Is there a flag/command I could use to save the decimals in the external table. Thanks!

Jenny
  • 355
  • 1
  • 2
  • 10
  • just to make sure I get it right: Mathematically, the numbers ‘0’ and ‘0.00’ are equal, but you want it to add (leftpad) extra zeroes? Why? – Lars G Olsen Feb 12 '20 at 06:35
  • yes you are right they are same. But i need data in the external table file to replicate the database's column as it is. – Jenny Feb 12 '20 at 15:33

0 Answers0