× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



To follow up on Rob's comment, I've been a long time user of the Squirrel
SQL Client, which allows you resize columns to the longest entry in the
column. Typically, though, I export the results to Excel, which allows you
to resize all columns in one shot.

Navigator's Run SQL Scripts, from what I can tell, does not allow resizing
to the longest entry. (I'm using the Windows client version, so that
feature may have been added since then.) Edit: Just now installed ACS, and
Run SQL Scripts there does not have this resize feature.

- Dan

On Wed, Mar 22, 2017 at 7:23 AM, Rob Berendt <rob@xxxxxxxxx> wrote:

Often you will find that you need to CAST the column. Check out the
difference in these three statements

select objname, objtype,
objtext,
objsize
FROM TABLE(QSYS2.OBJECT_STATISTICS('ROB', '*ALL')) AS a
order by objsize desc

select objname, objtype,
left(objtext, 5) as Short,
objsize
FROM TABLE(QSYS2.OBJECT_STATISTICS('ROB', '*ALL')) AS a
order by objsize desc

select objname, objtype,
cast(left(objtext, 5) as char(5)) as Short,
objsize
FROM TABLE(QSYS2.OBJECT_STATISTICS('ROB', '*ALL')) AS a
order by objsize desc

Then again, if it's just for display purposes and if you run these in Run
SQL Scripts instead of STRSQL you may find that you don't give a rip.

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: "Steinmetz, Paul" <PSteinmetz@xxxxxxxxxx>
To: "'Midrange Systems Technical Discussion'"
<midrange-l@xxxxxxxxxxxx>
Date: 03/21/2017 05:02 PM
Subject: Can an SQL field be shortned for output display and/or
print?
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



Can an SQL field be shortened for output display and/or print?

I tried using Left(field, length).
No impact, no change.

SELECT Left(Local_Address,15) , Local_Port, Job_Name,
Remote_Address FROM QSYS2.NETSTAT_JOB_INFO WHERE Local_ADDRESS =
'10.5.2.5' ORDER BY Local_port, REMOTE_ADDRESS , JOB_NAME
SELECT statement run complete.

Thank You
_____
Paul Steinmetz
IBM i Systems Administrator

Pencor Services, Inc.
462 Delaware Ave
Palmerton Pa 18071

610-826-9117 work
610-826-9188 fax
610-349-0913 cell
610-377-6012 home

psteinmetz@xxxxxxxxxx<mailto:psteinmetz@xxxxxxxxxx>
http://www.pencor.com/

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.