"output to" question
Posted in 2017
Topics: Stored Procedures & SPL
Hi All,
I am having an issue with the following code
output to /opt/gim2usr/scripts/nbupstat1.sql without headings
select "UPDATE STATISTICS MEDIUM FOR TABLE "||trim(tabname)||";"
from systables
where ....
when the output string exceeds 65 characters the line is split
example:
UPDATE STATISTICS MEDIUM FOR TABLE gwk_tax_harvest_request_rules;
UPDATE STATISTICS MEDIUM FOR TABLE gwk_tax_harvest_request_securi
ties;
UPDATE STATISTICS MEDIUM FOR TABLE gwk_tax_harvest_requests;
is there a config setting for this or a work around?
Hi John.
UNLOAD TO '/opt/gim2usr/scripts/nbupstat1.sql' DELIMITER ';'
SELECT 'UPDATE STATISTICS MEDIUM FOR TABLE '||TRIM(tabname)
FROM systables
WHERE ...
Regards,
Doug
Hi, John.
A simple and ready to go solution:
output to /opt/gim2usr/scripts/nbupstat1.sql without headings
select "UPDATE STATISTICS MEDIUM FOR TABLE ",trim(tabname)||";"
from systables
where ....
Hope it helps.
Best regards.
Alexandre Marini
IBM Informix Certified Professional v10 / v11.50 / v11.70 / v12.10
IBM Informix on Cloud - Database Administrator - 2017
IBM dashDB Managed Service for Analytics and Transactions - 2017
DB2 Advanced DBA - v10.5 for LUW
IBM Information Management Informix Technical Professional
IBM Certified Developer - Informix Genero
________________________________
De: ids-bounces@iiug.org <ids-bounces@iiug.org> em nome de JOHN HENRY
<jhenry@gwkinvest.com>
Enviado: quarta-feira, 1 de novembro de 2017 10:30
Para: ids@iiug.org
Assunto: "output to" question [40123]
Hi All,
I am having an issue with the following code
output to /opt/gim2usr/scripts/nbupstat1.sql without headings
select "UPDATE STATISTICS MEDIUM FOR TABLE "||trim(tabname)||";"
from systables
where ....
when the output string exceeds 65 characters the line is split
example:
UPDATE STATISTICS MEDIUM FOR TABLE gwk_tax_harvest_request_rules;
UPDATE STATISTICS MEDIUM FOR TABLE gwk_tax_harvest_request_securi
ties;
UPDATE STATISTICS MEDIUM FOR TABLE gwk_tax_harvest_requests;
is there a config setting for this or a work around?
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Thank you Doug and Alexandre. Both suggestions were great, I'm going to move forward with Alexandre's suggestion because it is less code change, although both suggestions would get me to where I needed to be.