Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-6515

Error reading from database when downloading in text format

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1, 3.2
    • 3.1.1
    • Module: Questionnaire
    • None

      In some cases we get the following error downloading some questionnaires in text format:

      {{Error reading from database

      More information about this error
      Debug info: ORA-01790: expression must have same datatype as corresponding expression

      SELECT MOODLELIB.UNDO_MEGA_HACK(MOODLELIB.TRICONCAT(SUBSTR(qr.id, 1, 1300), SUBSTR('', 1, 1300), MOODLELIB.TRICONCAT(SUBSTR('textbox', 1, 1300), SUBSTR('', 1, 1300), SUBSTR(qrt.id, 1, 1300)))) AS id,
      qr.submitted, qr.complete, qr.grade, qr.username, u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename, u.firstname, u.lastname, u.username, u.department, u.institution, u.id as userid, qr.id AS rid, qrt.question_id,
      0 AS choice_id, qrt.response, 0 AS rank
      FROM m2questionnaire_response qr
      JOIN m2questionnaire_response_text qrt
      ON qrt.response_id = qr.id

      AND qr.survey_id = :o_param1 AND qr.complete = :o_param2
      LEFT JOIN m2user u ON u.id = CAST(qr.username AS INT)
      UNION ALL
      SELECT MOODLELIB.UNDO_MEGA_HACK(MOODLELIB.TRICONCAT(SUBSTR(qr.id, 1, 1300), SUBSTR('', 1, 1300), MOODLELIB.TRICONCAT(SUBSTR('radiobuttons', 1, 1300), SUBSTR('', 1, 1300), SUBSTR(qrs.id, 1, 1300)))) AS id,
      qr.submitted, qr.complete, qr.grade, qr.username, u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename, u.firstname, u.lastname, u.username, u.department, u.institution, u.id as userid, qr.id AS rid, qrs.question_id,
      qrs.choice_id, qro.response, 0 AS rank
      FROM m2questionnaire_response qr
      JOIN m2questionnaire_resp_single qrs ON qrs.response_id = qr.id

      AND qr.survey_id = :o_param3 AND qr.complete = :o_param4
      LEFT JOIN m2questionnaire_response_other qro ON qro.response_id = qr.id AND qro.choice_id = qrs.choice_id
      LEFT JOIN m2user u ON u.id = CAST(qr.username AS INT)
      UNION ALL
      SELECT MOODLELIB.UNDO_MEGA_HACK(MOODLELIB.TRICONCAT(SUBSTR(qr.id, 1, 1300), SUBSTR('', 1, 1300), MOODLELIB.TRICONCAT(SUBSTR('yesno', 1, 1300), SUBSTR('', 1, 1300), SUBSTR(qrb.id, 1, 1300)))) AS id,
      qr.submitted, qr.complete, qr.grade, qr.username, u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename, u.firstname, u.lastname, u.username, u.department, u.institution, u.id as userid, qr.id AS rid, qrb.question_id,
      0 AS choice_id, qrb.choice_id AS response, 0 AS rank
      FROM m2questionnaire_response qr
      JOIN m2questionnaire_response_bool qrb ON qrb.response_id = qr.id

      AND qr.survey_id = :o_param5 AND qr.complete = :o_param6
      LEFT JOIN m2user u ON u.id = CAST(qr.username AS INT)
      ORDER BY userid, id
      [array (
      'o_param1' => '101',
      'o_param2' => 'y',
      'o_param3' => '101',
      'o_param4' => 'y',
      'o_param5' => '101',
      'o_param6' => 'y',
      )]
      Error code: dmlreadexception
      Stack trace:

      line 474 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 276 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
      line 1142 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
      line 2515 of /mod/questionnaire/questionnaire.class.php: call to oci_native_moodle_database->get_recordset_sql()
      line 2700 of /mod/questionnaire/questionnaire.class.php: call to questionnaire->get_survey_all_responses()
      line 484 of /mod/questionnaire/report.php: call to questionnaire->generate_csv()}}

            mchurch Mike Churchward
            sarjona Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.