Hi ,
i am generating some data by firing sql query with connecting to the database by my solaris box.
The below one should be the header line of my excel ,here its coming in separate row.
TO_CHAR(C. CURR_EMP_NO
---------- ---------------
LST_NM
--------------------------------------------------------------------------------
FST_NM
--------------------------------------------------------------------------------
DOJ_EMp QVD_CD PLC_CD
----------- -------- --------
DESC_TXT
--------------------------------------------------------------------------------
13-09-2014 34653436
John
Sendrie
TO_CHAR(C. CURR_EMP_NO
---------- ---------------
LST_NM
--------------------------------------------------------------------------------
FST_NM
--------------------------------------------------------------------------------
DOJ_EMp QVD_CD PLC_CD
----------- -------- --------
DESC_TXT
--------------------------------------------------------------------------------
Here is the data, which should start from the second row and fill the data for each employee in a associated row but here also data is coming in a separate row, like have n number of rows.
13-09-2014 34653436 John sendrie 23-APR-2007 MCH1 Hospitalised (Continous hospitalised 1 month or more and long Medical)
13-09-2014 4736543 michal thomas 16-DEC-2008 SO MPCHG1 PCHG1 (Continuous PVr excess - more than 180 days)
Expected foramat of data is tabular/excel format with Fixed header.
can anyone help me to generate the excel file by script.
---------- Post updated at 03:08 PM ---------- Previous update was at 12:42 PM ----------
Below is the script which is actually contain nothing only the query.
Operating system :SUNOS/Solaris
Database : oracle
Current script giving me the correct but inform of data , not inform of record/table/excel.
#!/bin/ksh
sqlplus -s /nolog << EOF
CONNECT test/test@IP
alter session set nls_date_format= 'DD-MON-YYYY';
SELECT TO_CHAR(C.PVR_ACY_START_DTM_UTC+8/24,'DD-MM-YYYY'),D.CURR_EMP_NO,D.LST_NM,D.FST_NM,D.DOJ_EMP,C.VTP_CD,A.VPA_CD,B.DESC_TXT FROM HFG_ACYS A,VMX_USER.JDS_EMP_PLX_TYPES B,EMP E,EMP1 D
And C.Dtd_asdb_Start_Dtm_Utc+8/24 <= Sysdate + 1
(fdmf_ACY_END_DTM_UTC+8/24,'DD-MM-YYYY');
end;
/
EOF