Page 1 of 1
How to skip the header when executing a query in batch
Posted:
Sun Aug 19, 2018 6:51 pm
by rakeshsneha1212
Hi everyone,
Can someone please help me how to skip the header when executing a SQL query in batch mode and writing it to a dataset. I will be validating the dataset further to check if it is empty or not.
Regards,
Rakesh MS
topic split
Re: How to skip the header when executing a query in batch
Posted:
Mon Aug 20, 2018 4:06 pm
by NicC
What header?
Re: How to skip the header when executing a query in batch
Posted:
Mon Aug 20, 2018 5:11 pm
by rakeshsneha1212
Hi Nicc,
I want only the value along with their respective columns to be in the output. I don't want the SQL statements and other generic messages in the output.
Just a sample of my output
1
1PAGE 1
***INPUT STATEMENT:
SELECT A.E058_PO_NBR, A.W001_RR_NBR,
'PO NOT FOUND' AS REMARKS
FROM LOWES.W001_PO_DAL_HDR A
WHERE
((A.E058_PO_NBR = 037532269 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 037532270 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
OR (A.E058_PO_NBR = 002711657 AND A.W001_RR_NBR = 01 )
)
AND NOT EXISTS (
SELECT 1 FROM
LOWES.T7914_IPT_PO_HDR_OTB_EDI_SS T7914
WHERE T7914.PO_RFR_NBR = A.E058_PO_NBR);
+------------------------------------------------+
| E058_PO_NBR | W001_RR_NBR | REMARKS |
+------------------------------------------------+
1_| 37532269 | 1 | PO NOT FOUND |
+------------------------------------------------+
0SUCCESSFUL RETRIEVAL OF 1 ROW(S)
What I need in my output is just as below
+------------------------------------------------+
| E058_PO_NBR | W001_RR_NBR | REMARKS |
+------------------------------------------------+
_| 37532269 | 1 | PO NOT FOUND |
+------------------------------------------------+
Regards,
Rakesh MS
Re: How to skip the header when executing a query in batch
Posted:
Tue Aug 21, 2018 12:44 am
by NicC
Please use the code tags when posting data, code, reports or anything else requiring a fixed pitch font.
To get what you want you need to post-process the output to remove the lines that you do not want.