Reputation: 5655
I'm working on iPad app which has SQLiteDB as a backend.
I'm searching for string padding concepts in sqlite queries.
Can any one provide sqlite query for below data.
Need to fill the empty spaces with the character 'Y', and Need to apply the padding with character 'Y' up to 20 characters.
For Example.
If Input Column's value String is : YY YN
Then Output Column's value String Should be: YYYYNYYYYYYYYYYYYYYY
Please assume the column name is 'size' and the table name is 'sizetable'.
I just need a query which supports on sqlite , No objective-C coding.
Any comments or suggestions would be appreciated.
Thank you in advance.
Upvotes: 0
Views: 276
Reputation: 180060
SELECT substr(size || 'YYYYYYYYYYYYYYYYYYYY', 1, 20) FROM sizetable
Upvotes: 1