Derby
  1. Derby
  2. DERBY-5602

Add support for a SQL REPEAT(string, count) function

    Details

    • Urgency:
      Normal

      Description

      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

        Activity

        Lukas Eder created issue -
        Lukas Eder made changes -
        Field Original Value New Value
        Labels function sql string
        Mamta A. Satoor made changes -
        Labels function sql string derby_triage10_10 function sql string
        Gavin made changes -
        Workflow jira [ 12651894 ] Default workflow, editable Closed status [ 12801943 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Lukas Eder
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development