Please ignore the bottom part of this message, I hit reply and forgot to
remove the other persons message.

Thanks,

David
  -----Original Message-----
  From: David Jones [mailto:[EMAIL PROTECTED]
  Sent: Monday, May 24, 2004 3:32 PM
  To: CF-Talk
  Subject: CFQueryparam

  This may be a simple question but, what is the BEST way to handle this
  dynamically at run time?

  I have a program that writes out a text file with a ton of queries on it.
  The queries are generated with text entered by the user from another page.
  When people enter "#" signs the query parameters in my generated text file
  look like.

  <cfqueryparam cfsqltype="cf_sql_varchar" value="Text #1">

  Obviously when I run the generated script the script bombs on the "#".

  Any suggestions would be appreciated.

  CF 5.0
  Windows 2000 Server

  David

    -----Original Message-----
    From: daniel kessler [mailto:[EMAIL PROTECTED]
    Sent: Monday, May 24, 2004 2:46 PM
    To: CF-Talk
    Subject: Re: oracle unique id or identity

    > Daniel chopped it off in his version

    yeah since I was getting errors, I was trying to simplify to determine
the
  problem.

    >flpweb is not the CF datasource, per se, though in your set up, it
might
  be.
    >It's actually the oracle user account.

    ah that makes a world of difference.  It's scoped.  We don't seem to
have
  users of a table; I don't generally include un/pwd.

    >The other two you are correct on. However, if you're getting the
    >insufficient privs error, I would say that you got the general info
  correct.
    >Let's take CF out of the picture for a moment. In your Oracle account
  (via
    >sqlplus or Toad or whatever tool you use), log in as the user that owns
  the
    >table you're going to update.
    >Run the trigger script.

    I don't have access to the GUI tools here at the college.  Our IT has
told
  my partner here that they're insecure so off-limits.  Really doesn't help,
  since I'm a DB novice.

    Nonetheless, I got the command to make the trigger work using your
  original code, which was easy once I realized there was no 'user'.  It
told
  me that it executed.  I did:
    -----
    CREATE OR REPLACE TRIGGER trg_hhp_calendar_id
    BEFORE INSERT
    ON hhp_calendar
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
        iCounter hhp_calendar.id%TYPE;
        cannot_change_counter EXCEPTION;
    BEGIN
        IF INSERTING THEN
            Select uniqueNum_s.NEXTVAL INTO iCounter FROM Dual;
            :new.id := iCounter;
        END IF;

        IF UPDATING THEN
            IF NOT (:new.id = :old.id) THEN
                RAISE cannot_change_counter;
            END IF;
        END IF;

    EXCEPTION
         WHEN cannot_change_counter THEN
             raise_application_error(-20000, 'Cannot Change Counter Value');
    END;
    /

    ---------
    btw, it didn't like the "BEFORE INSERT  OR UPDATE".  I had to delete the
  OR UPDATE, so I guess I shouldn't have included the "IF UPDATE" part.  oh
  well, no real harm.

    Now the bad part.  When I try to insert a new record, I receive an
error,
  "[Macromedia][Oracle JDBC Driver][Oracle]ORA-04098: trigger
  'DPCH.TRG_HHP_CALENDAR_ID' is invalid and failed re-validation".

    Also, in the INSERT, I fill in an entry for ID, which is also being
filled
  by the trigger.  I just figured that the trigger would toss it.  True?
The
  insert looks like:

    INSERT INTO HHP_CALENDAR
          (id,header,http,description,dateAdded,event_date,image)
         VALUES

(6,'#Form.header#','#Form.http#','#Form.description#',#the_date#,#the_event_
  date#,'#Form.image#')
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to