0

I want the output as below format in the output file.

Expected OUTPUT:

Table CUSTOMERMSTR
---------------------------

custno         cjd          custtype
-------------- ----------- ------------
cust123      01-OCT-1900           1 
cust123      08-SEP-1997           1 
cust123      01-JAN-1996           1 

3 rows 

AS of NOW:

Table CUSTOMERMSTR
----------------------------

custno|to_char|custtype
cust123|01-OCT-1900|1
cust123|08-SEP-1997|1
cust123|01-JAN-1996|1

This is my expdata.psql file in the UNIX server. This is not giving the expecting format.

Please help me with what I have to add to get the desired output in my .psql script.

--col custno  format 9999999  heading "custno"              
--col cjd   format A25 heading "cjd"    
--col custtype  format 999999999    heading "custtype"       

\t off
\a
\echo 

\echo Table CUSTOMERMSTR
\echo ----------------------------

\echo
select custno,TO_CHAR(cjd,'DD-MON-YYYY'),custtype   from CUSTOMERMSTR;
Ram
  • 11
  • 5
  • Please describe the difference between the output you show and the output you expect. – Laurenz Albe Nov 06 '19 at 06:50
  • Expected OUTPUT: Table CUSTOMERMSTR --------------------------- custno cjd custtype -------------- ----------- ------------ cust123 01-OCT-1900 1 cust123 08-SEP-1997 1 cust123 01-JAN-1996 1 3 rows AS of NOW: Table CUSTOMERMSTR ---------------------------- custno|to_char|custtype cust123|01-OCT-1900|1 cust123|08-SEP-1997|1 cust123|01-JAN-1996|1 – Ram Nov 06 '19 at 06:56
  • I have edited my original post with expected and current output. – Ram Nov 06 '19 at 06:57
  • try this https://stackoverflow.com/questions/9604723/alternate-output-format-for-psql – Ed Bangga Nov 06 '19 at 06:59
  • Still unclear. Do you want exactly that many spaces in your output? – Laurenz Albe Nov 06 '19 at 07:09
  • Not exactly same spaces. – Ram Nov 06 '19 at 07:20

0 Answers0