473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DB2 CLP - formatting text columns

Hi All!

I am using the DB2 CLP tool and want to format my text columns in a
query to truncate the results of a wide text field - 50 char field but
I want to display only the first 10 chars.

My base query:
SELECT EPT620.FORM_TYPE, EPT620.CREATED_BY, EPT620.STATUS,
EPT634.SURNAME \
FROM DB2ADMIN.EPT620 EPT620, DB2ADMIN.EPT634 EPT634 \
WHERE EPT634.UNPAID_LEAVE_FORM_ID = EPT620.FORMID

1)
How do I specify colum formatting?

2)
Where do I find help on this? The help system here:
http://publib.boulder.ibm.com/infoce...help/index.jsp
is so confusing!

Thanks for any assistnace!

Rob
:)
Nov 12 '05 #1
1 10654
re********@optushome.com.au wrote:
Hi All!

I am using the DB2 CLP tool and want to format my text columns in a
query to truncate the results of a wide text field - 50 char field but
I want to display only the first 10 chars.

My base query:
SELECT EPT620.FORM_TYPE, EPT620.CREATED_BY, EPT620.STATUS,
EPT634.SURNAME \
FROM DB2ADMIN.EPT620 EPT620, DB2ADMIN.EPT634 EPT634 \
WHERE EPT634.UNPAID_LEAVE_FORM_ID = EPT620.FORMID

1)
How do I specify colum formatting?

2)
Where do I find help on this? The help system here:
http://publib.boulder.ibm.com/infoce...help/index.jsp
is so confusing!

Thanks for any assistnace!

Rob
:)


1) For a base query:

SELECT TABNAME FROM SYSCAT.TABLES WHERE TABSCHEMA='DB2ADMIN'

which returns TABNAME as VARCHAR(128) if I want to display only 8 characters
of table name - and as a bonus get warning when actual name is longer,
I would use:

SELECT CAST(TABNAME AS CHAR(8)) FROM SYSCAT.TABLES WHERE TABSCHEMA='DB2ADMIN'

and get this output:

1
--------
CL_SCHED
DEPARTME
SQL0445W Value "DEPARTMENT" has been truncated. SQLSTATE=01004

EMP_ACT
EMP_PHOT
SQL0445W Value "EMP_PHOTO" has been truncated. SQLSTATE=01004

EMP_RESU
SQL0445W Value "EMP_RESUME" has been truncated. SQLSTATE=01004

EMPLOYEE
IN_TRAY
ORG
PROJECT
SALES
STAFF

11 record(s) selected with 3 warning messages printed.
2) I derived that from
http://publib.boulder.ibm.com/infoce...help/index.jsp

What is so confusing about it?
Jan M. Nelken
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ike | last post by:
Does anyone know where I can find example scritp for formatting text input? I want to have a text box where only legitiamte filesname under unix can be netered (no whitespace, only alphanumeric,...
2
by: J055 | last post by:
Hi I've been looking into different ways of formatting columns/rows in the GridView control. I realize now, I think, that once the datasource is bound to the control the original column type...
0
by: gsb58 | last post by:
Hi! In my application I save text from a RichText box to file, but when previewing the text it turns out like: {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Verdana;}}...
6
by: david.hunter | last post by:
Hi All - I have a list of words that I would like to place into three 'columns', left justfied so that the word in each column 'lines up'. In tables I would simply use mutiple rows, three columns....
3
by: michael sorens | last post by:
The documentation for the RichTextBox is sketchy at best. I want to do a very simple task but I cannot find information on this. I am using a RichTextBox as an output window. Some text I want to...
0
by: Don Miller | last post by:
I'd like to use a programmatically bound GridView to display a dataset (or work with a datareader) that may include everchanging numbers of database columns, in unpredictable order, with varying...
6
by: Glen | last post by:
Hello again, I don't blame anyone for not answering my last post, since I obviously hadn't spent much time researching, but I've come a little ways and have another question. How can I better...
2
by: drfreaky | last post by:
Hello, I want to use a richtextbox for logging status messages. I have three kind of message types and want to use different formatting for them. My problem is, I change the color, add the text...
1
by: Connor Bergman | last post by:
Im trying to create a bank statement basically, and Im having trouble formatting the output to a grid, from a .txt file. And I wrote the file, and can read the first line, and want to pull the date...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.