on 11-04-2020 6:50 AM
Dear team,
I have a field I need to send in an interface and it supposed to be always be 10 characters.
The SBO field I am sending may be shorter then 10 characters, for example if my field is '13' I need to send '13 ' and if my field is '4753' I need to send '4753 '
How can I do this?
Thank you,
Or Cohen
Hi ,
you can modify like below
RPAD(T0."U_CaseNum",10,'0') as "U_CaseNum"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
If it has to be always one space in the end in case your string is less than 10 characters then you can first check the length of string using length function
length(<string>) and then applyying padding using if statement
if(length(<string>) = 10, <string>, RPAD(<string>,length(<string>)+1,' '))
In case you need all the spaces to make it to character 10 for example '13' would become '13 '
after adding 8 spaces in the end then direct padding can be used RPAD(<string>,15,' '))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.