Uploaded image for project: 'Lucee Development'
  1. LDEV-370

cfscript Query doesn't play well with oracle parameters

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.5.1.015
    • Fix Version/s: 4.5.2.008, 5.0.0.61
    • Labels:
      None
    • Environment:

      Oracle database

      Description

      In oracle, you can parameterize a statement by prepending the parameter with a colon. Normally this isn't a problem in a typical web app on railo. So this is an edge case. But lets say we had some code that would deploy a database, including database triggers. Oracle uses parameters in triggers. So you can't use query.cfc to create the trigger. Here is an example of an oracle sql statement that uses colons.

      CREATE OR REPLACE TRIGGER triggerDir
      BEFORE INSERT ON triggerTest
      FOR EACH ROW

      BEGIN
      SELECT triggerSeq.NEXTVAL
      INTO :new.col1
      FROM dual;
      END;
      (notice the :new, parameter)

      This would cause lucee to see the :new parameter and will expect the parameter to be provided. It throws this exception "The named parameter [1] has not been provided".

      I propose we allow "escaping" colons by using double colons. In the example above. e.g. ::new which will be compressed to a single colon.

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              colby.litnak Colby Litnak
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: