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: 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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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