> I get "invalid character".  I'm using a form which takes the statement and
puts it in a CF query.  Oh wait.  I removed the semi-colon and it executed
the statement.  So yay! something worked.

That's correct - you can't send the ; in via coldfusion. The jdbc drivers
don't like it.

> In your example, is flpweb the table name or the datasource?  Then
how-about cfs_breakfastdata?  Is breakfastdataid the column?  When I changed
this to my own information, I get the error "insufficient priveleges" which
makes me think that I'm using the values in the incorrect places.  For the
top part of what you gave me, I transposed:

flpweb is not the CF datasource, per se, though in your set up, it might be.
It's actually the oracle user account. For us, our datasources are the
instance (dev/test/production) of Oracle.
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.

Now - do you use the same user when you run queries via CF? If not, then you
need to grant that user permission to your hhp_calendar table. You shouldn't
need to grant access to the trigger, as that all happens behind the scenes.
So, in Oracle again, you'd run a command like so:

grant insert,update,select on hhp_calendar to my_cf_user;

Then, just run a normal query in cf and insert a record. Voila.

> -- dpch is datasource
> -- hhp_calendar is the table
> -- id is the primary key updated by the sequence
>
> CREATE OR REPLACE TRIGGER hhp_calendar.trg_hhp_calendar_id
> BEFORE INSERT  OR UPDATE
> ON hhp_calendar.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;
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to