Create trigger on view with long raw column

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lisa Tang

    Create trigger on view with long raw column

    Hi,

    I have a table t1 with a long raw column, and I need to create a view
    v1 with a long raw column being a function ff1 of the long raw column
    in t1. And I need to update t1 with reverse function rf1 whenever
    there is update, insert or delete to v1. My problem is it is not
    allowed to refer long raw from :new or :old, so I cannot get the long
    raw value when v1 is inserted, updated or deleted. Could anyone give
    me some advice or suggestions?

    Let's repharse my problem as following:

    Fix conditions:

    create table t1 (col1 number, col2 long raw);
    create view v1
    as select col1,
    ff1(col2) /* ff1 also return long raw */
    from t1;

    Want to achieve:
    create trigger v1_insert instead of insert on v1
    declare
    begin
    insert into t1
    (col1,
    col2)
    values
    (:new.col1,
    rf1(:new.col2)) ; /* I know :new.col2 is invalid */
    end;

    The creation of above trigger will return:
    ORA-04093: references to columns of type LONG are not allowed in
    triggers

    Welcome all kind of possible way. Many thanks!

    Regards,
    LT
  • Hans Forbrich

    #2
    Re: Create trigger on view with long raw column

    Lisa Tang cross-posted to several newsgroups:
    Hi,
    >
    I have a table t1 with a long raw column, and I need to create a view
    v1 with a long raw column being a function ff1 of the long raw column
    This is a comp.databases. oracle.server question. Responses will be found
    there. Please do not cross-post within the comp.databases. oracle
    heirarchy.

    Comment

    Working...