Create view opaque in OBIEE with multiple tables

Hello

I need assistance with the opaque view since I've never created in the past. I want to create an opaque view that retrieves data from several tables. Is it possible to do? Or y at - it another alternative available in OBIEE option? I read the blog following and other similar articles on views opaque but found no option to use for the query with several tables:

Oracle Business Intelligence: A physical layer to OBIEE 10 g Opaque View Creation


Also please advice how to join two tables from different databases in OBIEE?


Kindly advice.


Kind regards

Andy

Check also, it may be useful to you

http://obinsight.blogspot.com/2010/05/reporting-against-multiple.html

Tags: Business Intelligence

Similar Questions

  • How to create views of data from different databases tables in2

    Using Oracle 10.2 g

    I have 2 databases Gus and the haggis on schema Comqdhb.

    Glink indicates a link of database between Haggis and Gus

    In Gus, there is school that contains columns with same name upn, grade, subject, student of tables...

    STUDENT
    UPN
    academicYear

    Object

    Object

    GRADE
    examlevel
    grade

    SCHOOL
    SN

    In HAGGIS raising tables, grade, teacher containing columns upn... desc below.

    STUDENT
    UPN

    GRADE
    grade
    UPN
    academicyear
    level



    Create views in your database HAGGIS who join their all the qualities of the review. You should have a point of view that will produce the following relationship:
    examGrade (upn, subject, examlevel, sn, rank, academicYear)

    So I need to create a view that gets the data from the tables in the databases.

    create view as examGrade (upn, subject, examlevel, sn, rank, academicYear) like some s.upn


    But I don't get the selection of a column of 2 tables in different databases

    I mean if I said

    Select the UPN in comqdhb.student@glink,comqdhb.student;
    Select the upn name in comqdhb.student@glink,comqdhb.student
    *
    ERROR on line 1:
    ORA-00918: column ambiguously defined

    Help me, thank you.

    Hello

    Rider wrote:
    The issue is that I can't understand that I should create the view by the union of the haggis and the two gus data or only haggis.
    the reason I believe I need to combine the two is mentioned * "" create views in your database schema HAGGIS who join their all the qualities of the review. ". *
    By the mention of creating views and who join their all the qualities of the review, it probably means to obtain the data of the GUS and HAGGIS.

    This is my interpretation of the assignment, too.
    If you ask just the tables on Gus, you will get the ranks of three of the four schools: it's not all examination classes.
    If you ask just the tables on Haggis, you will get the ranks of any of the four schools: it's not all examination classes.

    2nd prob is that if have decided to create a view that gets the data from these two gus and therer haggis would be a lot of duplication involved due to the cross product

    Why would there be "repetition involved due to the cross-product"?
    If the quuery of Gus produces 100 lines, the request of product Haggis 30 rows, then the UNION of the two will have 100 + 30 = 130 lines (assuming, as you say, each student is at school only one).

    the query I wrote is

    Create view examGrade (upn, subject, examlevel, sn, rank, academicYear)
    as
    Select distinct s.upn as upn, g.subject as topic,
    g."LEVEL" as examlevel, g.grade as rank, to_number (g.academicyear) as academicyear
    of s comqdhb.student, comqdhb.grade g
    s.UPN, sb.subject, g.elevel, g.grade, s.acyr select Union
    of comqdhb.subject@glink sb,comqdhb.student@glink s,comqdhb.gradevalues@glink g;

    You should not write, not to mention not formatted zip code. I have a little time I can devote to answering questions in the forum. Do you want me
    b spend this time formatting your code, so I can understand the question, and no time to answer, or
    b spend only a little time reading understanding your code and spend most of my time to help you?
    I would prefer (b), but the choice is yours.
    See the statement that I posted in my last post for an example of the formatted code. You see how it appears in a box with a police fixed-width, and multiple spaces are printed? This is because I typed {code} (all small letters), before and after the section I wanted formatted.

    At least put each table in the FROM clause on a separate line, so it is easy to know if you have enough join conditions.
    If you have N tables in the FROM clause, you almost always have at least N-1 join conditions that specify how the tables are linked together. For example, if talk you about two tables, quality and student, you expect to see a join condition that tells you when you have data in a table, how to find related data in the other table, such as

    g_gus.upn = s_gus.upn
    

    No no no join conditions will cause "repetition involved due to the cross product.

    I downloaded my info here
    http://www.upload4free.com/download.php?file=44201983-School_ExamGrades.PDF


    http://www.upload4free.com/download.php?file=184648736-ExamGrades_Case_Study_2008FINAL.PDF

    Sorry, if there is data as long as you can't post here, there is much too much for me to read.
    Make a sample set, containing a few (maybe five) students and a few shades of each student. It is fine to copy a few lines of your actual data.

    That's all the time I have for today. I can't wait to get the data and formatted requests.

  • How to create a block of data to multiple tables

    If I try to use the wizard to create a new block of data and I choose to create it on a table or a view, the wizard asks me for the table create the form on. But if I want to create a form with two tables for example to join them, how can I do? Do I have to create a view on the database (very bad for me!) before joining the wtho tables can create the form to this point of view, or is it possible to create a form in two or more tables?

    Mark,
    Yes, you can base in fact of a block of shapes on a join of tables. Take a look at forms: how to build a block of data to a join of the table. You can also use a base query Clause From block. Basically, you base your block on a SQL statement. For more information on this option, take a look at forms: how to base a block on a FROM Clause query. Finally, you can also base your block on a procedure. This concept is illustrated in this article: forms: how a block of data based on a procedure.

    The fall down using one of these options, is that your block is not editable. If you need to update the data presented by these options, you should use the-Insert, triggers we set to and delete now write your own Insert/Update and Delete statements.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • create view does not work with the role of resource

    I just upgraded from 10.2.0.1 to 11.1.0.7

    the role of resource users could create views on the old database...
    now, they can't
    ORA-01031 insufficient privileges

    I have to give them create it all discovers the system privileges

    (1) I assume you mean that you gave them the CREATE VIEW privilege. Not CREATE ANY VIEW. The latter would allow them to create a view owned by another user who would be dangerous enough.

    (2) it is not related to the role of RESOURCE. It is almost certainly related to the CONNECT role. CREATE VIEW (among other privileges) has revoked the CONNECT role in point 10.2. I don't know why your 10.2 database was working, I guess that you updated from an earlier version, in which case the update may not have removed the privilege correctly (see Metalink: 317258.1).

    (3) you certainly don't want to use the CONNECT role or RESOURCES in the application of the production. Were the roles of the sample which have been overloaded with privileges for the various elements of the sample code. You should really create your own roles with of whatever your users must actually rather than using these predefined roles of privileges.

    Justin

  • Query with multiple Tables

    Hello

    I want to run the table several queries. I have 4 tables. Table 1 is to have relatively in table 2, but table 3 & 4 is not related with table 1. wherever I want to extract the data from table 1, table 4. My current query works well but it miss the Chronogram of table 1, which records do not exist in table 2, where, from table 2 of table 4 its working fine.

    SELECT z.productcode, fabqty z.productionadviceno, sum (z.fabricatedqty).

    Fabqtynoms Round (Sum(z.fabricatedqty*.015) + Sum (z.fabricatedqty)),

    w.workorderno, ons min (w.ons).

    ((SOMME (w.qtyinsheets) * min (ons))) PCS,

    (SELECT SUM (NVL (mrnqty, 0)))

    OF CANMRN

    WHERE workorderno = w.workorderno) mrnqty;

    (SELECT ROUND (SUM (NVL (ptnqty, 0))))

    OF CANPTN

    WHERE workorderno = w.workorderno

    ) ptnqty

    OF CANWORKORDER w, productionadvice z

    where w.productionadviceno = z.productionadviceno

    and w.productcode = 501001

    GROUP BY w.workorderno, z.productionadviceno, z.productcode

    PRODUCTCODE PRODUCTIONADVICENO FABQTY FABQTYNOMS WORKORDERNO ONS SCP MRNQTY PTNQTY

    ----------- ------------------ --------- ---------- ----------- --------- --------- --------- ------

    501001 20004182 250000 253750 20001805 15 253755 16917 253755

    501001 20004229 200000 203000 20001817 15 202995 13533 202995

    501001 20004251 130000 131950 20001829 15 131955 8797 131955

    501001 20004256 200000 203000 20001839 15 202995 13533 202995

    501001 20004277 500000 507500 20001844 15 507495 33833 507495

    501001 20004411 500000 507500 20001918 15 507495 31619 474285

    501001 20004904 230000 233450 20002150 15 233445

    I want to get this record also is missing after you run the query, as I had mentioned w.productionadviceno = z.productionadviceno due to which its does not, how, in a delicate way, we can use this relationship.

    501001 20004905 10000 10150

    Sandy

    use of EXTERNAL JOINS as follows

    where w.productionadviceno = z.productionadviceno (+)
    

    above is a left outer join. A LEFT OUTER JOIN is a JOIN operations that allow you to specify a join clause. He keeps the lines without correspondence of the first (left) table, join them with a NULL row in the form of the second table (right).

    More details: LEFT OUTER JOIN operation

  • Need help to create "no data available" message with multiple data models

    I tried several ways to have a "no documents found" generic message based on certain criteria however it doesn't seem to work. I have two models of data, each only show the information if something is created, deleted, etc. in a certain number of days. If nothing happens for these days, I don't want to report table to display, only a message saying something like "no record".

    I tried the following different types:
    <?if:count(ROW/opened_last_7_days) = 0?>There weren’t any projects created within the past week.<?end if?>
    <?if:count(ROW/opened_last_7_days) > 0?> (report table) <?end if?>
    <?if:count(DATA/opened_last_7_days) = 0?>There weren’t any projects created within the past week.<?end if?>
    <?if:count(DATA/opened_last_7_days) > 0?> (report table) <?end if?>
    The names of the two data models are:
    opened_last_7_days
    closed_last_7_days

    I be recover anything on the page or both records not found and the table appear.

    Sql queries work fine, I get all the answer I need.

    Any help would be appreciated. Thank you.

    Take a look at this: http://winrichman.blogspot.com/2009/05/no-data-found.html

    Thank you!

  • Query SQL with multiple tables - what is the most effective way?

    Hello I learn PL/SQL. I have a simple procedure, where I need to find the number of employees and departments by location according to location_id user input.

    I have 3 Tables:

    LOCATIONS
    Location_id (pk)
    location_name
    ...
    DEPARTMENTS
    department_id (pk)
    Location_id (fk)
    department_name
    ....
    EMPLOYEES
    employee_id (pk)
    department_id (fk)
    Employee_Name
    ....

    1 location can have 0 - SEVERAL departments
    1 employee has 1 Department

    Here's the query I come up with for PL/SQL procedure:

    / * Ecount, Dcount are variable NUMBERS * /.

    SELECT SUM (EmployeeCount), COUNT (DepartmentNumber)
    IN Ecount, Dcount
    Of
    (SELECT COUNT (employee_id) EmployeeCount, department_id DepartmentNumber
    Employees
    GROUP BY department_id
    HAVING department_id IN
    (SELECT department_id
    Ministries
    WHERE location_id = userInput));

    I get the correct result, but I wonder if my query is on the right track and if there is a more "efficient" method to do so.
    Thanks in advance for help a beginner.

    Hello

    Welcome to the forum!

    Something like this will be more effective:

    SELECT    COUNT (employee_id)               AS ECount
    ,       COUNT (DISTINCT department_id)     AS DCount
    FROM       employees
    WHERE       department_id IN (     SELECT     department_id
                        FROM      departments
                        WHERE      location_id = :userInput
                      )
    ;
    

    You should also try a join instead of the IN subquery.

    For efficiency, do only the things you need to do.
    For example, you need not a number of employees in each Department, in order to not calculate one. This means that you will not need the notice online, so do not have.
    You needn't PL/SQL for this work, so don't use PL/SQL, if you do not have to (I know this question was out of context, then you may have good reasons to do this in PL/SQL.)

    Perform all the filtering as soon as possible. Do not waste it effort on the things that will not be used.
    An example of this is: never use a HAVING clause when you can use a WHERE clause. What is the difference between a WHERE clause and a HAVING clause? The WHERE clause is applied until the aggregate functions are calculated and the HAVING clause is applied after; There is no other difference. Therefore, if the HAVING clause is not reference an aggregate function, it could be done in a WHERE clause instead.

  • How to create a website in flash with multiple URLS?

    I'm not great flash and do a site that has a few different tabs for different pages.  How to make the different URLS for each page?  I want to follow each page separately.

    Thank you.

    Use (as2) getURL() or navigateToURL() (as3).

  • To create an interactive report in the apex by selecting from multiple tables

    Hi, I am creating an interactive report by selecting from multiple tables.

    SELECT w.FIRST_NAME as name, w.SURNAME as name, i.ROAD Road, i.DATE_OF_INC as DATE_OF_INC, S.STATEMENT as a STATEMENT OF Declaration

    JOIN THE

    WITNESS w

    ON w.witness_id = s.FK1_WITNESS_ID

    JOIN THE

    Incident I have

    WE

    i.incident_no = w.FK1_INCIDENT_NO

    JOIN THE

    user_station ps

    ON ps.station_id = i.nearest_station_id

    JOIN THE

    the user in.

    WE

    in. STATION_ID = ps.station_id

    WHERE po.officer_id = 1

    by I continue to encounter this error "the report query requires a unique key to identify each row. The supplied key cannot be used for this query. Please change the report attributes to define a unique key column. "ORA-01445: cannot select ROWID from where sample, a join without key preserved table view '

    So I googled around and found that in the attibutres tables report, I need to change the "LINK" COLUMN so first, I changed "Link to custom target", but the report is so I changed it to "Exclude link Clolumn" again, the report didn't report and I STILL got a blank page with only the tabs.

    I wonder you can not create a report by selecting from multiple tables?

    If you can please I need your help.

    Thank you

    You can, but in this case, it might be easier to build your report tables that are joined Oracle views and then build your report out of the newly built sight...

    Or wrap a selection around your selection with joins, and then make the where clause on the external selection...

    Thank you

    Tony Miller
    Software LuvMuffin
    Ruckersville, WILL

  • Unable to create cache with several tables group

    Hello

    I need to create a group of cache with several tables, which are referential to the other.

    There are 2 related tables and table 1 child...
    While trying this thing, it gives me an error:

    8222: multiple parent tables found

    It is not possible to use several tables of root in a single cache group? Is there another way to use it?

    Script, I used is:

    create a cache group asynchronous writethrough TEST. CG1
    of the TEST. ROOT1)
    KEY PRIMARY ID VARCHAR2 (8 BYTES),
    NAME VARCHAR2 (50 BYTE),
    DESCRIPTION VARCHAR2 (255 BYTE),
    POLICYTYPEID VARCHAR2 (7-BYTE)),

    TEST. ROOT2)
    PARAMTYPEID VARCHAR2 (5 BYTES) PRIMARY KEY,
    PARAMETERUSAGE VARCHAR2 (1 BYTE),
    NAME VARCHAR2 (25 BYTE),
    DESCRIPTION VARCHAR2 (255 BYTE)),

    TEST. CHILD1)
    PARAMDETAILID NUMBER (20) PRIMARY KEY,.
    ID VARCHAR2 (8 BYTE),
    PARAMETERUSAGE VARCHAR2 (1 BYTE),
    DISPLAYVALUE VARCHAR2 (255 BYTE),
    OPERATORID VARCHAR2 (5 BYTE),
    VENDORID NUMBER (20).
    FOREIGN KEY REFERENCES TEST. ROOT1 (ID),
    TEST KEY (PARAMETERUSAGE) REFERENCES STRANGERS. ROOT2 (PARAMETERUSAGE));

    You can't have multiple root within a group of cache tables. The requirements for tables in the group a cache are very strict; There must be only one top-level (root table) table and there may possibly be several children tables. Tables of the child should be linked through foreign keys to the root table or a child table above in the hierarchy.

    The solution for your case is among the tables of root and the other root table in a separate cache group and the child table in a cache group. If you do this, you must take care of a few things:

    1. you cannot define foreign keys between the tables of groups of different cache in TimesTen (keys may exist in Oracle) so the application must enforce referential integrity itself for these cases.

    2. If you load data in a cache group (using LOAD the GROUP CACHE or "load we demand") and Timesten will not automatically load the corresponding data in the other group of cache (since he doesn't know the relationship). The application must load the data into the other group of cache explicitly.

    There is no problem with transactional consistency when changes are pushed to Oracle. TimesTen maintains and reinforces the coherence transactional regardless of how the tables are arranged in groups cache correctly.

    Chris

  • How to insert values into a view created on multiple tables

    Hi all

    My goal for insert values in a view
    So for this I created a trigger
    then I tried to insert the value in the view, im getting as inserted row, but the value is not getting inserted

    Here are the steps I followed:


    SQL > create table (x int primary key)
    2.

    Table created.

    SQL > create table b (x references a, varchar2 (30)) y
    2.

    Table created.

    SQL > insert into a values (1)
    2.

    1 line of creation.

    SQL > insert into b values (1, 'One')
    2.

    1 line of creation.

    SQL > create or replace view v
    2 as
    3 select a.x, b.x as b_x, a y, and b where a.x = b.x
    4.

    Created view.

    SQL > select * from v
    2.

    X B_X Y
    ---------- ---------- ------------------------------
    1 1 a

    SQL > create or replace trigger v_t
    2 instead of inserting it on v
    3 for each line
    4 start
    case 5: old.x <>: new.x then
    6. Insert in a values(:new.x);
    7 end if;
    case 8: old.b_x <>: new.b_x then
    9 insert into b values (:new.b_x,:new.y);
    10 end if;
    11 * end;
    SQL > /.

    Trigger created.

    SQL > insert into v values (20,20, 'Twenty')
    2.

    1 line of creation.

    SQL > select * from v
    2.

    X B_X Y
    ---------- ---------- ------------------------------
    1 1 a


    Can anyone suggest me a valid query to insert data into a view that is created on several tables.

    Thanks in advance,
    Shalini

    Hi Shalini,

    You don't need the code if in your trigger.
    That's more like code when you update, you don't compare OLD and insert the NEW values on.

    MHO%xe> create table a(x int primary key);
    
    Tabel is aangemaakt.
    
    Verstreken: 00:00:00.11
    MHO%xe>
    MHO%xe> create table b(x references a,y varchar2(30));
    
    Tabel is aangemaakt.
    
    Verstreken: 00:00:01.09
    MHO%xe>
    MHO%xe> insert into a values(1);
    
    1 rij is aangemaakt.
    
    Verstreken: 00:00:00.01
    MHO%xe>
    MHO%xe> insert into b values(1,'One');
    
    1 rij is aangemaakt.
    
    Verstreken: 00:00:00.06
    MHO%xe>
    MHO%xe> create or replace view v as
      2  select a.x
      3  ,      b.x as b_x
      4  ,      y
      5  from   a
      6  ,      b
      7  where  a.x = b.x;
    
    View is aangemaakt.
    
    Verstreken: 00:00:01.07
    MHO%xe>
    MHO%xe> select * from v;
    
             X        B_X Y
    ---------- ---------- ------------------------------
             1          1 One
    
    Verstreken: 00:00:00.04
    MHO%xe>
    MHO%xe> create or replace trigger v_t
      2  instead of insert on v
      3  for each row
      4  begin
      5      insert into a values(:new.x);
      6      insert into b values(:new.b_x,:new.y);
      7  end;
      8  /
    
    Trigger is aangemaakt.
    
    Verstreken: 00:00:01.64
    MHO%xe>
    MHO%xe> insert into v values(20,20,'Twenty');
    
    1 rij is aangemaakt.
    
    Verstreken: 00:00:00.06
    MHO%xe>
    MHO%xe> select * from v;
    
             X        B_X Y
    ---------- ---------- ------------------------------
             1          1 One
            20         20 Twenty
    
  • How to create views in OBIEE?

    Hello world

    I'm new to OBIEE. My requirement is I have to apply different filters each column in a report. But if I apply no matter what filter it is the application of all the columns.

    For example, the column of my report is something like

    StudentsPassed | StudentsFailed | StudentsTrasnfered

    So I need pick up on a column in the State and need not to show that a particular result based on the status column. But if I select for status = StudentsPassed then all three columns im getting only students passed.


    So what I have is that I have created individual views for each column. IE View1 held that the list of students managed view2 held only the list of students failed. But now I need to generate multiple reports of the same type. So, I don't think it's a better idea to create views for each column in a database level report.


    Is there a method to do this?

    Is there a method to store only students Passsed list in a logical column in the level of the Administration?

    Please provide help.

    Thanks in advance,
    knani

    1. This is what you're doing wrong:

    New column object/logic/general tab/use existing logical column as a source.

    and you choose the column RULE and writing COUNT (DISTINCT RULE)

    and after registration/check, you will receive ERROR:

    [38083] of the attribute "MEASURE1" defines a measure by using an obsolete method.

    You do not MEASURE1 set on the way that you did.

    2. you define MEASURE1 on this way:

    Type of new object/logic tab/data tab General/column

    Now in the tab type of data go to a logical source/edit/measure1 table and select the RULE table to part PHYSICAL TABLE column.

    After that in your logical column MEASURE1 aggregation type choose COUNT DISTINCT.

    That's all.

    This will give you COUNT (DISTINCT RULE).

    3. put the MEASURE1 in record presentation/table with CAT, RULE, and STATUS columns

    4. test answers

    FILTER (CAT_RULE_STATUS. MEASURE1 TO AID (CAT_RULE_STATUS. STATUS = 1))

    FILTER (CAT_RULE_STATUS. MEASURE1 TO AID (CAT_RULE_STATUS. STATUS = 2))

    FILTER (CAT_RULE_STATUS. MEASURE1 TO AID (CAT_RULE_STATUS. STATUS = 3))

    Result:
    2 2 1

    It's okay, you see how many separate RULES are inside each State (see our example with data).

    I did physical table (select) to this case:

    Select 1 as cat, 1 rule, 1 the status of double
    Union of all the
    Select 1 as cat, rule 1, 2 the status of double
    Union of all the
    Select 1 as cat, rule 1, 3 that the status of double
    Union of all the
    Select 1 as cat, 1, 2 as a rule that the status of double
    Union of all the
    Select 1 as cat, 2 2 status of double rule

    Concerning
    Goran
    http://108obiee.blogspot.com

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

  • Gears - error when you try to insert values into a table with multiple columns

    Hello

    I started playing with the gears and SQlLite today and I get an error when I try to insert values into a table with multiple columns.

    I have:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text, DeveloperAge int)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?, ?)', [devName, devAge]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I get the error:

    net.rim.device.api.database.DatabaseException; insert into developers values (?,?): SQL logic error or missing database.

    I use this reference: http://code.google.com/apis/gears/api_database.html

    Everything works if I have only one field as:

    var db = google.gears.factory.create('beta.database');
        db.open('developerSet');
        db.execute('create table if not exists Developers (DeveloperName text)');
    
        var devName = "Davy"
        var devAge = 32;
    
        try {
            db.execute('insert into Developers values (?)', [devName]);
            alert('success');
        }
        catch (e) {
            alert(e);
        }
    

    I use the plug-in Visual Studio 2.0 for 2008 that are running Windows XP SP and Simulator 2.13.0.56

    Thank you

    Davy

    Yes, a SQLite database will persist between battery pulls.  The database is registered either to internal MEM or removable media (not the device memory), depending on which is available on your device.

    In general, its not considered a best practice to remove your table as soon as it is empty and re - create it again when you want to add data.  This adds extra overhead fresh for the final, delete and insert first for a given table.  Instead, define and finalize your drawing before you create your table.  Once created, review the static schema.

    That being said, for development purposes, it may be easier to provide an easy way to drop your tables while you develop your schema.

    See you soon,.

    Adam

  • creating views in a new scheme to access some rows of the tables in the source schema

    Hello

    Oracle 10.2.0.4

    We try to hide some data from some users. My suggestion is that we create a new view_schema scheme on the same instance where we said the source tables in source_schema.

    We then create views in view_schema as below

    CREATE VIEW AS SELECT * FROM source_schema.table where COLUMN_n = "XYZ";

    We then grant SELECT on these views to a role and assign this role new users to be able to consult the data consulted.

    If the questions below.

    1. We can create views to view the data in another schema WITHOUT giving SELECT permissions on source_schema.tanle directluy?
    2. It works and there is no need to create synonyms etc.
    3. YOU can manage users and much easilier view (s)

    Is there a sense and who better than the selection seen with say table_name_view in the source schema to this effect and even the creation of synonyms for these points of view with the same name, yasmina in sourece_schema?

    Thank you

    905989 wrote:

    Hello

    Oracle 10.2.0.4

    We try to hide some data from some users. My suggestion is that we create a new view_schema scheme on the same instance where we said the source tables in source_schema.

    We then create views in view_schema as below

    CREATE VIEW AS SELECT * FROM source_schema.table where COLUMN_n = "XYZ";

    We then grant SELECT on these views to a role and assign this role new users to be able to consult the data consulted.

    If the questions below.

    1. We can create views to view the data in another schema WITHOUT giving SELECT permissions on source_schema.tanle directluy?
    2. It works and there is no need to create synonyms etc.
    3. YOU can manage users and much easilier view (s)

    Is there a sense and who better than the selection seen with say table_name_view in the source schema to this effect and even the creation of synonyms for these points of view with the same name, yasmina in sourece_schema?

    Thank you

    1. you can create the view in another schema (first granting of privileges to the schema of the view) without granting privileges of the schema of the source

    2. you probably want to create public synonyms for the view (s).  You can refer to the view as schema.view, but it's bulky

    3. I'm not sure management is easy, but the extra complexity shouldn't be too bad.  Write the documentation describing how everything works and the object involved.

    Another, more complicated, but more powerful option is to use row-level security also known as the virtual private database - if you have the license.  You create a profile for a table and a procedure to generate the WHERE clause to filter a query against the table and the columns defined in the profile.  Yet once, you need license to do this.

