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
 

 

right(name,1) in table Update

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

New User


Joined: 28 Mar 2007
Posts: 16
Location: India

PostPosted: Mon May 05, 2008 2:14 pm    Post subject: right(name,1) in table Update
Reply with quote

hi

I have a query like this in a program

update table A
set
(
right(name,1)
where
uuid = :uuid;

the name field declared in copybook is of char(1)
the field is being populated into a variable of char(4) in db2 table
what will the right(name,1) do?

this program is not written by me. so, i want to know why is the developer using this
also, is there any function like this - right()
Back to top
View user's profile Send private message

chan2004

New User


Joined: 28 Mar 2007
Posts: 16
Location: India

PostPosted: Mon May 05, 2008 2:20 pm    Post subject: Reply to: right(name,1)
Reply with quote

one update

just realised that the query is like this
update table A
right(name,1)
values
(name)
where
uuid = :uuid;

will this sql work
what does it do explicitly cause even if we are not using the right() function, it will insert a char(1) variable into char(4).
Back to top
View user's profile Send private message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Mon May 05, 2008 4:11 pm    Post subject: Reply to: right(name,1) in table Update
Reply with quote

Hi,

There is right function. If you type QW RIGHT at ur shop u will get all the details.


[/code]
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon May 05, 2008 4:43 pm    Post subject:
Reply with quote

chan2004,

what does you sql look like?
Code:

update table A
right(name,1)
values
(name)
where
uuid = :uuid


even your second post sucks. where is the SET keyword?

top of the page are links to manuals. suggest you get acquainted with them; you are never going to get very far if you can not even copy sql. as a result, you are only going to get guesses.

right is a db2 function. RTFM.
Quote:

The RIGHT function returns a string consisting of the specified number of rightmost integer characters of string-expression. If string-expression is a character or binary string, a character is a byte. If string-expression is a graphic string, a character is a DBCS character.



hy have you not tested this sql in qmf/spufi?
#
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 Adding a userid to SMTP Security table Yolanda Harvey JCL & VSAM 1 Sun Aug 13, 2017 6:16 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 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


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