Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in DB2 only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
DB2
Lpad Equivalent Of Oracle In Db2
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
techiesekar07
New Member
Join Date:
Mar 2007
Posts:
3
#1
Lpad Equivalent Of Oracle In Db2
Mar 14 '07, 10:05 AM
this is an oracle query SUBSTR(LPAD(xxx xx, 8, 0),3,6)
Please provide me the db2 query for this....
frozenmist
Recognized Expert
New Member
Join Date:
May 2007
Posts:
179
#2
Aug 3 '07, 12:21 PM
Originally posted by
techiesekar07
this is an oracle query SUBSTR(LPAD(xxx xx, 8, 0),3,6)
Please provide me the db2 query for this....
REPEAT('0',6-LENGTH(RTRIM(CA ST(xxxxx AS CHAR(6)))))||RT RIM(CAST(xxxxx AS CHAR(6)))
Comment
Post
Cancel
frozenmist
Recognized Expert
New Member
Join Date:
May 2007
Posts:
179
#3
Aug 3 '07, 12:52 PM
You can also try this
right('000000'| |rtrim(cast(<nu mber> as char(6))),6)
This looks good right....
Cheers,
Rahul
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment