Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 6966
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: 1239
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Summing on Mixed Case Literals Roy Ware SYNCSORT 3 Tue Jan 03, 2017 10:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us