Maybe you are looking for

  • Video cannot be imported into Windows Movie Maker

    I downloaded a video on Youtube (I think .flv format?), but when I tried to import into WMM, it says that I didn't have the right codecs installed.  I then downloaded the K-Lite package (Basic), and when I tried again the new error message that displ

  • Windows live mail for windows 10

    When I try to start WLM I get a thar message says cannot start. The application could not open the WLM message store. Your windows live mailbox of mail data are currently being used by another program as a virus scanner. Close the program or, wait so

  • Keyboard events

    Hello I'm doing some tests trying to move an image around the screen. For that, I add listeners as follows: addEventListener(KeyboardEvent.KEY_DOWN, key_pressed); .... private function key_pressed(e:KeyboardEvent):void { switch (e.keyCode) { .... But

  • ASA 5505 site-site does not

    Hi all I'm having problems to set up a VPN site-to-site simple between two new ASA 5505. I tried several times with the ASDM entry manual configuration tool or by using the wizard, reset each time at the factory does not by default, but the tunnel. I

  • How to rename a CivApp?

    HelloTrying to make the task easier to rename a CIvApp with PowerCLI. $civapp = Get-CIvApp "Test" $newname = $civapp.Name + "_OLD" Set-CIVApp -vApp $civapp -Name $newname Set-CIVApp : 8/6/2013 5:50:25 PM    Set-CIVApp        Interrupting the reading