Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to INSERT a UPPER case data/fields into DB2 table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
gcchowdary
Warnings : 1

New User


Joined: 26 Dec 2005
Posts: 18
Location: India

PostPosted: Wed Aug 26, 2009 7:40 pm    Post subject: How to INSERT a UPPER case data/fields into DB2 table
Reply with quote

Hi,

I want to know how to INSERT UPPER case data into a DB2 table....
I mean , while trying to insert records using INSERT function, I want data/fields should load a UPPER case.. Please let me know

Thank You,
G C Chowdary
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Aug 26, 2009 7:46 pm    Post subject:
Reply with quote

I usually INSPECT CONVERTING before INSERTing.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Aug 26, 2009 7:52 pm    Post subject:
Reply with quote

...or use intrinsic function UPPER-CASE.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Aug 26, 2009 8:00 pm    Post subject:
Reply with quote

You can even use UPPER(:Host-VAR) in the insert statement.
Back to top
View user's profile Send private message
gcchowdary
Warnings : 1

New User


Joined: 26 Dec 2005
Posts: 18
Location: India

PostPosted: Wed Aug 26, 2009 8:04 pm    Post subject: Hi Terry
Reply with quote

I am INSERTing data into the Db2 table thru the Host variables as below

EXEC SQL
INSERT INTO BENEFIT
(PLAN_CODE,
BM_STATE_CODE)
VALUES
(:Host Var1,
:Host Var2)
END-EXEC

Where can we use UPPER-CASE in this query....Please let me know

I will try Dick's Idea ...
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Thu Aug 27, 2009 11:35 am    Post subject:
Reply with quote

You can use like this.

EXEC SQL
INSERT INTO BENEFIT
(PLAN_CODE,
BM_STATE_CODE)
VALUES
(UPPER(:Host Var1),
UPPER(:Host Var2))
END-EXEC
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us