Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1281
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us