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: 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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts RFE: DB2 support for mixed case names. Pedro DB2 0 Tue Jul 04, 2017 1:32 am


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