Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-12574

Create one sql_cast_char2int() function to provide cross-db casting of CHAR/TEXT to INT

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9, 2.0
    • Fix Version/s: 1.9, 2.0
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      There are some places where we need to CAST some char/text (varchar/clob) columns (or another expressions) to int. And it isn't cross-db by default.

      Provide one function to do so. Should support both CHAR and TEXT columns under all DBs.

      Requested by Tim in MoodleHQ.

        Attachments

          Activity

            People

            Assignee:
            stronk7 Eloy Lafuente (stronk7)
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Tester:
            Nobody
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08