IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to INSERT a UPPER case data/fields into DB2 table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top