SQL-92 Header and Count Suppression

jeremy.hogan

New Member
I'm trying to write a SQL-92 query from a script that writes to a text file but it's writing a header line and record count. In Transact-SQL you use the line "SET NOCOUNT ON" but this doesn't seem to work in SQL-92. Is there an equivalent statement to prevent the header from being written?
 

TomBascom

Curmudgeon
You might want to consider sharing the name of tool that you are using to execute your query, the version of OpenEdge that you are querying, and the actual query being used.
 

jeremy.hogan

New Member
You might want to consider sharing the name of tool that you are using to execute your query, the version of OpenEdge that you are querying, and the actual query being used.
The version of OpenEdge is 11.7. I'm using WinSQL within an automated script which calls this simple SQL query:

SELECT pub.ser_mstr.ser_serial_id + ',' + pub.ser_mstr.ser_part + ',' + ltrim(rtrim(pub.ser_mstr.ser_lotser))
FROM pub.ser_mstr
JOIN pub.pt_mstr ON pub.pt_mstr.pt_part = pub.ser_mstr.ser_part and
pub.pt_mstr.pt_domain = pub.ser_mstr.ser_domain
WHERE (pub.ser_mstr.ser_site = '1US-PDC2' or
pub.ser_mstr.ser_site = 'DUS-PDC2' or
pub.ser_mstr.ser_site = 'ZUS-PDC2') and
pub.pt_mstr.pt_part_type = 'FG' and
pub.pt_mstr.pt_group = 'BOVEDA' and
left(pub.ser_mstr.ser_serial_id,1) <> 'Z' and
(left(pub.ser_mstr.ser_part,1) = 'B' or
left(pub.ser_mstr.ser_part,2) = 'MB') and
pub.ser_mstr.ser_commission_date = (curdate() - 1)
Order by pub.ser_mstr.ser_serial_id asc

Thanks in advance for any help you can provide.
 

TomBascom

Curmudgeon
I don't think it is the SQL engine per se that is doing that.

I experimented a bit with the built in sqlexp tool and:

1) It does not return a count.

2) I can change the @ReportFormat from "standard" to "by label" with changes the output from what you describe to a format with no headers but with side labels.

To me these results suggest that the tool being used to query the data is doing the formatting and that the place to look for options to adjust that is within the tool.
 

jeremy.hogan

New Member
Thanks you for the helpful information. You may be correct with the WinSQL providing the formatting. I couldn't find an option to suppress it but ended up inserting a powershell script immediately following to trim the header and footer from the raw data as a workaround.
 
Top