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...

Tags: Database

Similar Questions

  • using plsql table and ref cursor in oracle's 10 g

    Hi all
    Can someone give me an example of a scenario where we need to create a form manually based on a stored database procedure.
    And in this process, I created a pl/sql table and a Ref cursor at the database level.

    CREATE OR REPLACE PACKAGE SCOTT. TYPE BONUS_PKG IS bonus_rec
    IS (RECORD
    EmpNo bonus_EMP.empno%TYPE,
    Ename bonus_EMP.ename%TYPE,
    employment bonus_EMP.job%TYPE,
    SAL bonus_EMP.sal%TYPE,
    Comm bonus_EMP.comm%TYPE);

    TYPE b_cursor IS REF CURSOR RETURN bonus_rec;
    TYPE bontab IS TABLE OF bonus_rec INDEX DIRECTORY.

    PROCEDURE bonus_refcur (bonus_data IN OUT b_cursor);
    PROCEDURE bonus_query (bonus_data IN OUT bontab);
    END bonus_pkg;


    CREATE OR REPLACE PACKAGE BODY SCOTT. BONUS_PKG IS
    PROCEDURE bonus_query (bonus_data IN OUT bontab) IS
    II NUMBER;
    CURSOR bonselect IS
    SELECT empno, ename, job, sal, comm bonus_EMP ORDER BY empno;
    BEGIN
    OPEN bonselect.
    II: = 1;
    LOOP
    Look FOR bonselect IN
    .EmpNo bonus_data (ii),
    .ename bonus_data (ii),
    .job bonus_data (ii),
    .Sal bonus_data (ii),
    .comm bonus_data (ii);
    EXIT WHEN bonselect % NOTFOUND;
    II: = ii + 1;
    END LOOP;
    END bonus_query;

    PROCEDURE bonus_refcur (bonus_data IN OUT b_cursor) IS
    BEGIN
    Bonus_data OPEN to SELECT empno, ename, job, sal, comm bonus_EMP ORDER BY empno;
    END bonus_refcur;

    END bonus_pkg;

    I want to fill in the data in the forms manually is not using Forms data block Wizard and by program.

    Please answer...

    Can someone give me an example of a scenario where we need to create a form manually based on a stored database procedure.

    In general, you will use a block of proceedings based when you have a collection of data from several tables presented in a form and your username must be able to update the information displayed.

    In your sample code, looks like you are using Oracle Support document "Melting a block on a Stored Procedure - examples of Code [ID 66887.1]". If this is the case, continue to follow the document - it guides you through all the steps. There is no need to manually configure things that the data block Wizard will work for you!

    I want to fill in the data in the forms manually is not using Forms data block Wizard and by program.

    Why? Let the wizard block configuration data of your block based on a procedure for you. There is no need to manually browse the data! I did what you're trying, and it's more work needed. Leave forms to do the work for you. :)

    If you absolutely have to do things manually, I recommend that you use the PROCEDURE bonus_query (bonus_data IN OUT bontab) instead of bonus_refcur (bonus_data IN OUT b_cursor) . Then, in your code create a variable of type BONTAB, and then call the bonus_query procedure. Then, it's a simple case of a loop in the table of records returned by the bonus_query procedure. For example:

    DECLARE
       t_bonus    bonus_pkb.bontab;
    BEGIN
       bonus_pkg.bonus_query(t_bonus);
    
       FOR i in 1 .. t_bonus.count LOOP
          :YOUR_BLOCK.EMPLOYEE_NUMBER := t_bonus(i).empno;
          :YOUR_BLOCK.EMPLOYEE_NAME := t_bonus(i).ename;
          :YOUR_BLOCK.EMPLOYEE_JOB := t_bonus(i).job;
          :YOUR_BLOCK.EMPLOYEE_SALARY := t_bonus(i).sal;
          :YOUR_BLOCK.EMPLOYEE_COMMISSION := t_bonus(i).comm;
       END LOOP;
    END;
    

    This code example shows the basics, but as is the sample code - you will need to adapt to your situation.

    Also, I highly recommend that you look at the article inol listed. It is a very thorough debate on the REF CURSOR. If you have set up using a procedure based on the data source - it is more effective to spend the record table to your form that it must pass a ref cursor Using a ref cursor, you might as well just using a standard called cursor and loops on your named cursor. The effect is the same (a line returned at the same time creating lots of network traffic). Using the table of records is more efficient because the data set is returned if the network traffic is reduced.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • I get "failed to set the refresh attribute COMMIT for the materialized view" when I try to create a MV using a table and another MV

    Experts,

    I'm trying to create a YOUNG refreshable ON COMMIT MV (xyz) using a table (circuit) and quickly updateable on validation MV (abc), but get an error:

    SQL error: ORA-12054: cannot set the attribute ON COMMIT refresh for the materialized view

    12054 00000 - "cannot set the refresh attribute COMMIT for the materialized view.

    * Cause: The materialized view did not meet the requirements for update to

    moment of validation.

    * Action: Specify only valid options.

    1] MV abc
    = MV abc defined as below =.

    CREATE MATERIALIZED view abc_MV

    Immediate CONSTRUCTION

    REFRESH QUICKLY YOU COMMIT using constraints of trust

    WITH ROWID AS SELECT n.*,.

    n.ROWID noderowid

    node n

    where n.nodetype in (1610000069,1610007267);


    -Above works OK and MV connect you on table node is created successfully

    =====================================================

    [ 2] Circuit Board

    ======================================================

    CREATE MATERIALIZED VIEW LOG ON Cramer.Circuit WITH SEQUENCE, ROWID ( ) -all columns of table ofcircut parentheses

    INCLUDING THE NEW VALUES;

    -More top works OK and MV connect you on table circuit is created successfully

    ======================================================



    [3] trying to create MV xyz

    ======================================================

    CREATE MATERIALIZED VIEW LOG ON cramer.abc_MV WITH SEQUENCE, ROWID ( ) -all columns of abc_MV brackets

    INCLUDING THE NEW VALUES;

    -Above works OK and log on ABC MV MV gets created successfully

    -Problematic step below

    Xyz_MV CREATE MATERIALIZED VIEW

    IMMEDIATE CONSTRUCTION

    REFRESH QUICKLY YOU COMMIT using constraints of trust

    AS

    SELECT c., c.rowid circuit_rowid, n.rowid tr_rowid

    the circuit c, abc_mv n

    where circuit2startnode = n.nodeid

    and c.rpplanId = n.rpplanId;
    ==========================================================

    Clues on how to solve this problem and make quickly updatable ON Commit MV xyz

    Thanks in advance.

    Chanchal,

    If you can read my original post carefully you may have noticed that all these restrictions will not apply in my case.

    All,

    In any case I found the solution to my problem.

    There are a few additional restrictions for materialized views multilayer

    Additional Restrictions for master materialized views

    The following types of materialized views may not be masters of editable materialized views:

    • ROWIDmaterialized views
    • Complex materialized views
    • Read-only materialized views

    I've updated the underlying MV abc below and everything worked like a charm

    CREATE MATERIALIZED view abc_MV

    Immediate CONSTRUCTION

    REFRESH QUICKLY YOU COMMIT using constraints of trust

    IN SELECT

    n.*, n.rowid noderowid, nt.rowid nodetyperowid

    the node n, nodetype_m nt

    where n.node2nodetype = nt.nodetypeid

    and nt.nodetypeid in (1610000069,1610007267);

    Note: To ADD a join without which I was getting error below (although had primary key on the table of the node)

    SQL error: ORA-23415: materialized view log for "NODE" does not save the primary key

    23415 00000 - "view the log for materialized \"%s\".\"%s\"does not save the primary key.

    * Cause: A primary key materialized view is refreshed quickly, but the

    The materialized view log does not record the primary key information.

    * Action: Use CREATING MATERIALIZED VIEW LOG... Command to add a PRIMARY KEY to

    start recording of the primary key information in the materialized view

    Newspaper.

  • 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

  • Problem with the af:table links and views

    I want to display a table with data from a database table called PERSON, so I use af:table tag.

    The PERSON table has the following fields:

    • PERSON_CODE
    • PERSON_NAME
    • PERSON_COD_STATE

    The PERSON_STATE field is a foreign key to another table called PERSON_STATE:

    • PERSON_COD_STATE
    • DESCRIPTION

    I created a view for the data of the PERSON (personView) table. Because I want to show the person status description in the af: table, I created another view for the data in table PERSON_STATE (personStateView). And I've also created a link between personView and personStateView.

    In the column of the af: table that represents the State of no one, I drop the field 'description' of the State view linked to the view of anyone.

    When I run the JSP, the State is not displayed correctly. All persons are displayed with the same State.

    During the test directly with the application module, the display link works correctly.

    View links inside an af:table work?

    I work with ADF 10 g.

    Thank you

    Your scenario should be treated with a sql (VO on two EOs) join with a relationship master / detail. The table will be able to browse the details for each master record to time stamping.

  • Using a variable in a view?

    I know that it is not possible to use a variable in a view, but I wonder if it isn't a work around? If there is a single value - from another table - you want to reuse in a view that doesn't use dynamic SQL code, how do you then? I've been playing around with statements, but makes me anywhere, I use 11r2.

    BTW, please don't ask me the standard litany of questions in anger-dba (why do this? your database is f *, RTFM, etc.), it's just for my own curiosity. :)

    Thank you


    Example for demo only for purposes (I know that is not syntactically correct):

    var_value variable varchar2 (30)
    Start
    Select this_is_just_one_value
    int: var_value
    from tableX where column1 = "BOB";
    end;

    Select
    numerous_columns
    of tableY
    where
    column 5 =: var_value.

    893968 wrote:

    BTW, please don't ask me the standard litany of questions in anger-dba (why do this? your database is f *, RTFM, etc.), it's just for my own curiosity. :)

    Why are you doing this? your database is f *! RTFM! Etc! ;-)

    SQL is not a procedural language - you can't create a view for example that has a parameter signature. For example, it is possible in a language of the proceedings:

    declare
            cursor c( deptID number ) is
                    select * from emp where deptno = deptID;
    begin
            open c( 1234 ); --// open SQL cursor using a parameter/variable
            --// etc..
            close c;
    end;
    

    It is not possible using a SQL object as a point of view. As a vision is not a procedure. If the same approach than what the above using SQL (stupid example, but only shows the basic principles):

    // define
    create or replace view emp_view as select * from emp;
    
    // use
    select * from emp_view where deptno = 1234;
    

    The CBO is smart - and he's probably going to push such a predicate in the SQL emp_view statement.

    To set up this view, is ugly. And should only be taken into account in dealing with issues such as data security restrictions. A context is created - this may contain a number of name values. The view can then use a name-value of the context. Oracle data dictionary views using this approach.

  • 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

  • How to check the table have are all views in oracle

    Hello
    How to check the table have are all views in oracle
    SELECT * FROM user_dependencies
    WHERE type='VIEW'
    AND referenced_type='TABLE'
    AND referenced_name ='Your_Table_Name' 
    

    You can use dba_dependencies to find views in the different schema.

  • Can I build an application using a table that is owned by another user?

    Greetings,

    I am very beginner in Oracle, and I really need help with this point.
    I created 2 user accounts: user1 and user2.

    In User1, I wrote:

    GRANT CONNECT, RESOURCE
    for User2.

    Grant select, insert, update
    on table1
    for User2.


    Now, user2 can see the content of this table, but only in the part SQL (select * from user1.table1)
    How can I create an application that uses the table1 to user2?
    When I go to application builder, I have to choose one of the tables belonging to the user2. But I can't use table1 User1 although that User2 has permission to access.

    Any help?

    Thank you in advance!

    Beginner's daughter

    Hello

    There is a powerful solution, that you can use.

    You can create a view. Some views may be editable (this means that it is possible to update
    the Table for the view) and you can add some constraints (Primay Key) on a view.

    For example:

    CREATE or REPLACE ADVICE {color: Red} User2.view_name {color}
    (col1 {color: red} {color}, col2 {color: red} {color})
    UNIQUE RELY DISABLE NOVALIDATE,
    The CONSTRAINT {color: red} pk_view {color}
    Col1 PRIMARY KEY {color: red} {color}) MATTER DISABLE NOVALIDATE
    ) AS
    SELECT col1 {color: red} {color}, col2 {color: red} {color} OF {color: Red} User1.Table1 {color};

    This example is from the link below:

    [http://www.psoug.org/reference/views.html]

    Hope this can help.
    Best regards
    Jean Valentine

  • [59053] use of follow-up was stopped because the tracking of use specified table

    Immideatly after starting the server, I'm gettting this newspaper in the NQServer.log.


    [59053] use of follow-up stopped because the specified use following table contained an incorrect number of columns or a column with a type of inappropriate data.

    No idea how I know what table needs to update?

    Thank you

    -SJ

    Here are the details of the paintings I have in the scheme of follow-up to its use:


    CREATE TABLE 'RMI. "" S_NQ_ACCT ".
    ("USER_NAME" VARCHAR2 (128 BYTE),
    VARCHAR2 (128 BYTE) "REPOSITORY_NAME."
    VARCHAR2 (128 BYTE) "SUBJECT_AREA_NAME."
    "NODE_ID" VARCHAR2 (15 BYTE),
    TIMESTAMP 'START_TS' (6).
    TIMESTAMP 'START_DT' (6).
    'START_HOUR_MIN' CHAR (5 BYTES),
    TIMESTAMP 'END_TS' (6).
    "END_DT" TIMESTAMP (6).
    'END_HOUR_MIN' CHAR (5 BYTES),
    'QUERY_TEXT' VARCHAR2 (1024 BYTE),
    NUMBER (10,0) "SUCCESS_FLG."
    "ROW_COUNT" NUMBER (10.0).
    NUMBER (10,0) "TOTAL_TIME_SEC."
    NUMBER (10,0) "COMPILE_TIME_SEC."
    NUMBER (10,0) "NUM_DB_QUERY."
    NUMBER (10,0) "CUM_DB_TIME_SEC."
    NUMBER (10,0) "CUM_NUM_DB_ROW."
    'CACHE_IND_FLG' CHAR (1 BYTE) DEFAULT ' ACTIVATE NOT NULL,.
    "QUERY_SRC_CD" VARCHAR2 (30 BYTES) BY DEFAULT ",
    "SAW_SRC_PATH" VARCHAR2 (250 BYTES) BY DEFAULT ",
    "SAW_DASHBOARD" VARCHAR2 (150 BYTES) BY DEFAULT ",
    "SAW_DASHBOARD_PG" VARCHAR2 (150 BYTES) BY DEFAULT ",
    "PRESENTATION_NAME" VARCHAR2 (128 BYTES) BY DEFAULT ",
    "TEXTE_ERREUR" VARCHAR2 (250 BYTES) BY DEFAULT ",
    "RUNAS_USER_NAME" VARCHAR2 (128 BYTES) BY DEFAULT ",
    NUMBER (10.0) 'NUM_CACHE_INSERTED' DEFAULT NULL,
    NUMBER (10.0) 'NUM_CACHE_HITS' DEFAULT NULL
    ) PCTFREE, PCTUSED, INITRANS 40 10 1 MAXTRANS 255 NOCOMPRESS SLAUGHTER
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "RMI_DATA";


    CREATING INDEX 'RMI. "' S_NQ_ACCT_M1 ' ON 'RMI. "" S_NQ_ACCT "("START_DT","START_HOUR_MIN","USER_NAME")
    PCTFREE, INITRANS 10 2 MAXTRANS 255
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "RMI_DATA";

    CREATING INDEX 'RMI. "' S_NQ_ACCT_M2 ' ON 'RMI. "" S_NQ_ACCT "("START_HOUR_MIN","USER_NAME")
    PCTFREE, INITRANS 10 2 MAXTRANS 255
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "RMI_DATA";

    CREATING INDEX 'RMI. "' S_NQ_ACCT_M3 ' ON 'RMI. "' S_NQ_ACCT ' ('USERNAME')
    PCTFREE, INITRANS 10 2 MAXTRANS 255
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "RMI_DATA";



    CREATE OR REPLACE FORCE VIEW "RMI". "' NQ_LOGIN_GROUP ' ('LOGIN', 'RESP') AS
    Select USER_NAME DISTINCT as "LOGIN", as S_NQ_ACCT RESP. RUNAS_USER_NAME
    ;

    Published by: SachinJ on August 3, 2009 07:54

    Compare the S_NQ_ACCT table that you created with the structure of the table defined in the RPD under the 'Oracle Analytics use' database of physical layer object.

  • Create a trigger instead of update several tables in a view

    Dear everybody

    I am trying to create a trigger that updates instead of to day joined several tables in a view, but I can't get my trigger to work. The create view command was as follows:
    CREATE OR REPLACE VIEW VIEW_MI_JOIN_GC
    AS
    SELECT MAP_INDEX.mi_prinx,
           index_type_id,
           original_map_publication_id,
           original_map_sheet_number_id,
           name_of_feature,
           geog_coordinates_id,
           GEOG_COORDINATES.mi_prinx AS "mi_prinx_polygon",
           GEOG_COORDINATES.geographical_coordinates,
           GEOG_COORDINATES.mapinfo_style_row
     FROM MAP_INDEX
      JOIN GEOG_COORDINATES
       ON geog_coordinates_id=GEOG_COORDINATES.mi_prinx;
    The view above connects a polygon table to the table of function names which means that a polygon appears several times in a view, even though one version of the polygon exists in the base table. This means the direct update of view cannot take place, since 1 polygon can appear multiple times in a view. The two original base tables and their columns names are:
    MAP_INDEX
    ---------
    MI_PRINX
    INDEX_TYPE_ID
    ORIGINAL_MAP_PUBLICATION_ID
    ORIGINAL_MAP_SHEET_NUMBER_ID
    NAME_OF_FEATURE
    MAPINFO_STYLE_ROW
    GEOGRAPHICAL_COORDINATES
    GEOG_COORDINATES_ID
    
    GEOG_COORDINATES
    ----------------
    MI_PRINX
    GEOGRAPHICAL_COORDINATES
    MAPINFO_STYLE_ROW
    Relax, I created was as follows:
    CREATE OR REPLACE TRIGGER TRIG_VIEW_MI_JOIN_GC
       INSTEAD OF UPDATE ON VIEW_MI_JOIN_GC
          REFERENCING NEW AS NEW
     FOR EACH ROW
    BEGIN
     UPDATE MAP_INDEX
      SET mi_prinx = :NEW.mi_prinx,
          index_type_id = :NEW.index_type_id,
          original_map_publication_id = :NEW.original_map_publication_id,
          original_map_sheet_number_id = :NEW.original_map_sheet_number_id,
          name_of_feature = :NEW.name_of_feature,
          mapinfo_style_row = :NEW.mapinfo_style_row,
          geographical_coordinates = :NEW.geographical_coordinates,
          geog_coordinates_id = :NEW.geog_coordinates_id
       WHERE geog_coordinates_id = :OLD.geog_coordinates_id;
     UPDATE GEOG_COORDINATES
      SET mi_prinx = :NEW.mi_prinx,
          geographical_coordinates = :NEW.geographical_coordinates,
          mapinfo_style_row = :NEW.mapinfo_style_row
       WHERE mi_prinx = :OLD.mi_prinx;
    END;
    /
    The idea is that when I draw a new polygon in MapInfo and assign him a revised number geog_coordinates_id and the number of mi_prinx_polygon, which are the same, once I have save the view as then it updates the underlying tables. Geographical_coordinates and mapinfo_style_row of map_index table columns are columns with ancient polygon data which while not having currently new data inserted into them, are required for the previous data they contain. These data are currently being added to the geog_coordinates table with other scripts. The idea is that all the data is then read using a view and updates made to the view, triggering instead of relaxing, so data are not duplicated but still visible as if it were.

    When I created first the relaxation above in SQLdeveloper it seems to run constantly. Then my computer crashed, not related to this work, and I lost session because I did not commit it. I was not ready to commit it because I believe that something is wrong.

    I am in the trigger syntax correctly and I go about it in the right way? I want to only update the rows that have changed, that's why I was using: NEWS and: OLD.

    Kind regards

    Tim

    Published by: user467357 on November 18, 2008 18:07
    I modified my script a little because there were a few errors. for example. start and old as old and view name typo

    Something like this->

    satyaki>
    satyaki>select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    
    Elapsed: 00:00:01.78
    satyaki>
    satyaki>
    satyaki>create table MAP_INDEX
      2   (
      3        mi_prinx                    NUMBER(10) not null,
      4        index_type_id                NUMBER(6) not null,
      5        original_map_publication_id  NUMBER(6) not null,
      6        original_map_sheet_number_id NUMBER(6) not null,
      7        name_of_feature              VARCHAR2(80) not null,
      8        mapinfo_style_row            VARCHAR2(80),
      9        geographical_coordinates    SDO_GEOMETRY,
     10        geog_coordinates_id          NUMBER(10),
     11        constraints pk_mi_prinx primary key(mi_prinx)
     12   );
    
    Table created.
    
    Elapsed: 00:00:04.39
    satyaki>
    satyaki>create table GEOG_COORINDATES
      2   (
      3     mi_prinx NUMBER(10) not null,
      4     geographical_coordinates SDO_GEOMETRY,
      5     mapinfo_style_row VARCHAR2(80),
      6     constraints pk_mi_prinx_n primary key(mi_prinx)
      7   );
    
    Table created.
    
    Elapsed: 00:00:00.30
    satyaki>
    satyaki>
    satyaki>CREATE OR REPLACE VIEW VIEW_MI_JOIN_GC
      2  AS
      3  SELECT MAP_INDEX.mi_prinx,
      4         MAP_INDEX.index_type_id,
      5         MAP_INDEX.original_map_publication_id,
      6         MAP_INDEX.original_map_sheet_number_id,
      7         MAP_INDEX.name_of_feature,
      8         MAP_INDEX.geog_coordinates_id,
      9         GEOG_COORINDATES.mi_prinx AS "mi_prinx_polygon",
     10         GEOG_COORINDATES.geographical_coordinates,
     11         GEOG_COORINDATES.mapinfo_style_row
     12   FROM MAP_INDEX , GEOG_COORINDATES
     13   WHERE MAP_INDEX.geog_coordinates_id=GEOG_COORINDATES.mi_prinx;
    
    View created.
    
    Elapsed: 00:00:00.32
    satyaki>
    satyaki>
    satyaki>insert into MAP_INDEX values(
      2                                 &mi_prinx,
      3                                 &index_type_id,
      4                                 &original_map_publication_id,
      5                                 &original_map_sheet_number_id,
      6                                 '&name_of_feature',
      7                                 '&mapinfo_style_row',
      8                                 null,
      9                                 &geog_coordinates_id);
    Enter value for mi_prinx: 1
    old   2:                                &mi_prinx,
    new   2:                                1,
    Enter value for index_type_id: 44
    old   3:                                &index_type_id,
    new   3:                                44,
    Enter value for original_map_publication_id: 5678
    old   4:                                &original_map_publication_id,
    new   4:                                5678,
    Enter value for original_map_sheet_number_id: 356
    old   5:                                &original_map_sheet_number_id,
    new   5:                                356,
    Enter value for name_of_feature: AA
    old   6:                                '&name_of_feature',
    new   6:                                'AA',
    Enter value for mapinfo_style_row: GG
    old   7:                                '&mapinfo_style_row',
    new   7:                                'GG',
    Enter value for geog_coordinates_id: 9
    old   9:                                &geog_coordinates_id)
    new   9:                                9)
    
    1 row created.
    
    Elapsed: 00:00:00.16
    satyaki>/
    Enter value for mi_prinx: 2
    old   2:                                &mi_prinx,
    new   2:                                2,
    Enter value for index_type_id: 55
    old   3:                                &index_type_id,
    new   3:                                55,
    Enter value for original_map_publication_id: 6789
    old   4:                                &original_map_publication_id,
    new   4:                                6789,
    Enter value for original_map_sheet_number_id: 357
    old   5:                                &original_map_sheet_number_id,
    new   5:                                357,
    Enter value for name_of_feature: BB
    old   6:                                '&name_of_feature',
    new   6:                                'BB',
    Enter value for mapinfo_style_row: 10
    old   7:                                '&mapinfo_style_row',
    new   7:                                '10',
    Enter value for geog_coordinates_id: 8
    old   9:                                &geog_coordinates_id)
    new   9:                                8)
    
    1 row created.
    
    Elapsed: 00:00:00.04
    satyaki>
    satyaki>commit;
    
    Commit complete.
    
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>
    satyaki>insert into GEOG_COORINDATES values(&mi_prinx,null,'&mapinfo_style_row');
    Enter value for mi_prinx: 9
    Enter value for mapinfo_style_row: FFG
    old   1: insert into GEOG_COORINDATES values(&mi_prinx,null,'&mapinfo_style_row')
    new   1: insert into GEOG_COORINDATES values(9,null,'FFG')
    
    1 row created.
    
    Elapsed: 00:00:00.07
    satyaki>/
    Enter value for mi_prinx: 8
    Enter value for mapinfo_style_row: GGT
    old   1: insert into GEOG_COORINDATES values(&mi_prinx,null,'&mapinfo_style_row')
    new   1: insert into GEOG_COORINDATES values(8,null,'GGT')
    
    1 row created.
    
    Elapsed: 00:00:00.05
    satyaki>
    satyaki>commit;
    
    Commit complete.
    
    Elapsed: 00:00:00.02
    satyaki>
    satyaki>select * from VIEW_MI_JOIN_GC;
    
      MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE                                                                  GEOG_COORDINATES_ID mi_prinx_polygon GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- ------------------- ---------------- ---------------------------------------------------------------------------------------------------------------
             1            44                        5678                          356 AA                                                                                                 9                9
             2            55                        6789                          357 BB                                                                                                 8                8                                                                                                                 
    
    Elapsed: 00:00:00.09
    satyaki>
    satyaki>
    satyaki>CREATE OR REPLACE TRIGGER TRIG_VIEW_MI_JOIN_GC
      2  INSTEAD OF UPDATE ON VIEW_MI_JOIN_GC
      3  FOR EACH ROW
      4  DECLARE
      5   m_info_svw  varchar2(80);
      6  BEGIN
      7   m_info_svw :=  :NEW.mapinfo_style_row;
      8
      9   UPDATE MAP_INDEX
     10    SET mi_prinx = :NEW.mi_prinx,
     11        index_type_id = :NEW.index_type_id,
     12        original_map_publication_id = :NEW.original_map_publication_id,
     13        original_map_sheet_number_id = :NEW.original_map_sheet_number_id,
     14        name_of_feature = :NEW.name_of_feature,
     15        mapinfo_style_row = m_info_svw,
     16        geographical_coordinates = :NEW.geographical_coordinates,
     17        geog_coordinates_id = :NEW.geog_coordinates_id
     18     WHERE geog_coordinates_id = :OLD.geog_coordinates_id;
     19   UPDATE GEOG_COORINDATES
     20    SET mi_prinx = :NEW.geog_coordinates_id,
     21        geographical_coordinates = :NEW.geographical_coordinates,
     22        mapinfo_style_row = m_info_svw
     23     WHERE mi_prinx = :OLD.geog_coordinates_id;
     24  END;
     25  /
    
    Trigger created.
    
    Elapsed: 00:00:00.20
    satyaki>
    satyaki>select * from VIEW_MI_JOIN_GC;
    
      MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE                                                                  GEOG_COORDINATES_ID mi_prinx_polygon GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- ------------------- ---------------- ---------------------------------------------------------------------------------------------------------------
             1            44                        5678                          356 CC                                                                                                 9                9
             2            55                        6789                          357 BB                                                                                                 8                8                                                                                                                 
    
    Elapsed: 00:00:00.09
    satyaki>
    satyaki>select mi_prinx,mapinfo_style_row from GEOG_COORINDATES;
    
      MI_PRINX MAPINFO_STYLE_ROW
    ---------- --------------------------------------------------------------------------------
             9 FFG
             8 GGT
    
    Elapsed: 00:00:00.07
    satyaki>select * from MAP_INDEX;
    
      MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE                                                                  MAPINFO_STYLE_ROW                                                                GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), S
    ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------
             1            44                        5678                          356 CC                                                                               HHH
             2            55                        6789                          357 BB                                                                               HHH                                                                                                                                                  
    
    Elapsed: 00:00:00.12
    satyaki>
    satyaki>update VIEW_MI_JOIN_GC
      2    set name_of_feature = 'DD'
      3  where mi_prinx = 1;
    
    1 row updated.
    
    Elapsed: 00:00:00.05
    satyaki>
    satyaki>select * from VIEW_MI_JOIN_GC;
    
      MI_PRINX INDEX_TYPE_ID ORIGINAL_MAP_PUBLICATION_ID ORIGINAL_MAP_SHEET_NUMBER_ID NAME_OF_FEATURE                                                                  GEOG_COORDINATES_ID mi_prinx_polygon GEOGRAPHICAL_COORDINATES(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    ---------- ------------- --------------------------- ---------------------------- -------------------------------------------------------------------------------- ------------------- ---------------- ---------------------------------------------------------------------------------------------------------------
             1            44                        5678                          356 DD                                                                                                 9                9
             2            55                        6789                          357 BB                                                                                                 8                8                                                                                                                 
    
    Elapsed: 00:00:00.08
    satyaki>
    satyaki>select mi_prinx,mapinfo_style_row from GEOG_COORINDATES;
    
      MI_PRINX MAPINFO_STYLE_ROW
    ---------- --------------------------------------------------------------------------------
             9 FFG
             8 GGT
    
    Elapsed: 00:00:00.06
    satyaki>
    satyaki>update VIEW_MI_JOIN_GC
      2     set mapinfo_style_row = 'OOOO'
      3     where mi_prinx = 1;
    
    1 row updated.
    
    Elapsed: 00:00:00.05
    satyaki>
    satyaki>select mi_prinx,mapinfo_style_row from GEOG_COORINDATES;
    
      MI_PRINX MAPINFO_STYLE_ROW
    ---------- --------------------------------------------------------------------------------
             9 OOOO
             8 GGT
    
    Elapsed: 00:00:00.06
    satyaki>
    satyaki>select mapinfo_style_row from MAP_INDEX;
    
    MAPINFO_STYLE_ROW
    --------------------------------------------------------------------------------
    OOOO
    HHH
    
    Elapsed: 00:00:00.06
    satyaki>
    

    Hope this will help you.

    Kind regards.

    LOULOU.

  • 95 / 5 / 1 use rule for more Desktop Viewer

    Hello

    Russ Proudman written this in a workstation of discoverer recently:

    «To many clients and presentations, I highly recommend the ' 95 ol / 5 / 1 rule is that you have 95 users using the Viewer, 5 users using more and maybe 1 with office (and most likely, it is the 1 with Admin as well).»

    I wonder, is the standard for most places? If so, why this rule?

    My last job, we used the 5/95/1 rule, where only a few used Viewer, almost all the most used and administrators used Desktop. Why? Is a superior to the Viewer tool. Search options and options (up to 10.1.2.2) input parameter sheet display options are superior to what is shown in the Viewer (more other reasons are not here). Only users who have accessed Viewer worked on remote sites - usually their homes - where the most access was terribly slow.

    Curiously, in my current workplace, we follow your rule. I prefer the 95/5/1 rule. We plan to go to the 5/95/1 rule to 10.1.2.2 due to problems with the binding of one sheet to another by using the managed links. If we do not have, we must abandon our upgrade altogether. Oracle does not provide a solution for us at this time.

    Just curious.

    Thank you
    Nancy

    I can explain my thinking better with the following:

    1. Firstly, Disco Viewer takes less band bandwidth and memory to run more. You can search the forums for amounts - that I don't remember - but as more are XML and Viewer is HTML the difference of the info, packages, etc., beyond the intranet at work is a factor. And then, as mentioned, less memory required to use the version of the Viewer.

    2. here is my soapbox reason:

    So many customers, I am the 'right' thing for management to say is that "our users are entitled" which means that they want their users to write their own reports, etc.. Even if an intermediate layer to make things easier is installed (ie: NoetixViews, BIS views), end users - even trained - do not use the product every day and so create literally hundreds of programs that are poorly written, shared with their friends and run queries "dumb" don't don't need (ie: have a field index, but by causing ignorance research be a full array of research). They are usually no standard and the results are often incorrect (ie: trying to cross the orgs in Oracle Apps?, using Multicurrency in Oracle Apps or regular DB tables?, etc..).

    So when it is time to level or a new IT manager comes along and tries to put an end to the prevalence of reports such as 'Margin Report - Budgets (do not use after Jan.2.2001 GL', ' margin Report - GL Budgets (it's good, but run only Monday) ", etc., it becomes an important task.

    I found over so many times that if a company has a few report writers - and of course, depends on the company, but something like 5 would be a good thing - who know SQL, who know Disco and have been trained, and use the product on a daily basis - then only they should use more to create the reports and the other 94 / 95 / 100 would only her pre-existing companies reports made by these 5 and with the right combination of settings, etc., a report of the observer should allow multiple ways to view the data (ie: GL date per account, between a dollar amount, etc.).

    And that leaves just the 1 or so to be the Admin and the same person who needs office.

    3. that being said, I've also found that many companies treat just identical to something like Oracle Apps discoverer. If Oracle Apps is slow - they set with several hardware configurations, etc. and to pay for a team of consultants to do. If the discoverer is slow because the server was set up wrong, they run another large application in the Disco box or users write "obstinate" reports... then the answer is usually "discoverer sucks... try [A]"-when [A] seems to be the flavour of the day - that is to say: don't insert the following: motion of Brio, Business Objects, Cognos Impromptu , Hyperion (good Oracle Hyperion now)... and the new fav... OBIEE.

    So having a good administrator of Disco, some well trained, competent report writers and lotsa' end user runs these reports pre-written... it's where everything works.

    4. one last thing - I realize that a company can roll Disco more to all users and maintain the "power" of end-users down so that they can only operate pre-written reports as described above. It's okay as Yes, more is more user friendly and looks like 'cooler' in my opinion. But then, it's just the problem of network and memory to watch out for. I stayed in most of the companies does not present (only 1 so far), but it's a reasonable enough request. The problem was that they should start with just a spectator and see that the end users are simply glad to get the data. If they give them first, then nobody wants to feel "decommissioned" Spectator later.

    Hope that explains my opinion better. Although it may seem a bit "negative, it is sure that I seem to find time and time again.

    Russ

  • Cancel button type on a table or a view form

    I am a newbie to apex. I use 10g. I created the form on table emp (empno, name, salary). Shape is of type Form on a Table or a view.
    Cancellation & save button (apply the changes) do not work. then I copied the page reset process and run on condition save button click. But always Cancel button does not work. application has other forms of type Form with a report and are working properly. I lost 2 days on this problem.

    Hello
    You can do it. If you have the junction in the same form, what to use empty the cache of the page. Click on the edit page, click Cancel in the left button section. Scroll to the bottom and type page 32 in the field to clear the cache . However, it is better to have the direction to report page (different page of the form).

    Hope this will help.

    Pascal M
    http://Tajuddin.whitepagesbd.com

  • GPF using the Table control

    Hello world

    We use a table control to display the log files. Each row of the table represents a log file entry. In addition to that we have put in place

    Some filter chopsticks (string tonalite) to speed up filtering. This means that only the entries corresponding to these substrings are shown. So whenever the filter options

    changed to renew the contents of the table.

    This is done by DeleteTableRows, looking for entries to display, InsertTableRows and SetTableCellRangeVals.

    It works very well.

    But if we remove all the contents of the table (caused by the filter options) and then hit a button (even if the focus is on the table) you get a GPF on ProcessSystemEvents.

    This occurs only after inserting a large number of rows in the table before deleting all the. For example, a table with 5000 x 2 (rowsxcolumns) reduced to 0x2.

    1 create a table with 5000 x 2 (rows x columns) control elements.

    2 remove all lines

    3. press tab until the control panel to get the focus.

    4. hit Enter for example

    => Crash

    Someone has an idea? We have already 'dimmed' CTRL, but this is not enough to avoid that the focus on the table by pressing the tab key. So, which leads to an accident as well.

    Thanks for the help

    Philipp

    Yes, it is a known issue (396240), although it is not actually on time last updated known issues. Unfortunately there is no good solution, other than just by waiting for a version corrected to be released, which should happen soon.

    Luis

  • Can you attribute programmatically size when you use the table in the Cluster service cluster

    I use the table of the Cluster service.  The only way I know to the size of the cluster is to right click on the function and set the Cluster size.  But what happens if the length of my table changes?  Is there a way to make the cluster size is the number of elements in the table?  Seems like labview should do this automatically at run time.  There may be some nodes of property I don't know.

    I tried the SQL statements, but it always boils down to having to know the number of columns is in the database prior to execution.

    What I did to generate the object to be a cluster to match database fields.  My recordset is an array of objects.  Then I a vi member to build a recordset from the database and another Member vi to retrieve an array of clusters of the recordset object.  If the database changes, I have to change the subject and these two vi.  All the other Subvi call these two for the manipulation of data.  No other sub - VI have bundle and ungroup functions in them, only the vi of two members.  Thus a change in the database requires a change of control and two vi.  Not too bad.

    (I'm tooting my Horn in choosing me as accetped solution provider.  I learned this bad habit of others here on the forum.  )

Maybe you are looking for

  • Safari on my mac

    When I open safari on my imac that open several tabs of the pop-up window and a message telling me to log on helpmesupport.today:80 and they give me a password to fix this problem. I suspect that it is spyware and I can't remove it, he locked Safari

  • Thunderbird communicates only with servers?

    I use Thunderbird 24.6.0 on a Sony Vaio with Windows 7. Everything worked along smoothly until about a week ago. One night, I used Thunderbird to check my e-mail from Comcast (as I did for years) and everything was normal. The next day, worked in Thu

  • Leak memory in cRIO running RT

    I am running RT 2009 on a compact chassis of RIO.  My very basic VI causes the RIO to restart, which seems to be linked to a leak memory.  I use system monitor and you can watch the use of memory on the chassis of RIO grow very slowly.  Attached is t

  • only ty * e r5ght characters

    only ty * e r5ght characters

  • I received an email from _ @_. _ saying they were unable to verify my account details. Is it a scam?

    This email address above asked me to log in and check my account details. This is a real email or a scam?