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
 

 

Update varchar column in db2 table

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

New User


Joined: 15 Aug 2006
Posts: 44
Location: Virginia, USA

PostPosted: Wed Oct 07, 2009 7:41 pm    Post subject: Update varchar column in db2 table
Reply with quote

Hi,
Can somebody help me in resolving this sql

Code:
OWNER.TABLE
NM1              CM2          parm1
chr(3)          chr(4)        VARCHAR(60)
-----            ------        --------------------
AAA            BBBB         WHERE (FABLS_PRGMXLMS_TYP1 = 'MP')


Now i need to update the parm1 column with

Code:
UPDATE OWNER.TABLE                                       
 SET PARM1 = "WHERE (FABLS_PRGMXLMS_TYP1 IN ('MPS', 'MP')"
WHERE NM1 = 'AAA'                                     
AND     CM2 = 'BBBB';   


When i ran this query i am getting slqcode = -206
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1280
Location: Belgium

PostPosted: Wed Oct 07, 2009 7:51 pm    Post subject:
Reply with quote

SQL isn't REXX
if you use quotes in a string you need to use two quotes (not double quote)

Code:
UPDATE OWNER.TABLE                                       
 SET PARM1 = 'WHERE (FABLS_PRGMXLMS_TYP1 IN (''MPS'', ''MP'')'
WHERE NM1 = 'AAA'                                     
AND     CM2 = 'BBBB';   
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Oct 07, 2009 7:53 pm    Post subject:
Reply with quote

Please try this.

Code:
UPDATE OWNER.TABLE
 SET PARM1 = 'WHERE (FABLS_PRGMXLMS_TYP1 IN (''MPS'', ''MP'')'
WHERE NM1 = 'AAA'
AND     CM2 = 'BBBB';
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Oct 07, 2009 7:57 pm    Post subject:
Reply with quote

I should have refreshed before posting. icon_wink.gif
Back to top
View user's profile Send private message
alluri12

New User


Joined: 15 Aug 2006
Posts: 44
Location: Virginia, USA

PostPosted: Wed Oct 07, 2009 8:26 pm    Post subject:
Reply with quote

It worked. thanks guyc
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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm


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