Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-1030

ORA-04098 error when creating triggers through cfquery

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.2.0.001
    • Fix Version/s: None
    • Labels:
    • Steps to Reproduce:
      Hide

      <cfset mydsn = "wheelstestdboracle">
      <cftry>
      <cfquery name="loc.query" datasource="#mydsn#">
      DROP TABLE users
      </cfquery>
      <cfquery name="loc.query" datasource="#mydsn#">
      DROP SEQUENCE users_seq
      </cfquery>
      <cfcatch>
      </cfcatch>
      </cftry>

      <cfquery name="loc.query" datasource="#mydsn#">
      CREATE TABLE users
      (
      id number(38,0) NOT NULL
      ,username varchar(50) NOT NULL
      ,password varchar(50) NOT NULL
      )
      </cfquery>

      <cfquery name="loc.query" datasource="#mydsn#">
      CREATE SEQUENCE users_seq START WITH 1 INCREMENT BY 1
      </cfquery>

      <cfquery name="loc.query" datasource="#mydsn#">
      CREATE TRIGGER bi_user BEFORE INSERT ON users FOR EACH ROW BEGIN SELECT users_seq.nextval INTO :NEW.id FROM dual; END;
      </cfquery>

      <cfquery name="loc.query" datasource="#mydsn#">
      INSERT INTO users ( USERNAME , PASSWORD )
      VALUES ( 'tonyp', 'tonyp123' )
      </cfquery>

      Show
      <cfset mydsn = "wheelstestdboracle"> <cftry> <cfquery name="loc.query" datasource="#mydsn#"> DROP TABLE users </cfquery> <cfquery name="loc.query" datasource="#mydsn#"> DROP SEQUENCE users_seq </cfquery> <cfcatch> </cfcatch> </cftry> <cfquery name="loc.query" datasource="#mydsn#"> CREATE TABLE users ( id number(38,0) NOT NULL ,username varchar(50) NOT NULL ,password varchar(50) NOT NULL ) </cfquery> <cfquery name="loc.query" datasource="#mydsn#"> CREATE SEQUENCE users_seq START WITH 1 INCREMENT BY 1 </cfquery> <cfquery name="loc.query" datasource="#mydsn#"> CREATE TRIGGER bi_user BEFORE INSERT ON users FOR EACH ROW BEGIN SELECT users_seq.nextval INTO :NEW.id FROM dual; END; </cfquery> <cfquery name="loc.query" datasource="#mydsn#"> INSERT INTO users ( USERNAME , PASSWORD ) VALUES ( 'tonyp', 'tonyp123' ) </cfquery>
    • Workaround Description:
      Hide

      none

      Show
      none

      Description

      when creating a trigger through cfquery the trigger created is invalid, thus resulting in a ORA-04098 when the code tries to use the trigger.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                rip747 tony petruzzi
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: