Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
John Henry's OUTPUT TO ... WITHOUT HEADINGS split generated UPDATE STATISTICS lines at about 65 characters. Doug Lawry suggested UNLOAD TO with a DELIMITER instead. Alexandre Marini suggested selecting the text and the trimmed table name as separate comma-separated columns. John chose Alexandre's as the smaller change. Solved.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
JOHN HENRY — — source: IIUG Forums & Mailing Lists
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.
↪ replying to Alexandre Marini
JOHN HENRY — — source: IIUG Forums & Mailing Lists
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.
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.