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: 6967
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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm


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