-
Type:
Improvement
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 10.8.2.2
-
Fix Version/s: None
-
Component/s: SQL
-
Labels:
-
Urgency:Normal
A similar function was discussed with Rick Hillegas in this ticket:
https://issues.apache.org/jira/browse/DERBY-5597
Apparently, JDBC mentions a REPLACE function in its appendix:
> Compare the JDBC escape function (from Appendix D2 of the 4.1 JDBC spec):
> "REPLACE(string1, string2, string3) Replaces all occurrences of string2 in string1 with string3"
It also mentions a REPEAT function
"REPEAT(string, count) A character string formed by repeating string count times"
This REPEAT function would be a nice-to-have enhancement to simulate padding directly in the database, where this may be needed. Most databases ship with some form of REPEAT:
- RPAD(string, LENGTH(string) * count) in Oracle, Ingres
- REPLICATE(string, count) in Sybase ASE, SQL Server
- REPEAT(string, count) in DB2, H2, HSQLDB, MySQL, Postgres, Sybase SQL Anywhere