Hi,
I am not sure if this is the correct thread for this, please let me know if I am in the wrong area. I am learning progress.
I have run into a problem -
I have a bat file that does this:
CALL "C:\Users\test\Desktop\Pear\SQLQueryOutput.exe" "C:\Users\test\Desktop\Pearson\Queries\PearDistrict.txt" "C:\Users\test\Desktop\Pear\data\CODE_DISTRICT.txt"
and I just have a progress select as the query it is below:
SELECT "DISTRICT-CODE" as "district_code", "DISTRICT-Name" as "dc", '2015' as "hire_year" FROM "TEST"."PUB"."DISTRICT" "DISTRICT" where "DISTRICT-CODE" = '12345'
The XML that calls the sqlqueryoutput is just a configuration that links to my progress open edge driver. It is below as well:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString" value="Driver={Progress OpenEdge 10.2B driver};Host=XX.XXX.XXX.XXX;DB=TEST;Port=XXXXX;uid=xxxxxx;pwd=xxxxx"/>
<add key="FieldDelimiter" value=","/>
<add key="FieldSurrounder" value="""/>
<add key="ShowColumnHeaders" value="true"/>
<add key="ShowRecordCount" value ="false"/>
<add key="COMMANDTIMEOUT" value="240" />
</appSettings>
</configuration>
My problem is when the bat file executes the task and runs the query and puts the results into the text file, I get a empty row below the column header row.
I get this resultset:
district_code,dc,hire_year
"12345","Test","2015"
But I need this without any empty row after the headers.
district_code,dc,hire_year
"12345","Test","2015"
Anyone know how I could accomplish this? I am stuck.
Thank You
SQL query wont produce any blank line. So, the configuration around it might be adding the blank line. I would check the output after setting the "ShowColumnHeaders" to false.
When I set "showcolumnheaders" to false, there is no empty row. That is good but I need to have the header row as well without the empty row. Is there something in the xml I can do to not include this empty row?
Yes, I agree with Brian
Depending on your environment, you could pass the result through a simple sed script to eliminate blank lines.
Also be on the lookout for extraneous Ctrl-M chars if you are flowing from DOS to Unix or something like that....
Certainly not an elegant solution, but if the original SQLQueryOutput.exe is locked down or the author is inaccessible, these could be workarounds.