Table used in view

Hi all

How can I get uinformation uses of tables as order of hiererchy.

for example.

Name of the table: employee

I want to know in which display uses this table and also another name of the view that uses the anterior view too.

Example of
1. view is created on the Employee table
2. view B is created on A view
3. view C is created on View B.
output must be

view assigned for the employee table



--------------------------------------------------------------------------------
A
B
C

Thanks in advance
Deb
SELECT * FROM user_dependencies CONNECT BY PRIOR name=referenced_name START WITH referenced_name='EMPLOYEE' and Type='VIEW'
/
NAME                           TYPE               REFERENCED_OWNER               REFERENCED_NAME
------------------------------ ------------------ ------------------------------ -------------------
X1                             VIEW               SCOTT                          EMPLOYEE
X2                             VIEW               SCOTT                          X1
X3                             VIEW               SCOTT                          X2                     

Tags: Database

Similar Questions

  • Tables used in views, relaxation

    Hello

    Please let me know the query to find the tables used for the creation of a database and view trigger.

    Thank you and best regards.
    select TABLE_NAME from user_triggers where TRIGGER_NAME=&Trigger_Name
    
  • Benefits of using a table or a view in Oracle

    Hi friends,
    I have a question about the difference between tables and views.

    Greetings

    Girish Sharma wrote:
    Differences between the view and the table:

    A view does not disk space. A fact table.
    A view stores data. A fact table.
    A view cannot be indexed. A table can.

    Yes... but then, someone is bound to point out that views can be materialized in persistent data objects. ++*

    * Looks like we now also lost smileys here... Jives does not introduce any new features, it eliminates existing. Hooray for Jives...

  • How the identity if one table used only by synonyms and not by any other subprogrammes in a schema?

    Hi people

    How the identity if one table used only by synonyms and not by any other subprogrammes within a schema. I see in the TOAD describe objects tab used by, but I would like to identify hundreds of table so I would like to know if there would be any SQL or Meta Data Tables?

    How the identity if one table used only by synonyms and not by any other subprogrammes within a schema. I see in the TOAD describe objects tab used by, but I would like to identify hundreds of table so I would like to know if there would be any SQL or Meta Data Tables?

    The ALL_DEPENDENCIES view has hierarchical information based on object_id

    The view object has the object_type.

    Create a hierarchical query on the first view and attach it to the second view.

    Or you can use the utldtree.sql file in the installation of the DB admin folder. Comments initially show you how a hierarchical query based on the object type.

  • Add FK between a table and a view?

    Is this possible in 4.1 to add a FK between a table and a view (off of course)?

    If I'm in a view, it seems that I can define a FK to another view or a table, but if I start with a table, some views appear in the list. The view already has a defined PK.

    Is it normal?

    Use case: I have a table of generic code, so I'm set up views on the code for each type of code table. Then, I want at least diagram CF from specific code view of the code typed column on a table for the sub.

    Hello Kent,

    Is this possible in 4.1 to add a FK between a table and a view (off of course)?

    Yes.  You can do this by clicking on the icon of the new foreign key above the diagram, then by selecting the view first, then the table.

    I connected an enhancement request to allow a foreign key to a view to be added using the table properties dialog box.

    Thanks for pointing it.

    David

  • Difference between the table and Materialized View

    Is there an advantage outside automatic synchronization (founded refresh selected type) using Materialized View?

    I came across this question as table and MV both store values, and we can also update table using the code what is the need of MV? Why not create a table instead of MV with the same definition and same charly?

    I need some explanation to force someone to convince himself.

    Thank you

    http://docs.Oracle.com/CD/B19306_01/server.102/b14223/basicmv.htm

    Sections that highlight its strengths:

    1. materialized views for data warehouses

    2. materialized views for distributed computing

    Query, re - write, features as Materialized view log files that can be used for replication between databases, etc...

  • extracting data from the CLOB using materialized views

    Hello

    We have xml data from clob which I have a requirement to extract (~ 50 attributes) on a daily basis, so we decided to use materialized views with refreshes full (open good suggestions)

    A small snippet of code

    CREATE THE MWMRPT MATERIALIZED VIEW. TASK_INBOUND

    IMMEDIATE CONSTRUCTION

    FULL REFRESH ON DEMAND

    WITH ROWID

    AS

    SELECT M.TASK_ID, M.BO_STATUS_CD, b.*

    OF CISADM. M1_TASK m,

    XMLTABLE (' / a ' XMLPARSE PASSING ())

    CONTENT '< a > | M.BO_DATA_AREA | "< /a >."

    ) COLUMNS

    serviceDeliverySiteId varchar2 (15) PATH

    "cmPCGeneralInfo/serviceDeliverySiteId"

    serviceSequenceId varchar2 (3) PATH "cmPCGeneralInfo/serviceSequenceId"

    completedByAssignmentId varchar2 (50) PATH "completedByAssignmentId."

    Cust_id varchar2 (10) PATH "cmPCCustomerInformation/customerId,"

    ACCT_SEQ varchar2 (5) PATH "customerInformation/accountId"

    AGRMT_SEQ varchar2 (5) PATH cmPCCustomerAgreement/agreementId"."

    COLL_SEQ varchar2 (5) PATH "cmPCGeneralInfo/accountCollectionSeq"

    REVENUE_CLASS varchar2 (10) PATH "cmPCCustomerAgreement/revenueClassCode"

    REQUESTED_BY varchar2 (50) PATH ' attributes customerInformation/contactName',...~50

    This ddl ran > 20 hours and no materialized view created. There are certain limits that we have

    • Cannot create a materialized view log
    • cannot change the source as its defined provider table
    • cannot do an ETL

    DB is 11g R2

    Any ideas/suggestions are very much appreciated

    I explored a similar approach, using the following test case.

    It creates a table "MASTER_TABLE" containing 20,000 lines and a CLOB containing an XML fragment like this:

    09HOLVUF3T6VX5QUN8UBV9BRW3FHRB9JFO4TSV79R6J87QWVGN

    UUL47WDW6C63YIIBOP1X4FEEJ2Z7NCR9BDFHGSLA5YZ5SAH8Y8

    O1BU1EXLBU945HQLLFB3LUO03XPWMHBN8Y7SO8YRCQXRSWKKL4

    ...

    1HT88050QIGOPGUHGS9RKK54YP7W6OOI6NXVM107GM47R5LUNC

    9FJ1JZ615EOUIX6EKBIVOWFDYCPQZM2HBQQ8HDP3ABVJ5N1OJA

    then an intermediate table "MASTER_TABLE_XML" with the same columns with the exception of the CLOB which turns into XMLType and finally a MVIEW:

    SQL > create table master_table like

    2. Select level as id

    3, cast ('ROW' | to_char (Level) as varchar2 (30)) as the name

    4       , (

    5. Select xmlserialize (content

    XMLAGG 6)

    7 xmlelement (evalname ('ThisIsElement' | to_char (Level)), dbms_random.string ('X', 50))

    8                    )

    9 as clob dash

    10                  )

    11 double

    12 connect by level<=>

    (13) as xmlcontent

    14 double

    15 connect by level<= 20000="">

    Table created.

    SQL > call dbms_stats.gather_table_stats (user, 'MASTER_TABLE');

    Calls made.

    SQL > create table (master_table_xml)

    Identification number 2

    3, name varchar2 (30)

    4, xmlcontent xmltype

    5)

    binary xmltype 6 securefile XML column xmlcontent store

    7;

    Table created.

    SQL > create materialized view master_table_mv

    2 build postponed

    full 3 Refresh on demand

    4, as

    5. Select t.id

    6, t.nom

    7       , x.*

    master_table_xml 8 t

    9, xmltable ('/ r' in passing t.xmlcontent)

    10 columns

    11 path of varchar2 (50) ThisIsElement1 'ThisIsElement1 '.

    12, path of varchar2 (50) ThisIsElement2 'ThisIsElement2 '.

    13, path of varchar2 (50) ThisIsElement3 'ThisIsElement3 '.

    14, path of varchar2 (50) ThisIsElement4 'ThisIsElement4 '.

    15 road of varchar2 (50) ThisIsElement5 'ThisIsElement5 '.

    16, road of varchar2 (50) ThisIsElement6 'ThisIsElement6 '.

    17 road of varchar2 (50) ThisIsElement7 'ThisIsElement7 '.

    18 road of varchar2 (50) ThisIsElement8 'ThisIsElement8 '.

    19 road to varchar2 (50) ThisIsElement9 'ThisIsElement9 '.

    20, path of varchar2 (50) ThisIsElement10 'ThisIsElement10 '.

    21, road to varchar2 (50) ThisIsElement11 'ThisIsElement11 '.

    22 road of varchar2 (50) ThisIsElement12 'ThisIsElement12 '.

    23 road of varchar2 (50) ThisIsElement13 'ThisIsElement13 '.

    24, path of varchar2 (50) ThisIsElement14 'ThisIsElement14 '.

    25 road of varchar2 (50) ThisIsElement15 'ThisIsElement15 '.

    26, path of varchar2 (50) ThisIsElement16 'ThisIsElement16 '.

    27, way to varchar2 (50) ThisIsElement17 'ThisIsElement17 '.

    28 road of varchar2 (50) ThisIsElement18 'ThisIsElement18 '.

    29 road of varchar2 (50) ThisIsElement19 'ThisIsElement19 '.

    30, path of varchar2 (50) ThisIsElement20 'ThisIsElement20 '.

    31, path of varchar2 (50) ThisIsElement21 'ThisIsElement21 '.

    32 road of varchar2 (50) ThisIsElement22 'ThisIsElement22 '.

    33, path of varchar2 (50) ThisIsElement23 'ThisIsElement23 '.

    34 road of varchar2 (50) ThisIsElement24 'ThisIsElement24 '.

    35 road of varchar2 (50) ThisIsElement25 'ThisIsElement25 '.

    36, road to varchar2 (50) ThisIsElement26 'ThisIsElement26 '.

    37, path of varchar2 (50) ThisIsElement27 'ThisIsElement27 '.

    38, path of varchar2 (50) ThisIsElement28 'ThisIsElement28 '.

    39, path of varchar2 (50) ThisIsElement29 'ThisIsElement29 '.

    40, road of varchar2 (50) ThisIsElement30 'ThisIsElement30 '.

    41 road of varchar2 (50) ThisIsElement31 'ThisIsElement31 '.

    42, path of varchar2 (50) ThisIsElement32 'ThisIsElement32 '.

    43, road to varchar2 (50) ThisIsElement33 'ThisIsElement33 '.

    44, path of varchar2 (50) ThisIsElement34 'ThisIsElement34 '.

    45, path of varchar2 (50) ThisIsElement35 'ThisIsElement35 '.

    46, path of varchar2 (50) ThisIsElement36 'ThisIsElement36 '.

    47, path of varchar2 (50) ThisIsElement37 'ThisIsElement37 '.

    48, path of varchar2 (50) ThisIsElement38 'ThisIsElement38 '.

    49, path of varchar2 (50) ThisIsElement39 'ThisIsElement39 '.

    50 road of varchar2 (50) ThisIsElement40 'ThisIsElement40 '.

    51, path of varchar2 (50) ThisIsElement41 'ThisIsElement41 '.

    52, path of varchar2 (50) ThisIsElement42 'ThisIsElement42 '.

    53, path of varchar2 (50) ThisIsElement43 'ThisIsElement43 '.

    54, path of varchar2 (50) ThisIsElement44 'ThisIsElement44 '.

    55 road of varchar2 (50) ThisIsElement45 'ThisIsElement45 '.

    56, path of varchar2 (50) ThisIsElement46 'ThisIsElement46 '.

    57, path of varchar2 (50) ThisIsElement47 'ThisIsElement47 '.

    58 road of varchar2 (50) ThisIsElement48 'ThisIsElement48 '.

    59 road of varchar2 (50) ThisIsElement49 'ThisIsElement49 '.

    60 road of varchar2 (50) ThisIsElement50 'ThisIsElement50 '.

    (61) x;

    Materialized view created.

    The discount is then performed in two steps:

    1. INSERT INTO master_table_xml
    2. Refresh the MVIEW

    (Note: as we insert in an XMLType column, we need an XML (only root) document this time)

    SQL > set timing on

    SQL >

    SQL > truncate table master_table_xml;

    Table truncated.

    Elapsed time: 00:00:00.27

    SQL >

    SQL > insert into master_table_xml

    2. select id

    3, name

    4, xmlparse (document '' |) XmlContent |'')

    5 master_table;

    20000 rows created.

    Elapsed time: 00:04:38.72

    SQL >

    SQL > call dbms_mview.refresh ('MASTER_TABLE_MV');

    Calls made.

    Elapsed time: 00:00:22.42

    SQL >

    SQL > select count (*) in the master_table_mv;

    COUNT (*)

    ----------

    20000

    Elapsed time: 00:00:01.38

    SQL > truncate table master_table_xml;

    Table truncated.

    Elapsed time: 00:00:00.41

  • Functions Pipeline Table with other tables using

    I'm on DB 11.2.0.2 and used sparingly in pipeline table functions, but plans to arrays for a project that has a pretty big (many lines). In my tests, selecting from the table in pipeline perform well enough (if it's directly from the table pipleined or the view from above, I have created). Where I start to see some degregation when I try to join the tabe in pipeline discovered at other tables and add where conditions.

    Download

    SELECT A.empno, A.empname, A.job, B.sal

    OF EMP_VIEW A, B OF THE EMP

    WHERE A.empno = B.empno AND

    B.Mgr = '7839'

    I've seen articles and blogs that mention this as a matter of cardinality and offer some undocumented methods to try to fight.

    Can someone please give me some tips or tricks on this. Thank you!

    I created a simple example using the emp table below to help illustrate what I'm doing.

    DROP TYPE EMP_TYPE;

    DROP TYPE EMP_SEQ;

    CREATE OR REPLACE TYPE EMP_SEQ AS OBJECT

    (EMPNO NUMBER (10),)

    ENAME VARCHAR2 (100),

    VARCHAR2 (100)) WORK;

    /

    CREATE OR REPLACE TYPE EMP_TYPE AS TABLE EMP_SEQ;

    /

    FUNCTION to CREATE or REPLACE get_emp back EMP_TYPE PIPELINED AS

    BEGIN

    TO heart (SELECT IN

    EmpNo,

    Ename,

    job

    WCP

    )

    LOOP

    PIPE ROW (EMP_SEQ (cur.empno,

    cur. Ename,

    cur.job));

    END LOOP;

    RETURN;

    END get_emp;

    /

    create or REPLACE view EMP_VIEW select * from table (get_emp ());

    /

    SELECT A.empno, A.empname, A.job, B.sal

    OF EMP_VIEW A, B OF THE EMP

    WHERE A.empno = B.empno AND

    B.Mgr = '7839'

    bobmagan wrote:

    The ability to join would give me the most flexibility.

    Pipelines can be attached. But here is the PL/SQL code - no tables. And without index.

    Consider a view:

    create or replace view sales_personel in select * from emp where job_type = 'SALES '.

    And you use the view to determine the sellers in department 123:

    Select * from sales_personel where dept_id = 123

    Oracle considers that logically the next SQL statement like her can be pushed in the view:

    select * from emp where job_type = 'SALES' and dept_id = 123


    If the two columns in the filter are indexed for example, he may well decide to use a fusion of index to determine what EMP lines are dirty and department 123.

    Now consider the same exact scenario with a pipeline. The internal process of pipelines are opaque to the SQL engine. He can't say the internal code pipeline "Hey, don't give me employees service 123".

    He needs to run the pipeline. It must evaluate each channeled line and apply the "dept_id = 123" predicate. In essence, you must treat the complete pipeline as a table scan. And a slow that it take more than a simple disc lines when you perform the transformation of data too.

    So yes - you can use the predicates on the pipelines, can join them, use analytical SQL and so immediately - but expect it to behave like a table in terms of optimization of SQL/CBO, is not realistic. And pointing to a somewhat flawed understanding of what a pipeline is and how it should be designed and used.

  • Calculate the percentage using narrative view?

    Hi all

    I have a table like this.

    Sales for the month in Prod
    Jan aa 4500
    Feb bb 5500

    Now, I'm going to display content like this by using Narrative view.we use OBIEE11g.

    sale of 5500 we recevied in FEB comapred to 4,500 of the previous month.it increase by 1%.

    Please any help.

    Thank you
    Aerts

    Published by: 958741 on September 14, 2012 03:24

    Published by: 958741 on September 14, 2012 06:08

    Check this thread:

    Re: formula in a narrative mode You may need to modify to your specific needs.

    So useful, please mark as correct or useful.

  • Update of a Base Table in a view with a UNPIVOT function.

    Hello
    I have a requirement to upgrade a Base Table in a view.
    This view has the query by using a function of the UNPIVOT operator to display the columns in the tables of the basic of the lines.
    I need to update/insert in / remove the Base Table by accessing the view (the user has access to the Base Table, so the DML on the view).

    Here is the table I created:-
    CREATE TABLE PERSON_DETAILS
    (
      PID            VARCHAR2(10 BYTE),
      FIRSTNAME      VARCHAR2(1000 BYTE),
      LASTNAME       VARCHAR2(1000 BYTE),
      PHONENUMBER    VARCHAR2(1000 BYTE),
      ADDRESS1       VARCHAR2(1000 BYTE),
      ADDRESS2       VARCHAR2(1000 BYTE),
      COUNTRY_CODE   VARCHAR2(1000 BYTE),
      LANGUAGE_CODE  VARCHAR2(1000 BYTE),
      EMAIL          VARCHAR2(1000 BYTE)
    )
    The sample values are inserted in this table using the script below: -.
    insert into person_details values ('1','XYZ','ABC','1234567890','India','Asia','IN','EN','[email protected]');
    insert into person_details values ('2','XYZ2','ABC2','1234567890','India','Asia','IN','EN','[email protected]');
    The code for the display is as below: -.
    CREATE OR REPLACE FORCE VIEW PERSON_DETAILS_VIEW
    (
       PID,
       CD_NAME,
       CD_VALUE
    )
    AS
       SELECT "PID", "CD_NAME", "CD_VALUE"
         FROM person_details UNPIVOT INCLUDE NULLS (cd_value
                             FOR cd_name
                             IN  (firstname AS 'First Name',
                                 lastname AS 'Last Name',
                                 phonenumber AS 'Phonenumber',
                                 address1 AS 'address1',
                                 address2 AS 'address2',
                                 country_code AS 'Country Code',
                                 language_code AS 'Language Code',
                                 email AS 'Email') );
    Here are the values of the view:-
    PID CD_NAME         CD_VALUE
    1    First Name       XYZ
    1    Last Name       ABC
    1    Phonenumber  1234567890 
    1    address1         India
    1    address2         Asia
    1    Country Code   IN
    1    Language Code EN
    1    Email               [email protected]
    2    First Name       XYZ2
    2    Last Name       ABC2
    2    Phonenumber  1234567890
    2    address1         India
    2    address2         Asia  
    2    Country Code   IN
    2    Language Code EN
    2    Email               [email protected]
    The user would fire any statement as below: -.
    update person_details_view 
    set cd_value = 'US' where CD_NAME = 'IN'
    The statement above should update the PERSON_DETAILS database table.

    I understand that I can write an INSTEAD OF trigger, but I don't know what logic to write in the trigger so that the condition is met.

    My Version of Oracle
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0    Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    Any help would be much appreciated.

    Thank you
    Ankit Khare.

    Published by: Ankit_Khare84 on June 28, 2012 14:47

    It is definitely possible with an INSTEAD of trigger.

    for example:

    create or replace
    TRIGGER ioft_person
    INSTEAD OF UPDATE
    ON person_details_view
    FOR EACH ROW
    declare
    firstname1  person_details.firstname%type;
    BEGIN
    
                  SELECT firstname_new into firstname1
                  FROM   (SELECT pid, cd_name, cd_value
                          FROM   
    
                              (
                                  select * from person_details_view where (pid, cd_name) not in (select :new.pid, :new.cd_name from dual)
                                  union all
                                  select :new.pid, :new.cd_name, :new.cd_value from dual
                              )
    
                          )
                  PIVOT  ( max(cd_value) AS new FOR (cd_name) IN
                                                          ('First Name' AS firstname,
                                                            'Last Name' as lastname,
                                                            'Phonenumber' as phonenumber,
                                                            'address1' as address1,
                                                            'address2' AS address2,
                                                            'Country Code' as country_code,
                                                            'Language Code' as language_code,
                                                            'Email' as email
                                                            )
                  )  where pid = :old.pid;
    
      UPDATE person_details
      SET firstname = firstname1
      WHERE pid = :old.pid;
    END ioft_role_perm;
    

    and that run

    update person_details_view
    set cd_value = 'X|X' where cd_name = 'First Name' and pid=1
    

    The logic is: you need to convert back the view through swivel

  • creating a view and use the view in a model

    Hi all

    I'm new to OBIEE, and I have a requirement that I have two fields to be added to a domain. Because we cannot add queries directly to a model, I have to create a view and then put the request in it, and then use the view in this model.
    I did not understand this well, if someone could help me, explaining in detail the view and adding a query in it?

    Thank you
    Gohan

    Hello

    (a) If you want to use your existing DB view please tick box import meta option data - RPD--> file menu
    (b) If you want to create the new view in RPD itself just right click anyof a physical table--> properties--> click the genral--> change the type of array as "Select" then you create/update your sql query, and then click ok that's all
    Once created, you can deploy advice on the database (right mouse button) or you can leave the view cancelled (worst performance).

    Ref steps more to create views
    http://gerardnico.com/wiki/dat/OBIEE/opaque_view
    http://allaboutobiee.blogspot.com/2012/05/OBIEE-11g-deployundeploy-view-in.html

    Thank you
    Deva

  • The use of view to create a list of values?

    Hi, I try to use the view to create LOV, but I do not know name of the Table/view drop-down list, how do I find the list of reviews?

    Thanks in advance,

    Karman

    Karman,

    You can type directly, on behalf of the view instead of going through the search list. If you do not know the name of the view, you can open the SQL workshop in a new window or tab.

    -David

  • How to find objects (tables) used in MS

    Is there any query with which I find all the tables that are used (to perform the operation Select Insert Update Delete) in a procedure in oracle 10g.

    I want to take on all the tables used in particular. but it is more difficult to find by looking at the line by line as the sp is 3 k + lines.

    View USER_DEPENDENCIES:

    SELECT referenced_owner, referenced_name
    FROM user_dependencies
    WHERE type = 'PROCEDURE'
    AND name = 'YOUR_SP_NAME'
    AND referenced_type = 'TABLE'
    ;
    
  • Retrieval of a list of objects of entity without using a view

    This is probably a really basic question, but I did have to do something like this for the moment. I mainly worked on my user interface so far and have used views exclusively. Now, I just want to back work that gets EO of the database, iterate through the evaluation office, one by one.

    Let's say I have an entity object named "Subscription" which is mapped to my "Subscription" using ADF BC (MySQL) database table.

    How can I get a list of populated, subscription objects that I can go, instead of having to use a view object?

    Of course

    Take a look at the code example [url http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcquerying.htm#CHDECJHD] in the documentation - Yes, the code has a few extra things in there you don't need (such as the definition of the place where clause), but you have an idea how to create a module of the app and get an instance of original Version of it.

    John

  • How to insert a new record or update existing record by using a view complex?

    Currently, I created this screen, there is no problem on display data, on the update feature (average TI insert / update / delete on the table for which the view is based on).

    I have a table and a view complex in order to display the information in the table in a form of tabellar (IE up to 70 record in same "record" in the form, one for each article)

    The view is like this



    Select a.f1, a.f2, get_value(a.pk1,1) a1, a2 get_value(a.pk1,2), get_value(a.pk1,3) a3...

    from my_table a

    where a.proj_id = user





    and I want to allow the update of the field a1, a2, a3 in a multiplace (tabellar) canvas.

    I created a TRIGGER INSTEAD.

    But it works not only in the form. I get FRM-40654 error when I try to change the existing value in the form running based on this point of view.

    The view is woking and editable using sql-plus.

    If I have question
    Select * from ALL_UPDATABLE_COLUMNS where table_name = 'SPV_BOQ_BOM_POS_ACTIVITIES ';

    where "SPV_BOQ_BOM_POS_ACTIVITIES" is the name of my point of view.

    The question is: why if the view is updatable using SQL * Plus, is not editable using the Oracle 10 g 2 form?

    Could someone help me ASAP?

    Thank you

    Forms to lock the record when you start editing. It is is by a statement of the type

    SELECT 
      FROM 
     WHERE =
       FOR UPDATE NOWAIT;
    

    If this attempt fails, the error you are getting is displayed. As solution to create a trigger-LOCK-ON on the block and with which replace standard logic.

Maybe you are looking for