Database cache remote table

Does anyone know if database caching can work with a remote database via a link.
My app server is going to work with an 8i database. Our dba is going to do a dblink to an 8.0.5 database. I want to cache data from the 8.0.5 database to the appserver.
So can I cache a table such as scott.emp@remotedb?
P.S. I can't upgrade the 8.0.5 database quite yet because the application does not allow me to go to 8.1.7.

forgot to mention my email is
[email protected]

Similar Messages

  • 20 Index Restriction on Remote Tables (i.e. using Database Links)

    The Oracle Database Administrator's Guides for 10g and 11g document a performance restriction that "No more than 20 indexes are considered for a remote table." If I go back to the 8i documentation it says "In cost-based optimization, no more than 20 indexes per remote table are considered when generating query plans. The order of the indexes varies; if the 20-index limitation is exceeded, random variation in query plans may result."
    Does anyone have more details on this performance restriction? In particular I am trying to answer these questions:
    1) Are the 20 indexes which are considered by the CBO still random in 10g?
    2) Can I influence which indexes are considered with index hints or will my hints only be considered if they are for one of the "random" 20 indexes which are being considered by the CBO?
    3) Are there any other approaches or work-arounds to this restriction assuming you need to select from a large remote table with more than 20 indexes (and need to perform the selection using 1 of those indexes to get adequate performance) or do we need to abandon database links for this table?
    Thanks in advance for your input.

    So, here's my simple test.
    SQL>
    SQL> create table gurnish.indexes20plus ( n1 number, n2 number, n3 number, n4 number, n5 number, n6 number, n7 number,
    2 n8 number, n9 number, n10 number, n11 number, n12 number, n13 number, n14 number, n15 number, n16 number,
    3 n17 number, n18 number, n19 number, n20 number, n21 number, n22 number, n23 number, n24 number,
    4 n25 number, n26 number, n28 number);
    create index xin1 on indexes20plus (n1);
    Table created.
    SQL> SQL> create index xin2 on indexes20plus (n2);
    create index xin3 on indexes20plus (n3);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin4 on indexes20plus (n4);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin5 on indexes20plus (n5);
    create index xin6 on indexes20plus (n6);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin7 on indexes20plus (n7);
    Index created.
    SQL> SQL> create index xin8 on indexes20plus (n8);
    Index created.
    SQL> SQL> create index xin9 on indexes20plus (n9);
    Index created.
    SQL>
    SQL> create index xin10 on indexes20plus (n10);
    Index created.
    SQL> SQL> create index xin11 on indexes20plus (n11);
    create index xin12 on indexes20plus (n12);
    create index xin13 on indexes20plus (n13);
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL>
    Index created.
    SQL> SQL> create index xin14 on indexes20plus (n14);
    Index created.
    SQL> SQL> create index xin15 on indexes20plus (n15);
    Index created.
    SQL>
    SQL> create index xin16 on indexes20plus (n16);
    Index created.
    SQL>
    SQL> create index xin17 on indexes20plus (n17);
    Index created.
    SQL> SQL> create index xin18 on indexes20plus (n18);
    Index created.
    SQL> SQL> create index xin19 on indexes20plus (n19);
    Index created.
    SQL> SQL> create index xin20 on indexes20plus (n20);
    Index created.
    SQL> SQL> create index xin21 on indexes20plus (n21);
    Index created.
    declare
    i number;
    begin
    for i in 1..100
    loop
    dbms_random.seed(i+100);
    insert into indexes20plus values (dbms_random.value(1,5),dbms_random.value(1,21),dbms_random.RANDOM, dbms_random.RANDOM,dbms_random.value(1,20),
    dbms_random.value(1,4),dbms_random.value(1,6), dbms_random.value(1,7),dbms_random.value(1,9),dbms_random.value(1,10),
    dbms_random.value(1,11),dbms_random.value(1,12),dbms_random.value(1,13),dbms_random.value(1,14),dbms_random.value(1,1),
    dbms_random.value(1,1),dbms_random.value(1,19),dbms_random.value(1,122),dbms_random.value(1,20),dbms_random.value(1,20)
    ,dbms_random.value(4,20),dbms_random.value(1,20),dbms_random.value(1,20),dbms_random.value(1,20),dbms_random.value(1,20)
    ,dbms_random.value(4,20),dbms_random.value(4,20));
    end loop;
    commit;
    end;
    SQL> set autotrace traceonly
    SQL> l
    1* select * from gurnish.indexes20plus@lvoprds where n1 = 4
    SQL> /
    no rows selected
    Execution Plan
    Plan hash value: 441368878
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU
    )| Time | Inst |
    | 0 | SELECT STATEMENT REMOTE | | 1 | 351 | 1 (0
    )| 00:00:01 | |
    | 1 | TABLE ACCESS BY INDEX ROWID| INDEXES20PLUS | 1 | 351 | 1 (0
    )| 00:00:01 | LVPRD |
    |* 2 | INDEX RANGE SCAN | XIN1 | 1 | | 1 (0
    )| 00:00:01 | LVPRD |
    Predicate Information (identified by operation id):
    2 - access("A1"."N1"=4)
    Note
    - fully remote statement
    - dynamic sampling used for this statement
    Statistics
    0 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    1897 bytes sent via SQL*Net to client
    481 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    0 rows processed
    SQL> select * from gurnish.indexes20plus@lvoprds where n21 = 4;
    no rows selected
    Execution Plan
    Plan hash value: 2929530649
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU
    )| Time | Inst |
    | 0 | SELECT STATEMENT REMOTE | | 1 | 351 | 1 (0
    )| 00:00:01 | |
    | 1 | TABLE ACCESS BY INDEX ROWID| INDEXES20PLUS | 1 | 351 | 1 (0
    )| 00:00:01 | LVPRD |
    |* 2 | INDEX RANGE SCAN | XIN21 | 1 | | 1 (0
    )| 00:00:01 | LVPRD |
    Predicate Information (identified by operation id):
    2 - access("A1"."N21"=4)
    Note
    - fully remote statement
    - dynamic sampling used for this statement
    Statistics
    1 recursive calls
    0 db block gets
    0 consistent gets
    0 physical reads
    0 redo size
    1897 bytes sent via SQL*Net to client
    481 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    0 rows processed
    SQL>

  • Best practice for VPD and remote tables

    Not specifically an HTMLDB question, but here goes...
    HTMLDB 1.6 on 9.2.0.4 connecting over database link (fixed username/password) to 9.2.0.4
    I've currently "wrapped" access to the remote tables in views, i.e. view "T" in the HTMLDB parsing schema LOCAL_USER is defined as "SELECT * FROM T@remote"
    I'd like to put VPD controls on my backend tables, but I don't get how v('APP_USER') (or even APP_USER put into an application context) would be seen by the remote database.
    Should I just put VPD policies on LOCAL_USER's views and call it a day?
    Thanks for input!
    -John

    If you implemented the VPD in the remote database, what would your VPD be restricting? All queries would apply the policy based on the DB link fixed username resulting in all users of the HTML DB application having same policy restrictions.
    The policy in the remote database does not has access to the value of v('APP_USER'). That value is only available in the database that has HTML DB. You would have to write APIs in the remote database in PL/SQL functions/procedures to pass in the V('APP_USER') value to the remote database. This is doable, but cumbersome.
    If you want to have your policy modify your WHERE clause on the fly based on your HTML DB user account, then I would implement the VPD in the database which has your HTML DB repository. I am not sure which of the two scenarios below occur when doing a SELECT * FROM T.
    1.) The query goes across the database link, gets all the data out of table T in the remote database, passes back to the HTML DB database, and applies the policy WHERE clause modification in the HTML DB database.
    2.) The query applies the policy WHERE clause modification to the view, goes across the database link with the WHERE clause modified, and gets only the data allowed based on the policy from the remote database.
    You should test this out to find out for performance purposes what query is actually performed on the remote database.
    As always if anyone sees anything inaccurate in what I have written, please correct me.
    Mike

  • Inserting data in remote database with remote procedure

    Hi,
    I have a problem concerning inserting data in a remote database (10g) by using a remote procedure.
    I call the procedure from a 11g database just by doing:
    begin
    getlocalfilecontent@remoteserv(param)
    commit;
    end;
    And it wouldn't insert the data into the remote table.
    While when I execute the same procedure locally on that remote database (10g)
    It does insert the data I want.
    What could be causing the problem here, am I overseeing something?
    Edited by: user7634309 on 14-Aug-2009 02:14

    Already thanks for the fast replies
    The dblink works perfectly. I can select data etc with this dblink.
    The procedure on the remote database is the same.
    One other thing, when I execute the remote procedure on local database 2nd time I get the
    ORA-ERR: ORA-02041: client database did not begin a transaction.
    This could be fixed by doing a commit or rollback but still no inserting in remote table.
    So to sum it up:
    What doesn't work:(no inserting)
    On 11g server that calls remotely the procedure
    begin
    getlocalfilecontent@remoteserv(parameter);
    commit;
    end;
    What works(does insert)
    On 10g server calling the procedure locally
    begin
    getlocalfilecontent(param);
    commit;
    end;
    So everything is the same except on the 11g server I add the dblink spec behiind the procedurecall

  • How is the best way to send data from local database into remote database ?

    Hi all,
    I need to send data from local Oracle database into remote oracle database. Both sites connected via 128 kbps frame relay connection.
    The sending need to be done once a week, can be done nightly.
    How is the best way to do this ?
    Thank you very much,
    xtanto

    How is the best way to do this ?How much are you planning to send?
    You can use COPY command. Ensure that you have valid database link between two databases.
    Available options are:
    create - creates a new table. errors out if the destination table exists.
    replace - drop the destination table and re-creates with data.
    insert - inserts data if the destination table exists.
    append– appends data into an existing table.
    use set arraysize 5000 -The arraysize specifies the number of rows that SQL*Plus will retrieve from the database at one time.
    copy from scott/tiger@ORCL to scott/tiger@ORCL92 create new_emp using select * from emp;

  • Error remote table does not contain a primary key

    I make replication between oracle and Microsoft sql using getway for sql but when I insert to table in oracle I get this error in apply process
    information :
    ASD.SUBHI.COM is database link from oracle to microsoft sql
    "DBO"."REGIONS" name of the table
    CREATE TABLE regions (a INTEGER primary key) command to create table
    error
    ORA-26711: remote table does not contain a primary key constraint ORA-26712: remote object is "DBO"."REGIONS"@"ASD.SUBHI.COM"
    Note: I go to sql server and verify that primary key is creates
    is this the best place to like this question ?
    if you need more details please tell me I need the answer

    I make replication between oracle and Microsoft sql using getway for sql but when I insert to table in oracle I get this error in apply process
    information :
    ASD.SUBHI.COM is database link from oracle to microsoft sql
    "DBO"."REGIONS" name of the table
    CREATE TABLE regions (a INTEGER primary key) command to create table
    error
    ORA-26711: remote table does not contain a primary key constraint ORA-26712: remote object is "DBO"."REGIONS"@"ASD.SUBHI.COM"
    Note: I go to sql server and verify that primary key is creates
    is this the best place to like this question ?
    if you need more details please tell me I need the answer

  • "In-Memory Database Cache" option for Oracle 10g Enterprise Edition

    Hi,
    In one of our applications, we are using TimesTen 5.1.24 and Oracle 9i
    databases (platform - Solaris 9i).
    TimesTen holds application information which needs to be accessed quickly
    and Oracle 9i is a master application database.
    Now we are looking at an option of migrating from Oracle 9i to Oracle 10g
    database. While exploring about Oracle 10g features, came to know about
    "In-Memory Database Cache" option for Oracle Enterprise Edition. This made
    me to think about using Oracle 10g Enterprise Edition with "In-Memory
    Database Cache" option for our application.
    Following are the advantages that I could visualize by adopting the
    above-mentioned approach:
    1. Data reconciliation between Oracle and TimesTen is not required (i.e.
    data can be maintained only in Oracle tables and for caching "In-Memory
    Database Cache" can be used)
    2. Data maintenance is easy and gives one view access to data
    I have following queries regarding the above-mentioned solution:
    1. What is the difference between "TimesTen In-Memory Database" and
    "In-Memory Database Cache" in terms of features and licensing model?
    2. Is "In-Memory Database Cache" option integrated with Oracle 10g
    installable or a separate installable (i.e. TimesTen installable with only
    cache feature)?
    3. Is "In-Memory Database Cache" option same as that of "TimesTen Cache
    Connect to Oracle" option in TimesTen In-Memory Database?
    4. After integrating "In-Memory Database Cache" option with Oracle 10g, data
    access will happen only through Oracle sqlplus or OCI calls. Am I right here
    in making this statement?
    5. Is it possible to cache the result set of a join query in "In-Memory
    Database Cache"?
    In "Options and Packs" chapter in Oracle documentation
    (http://download.oracle.com/docs/cd/B19306_01/license.102/b14199/options.htm
    #CIHJJBGA), I encountered the following statement:
    "For the purposes of licensing Oracle In-Memory Database Cache, only the
    processors on which the TimesTen In-Memory Database component of the
    In-Memory Database Cache software is installed and/or running are counted
    for the purpose of determining the number of licenses required."
    We have servers with the following configuration. Is there a way to get the
    count of processors on which the Cache software could be installed and/or
    running? Please assist.
    Production box with 12 core 2 duo processors (24 cores)
    Pre-production box with 8 core 2 duo processors (16 cores)
    Development and test box with 2 single chip processors
    Development and test box with 4 single chip processors
    Development and test box with 6 single chip processors
    Thanks & Regards,
    Vijay

    Hi Vijay,
    regarding your questions:
    1. What is the difference between "TimesTen In-Memory Database" and
    "In-Memory Database Cache" in terms of features and licensing model?
    ==> Product has just been renamed and integrated better with the Oracle database - Times-Ten == In-Memory-Cache-Database
    2. Is "In-Memory Database Cache" option integrated with Oracle 10g
    installable or a separate installable (i.e. TimesTen installable with only
    cache feature)?
    ==> Seperate Installation
    3. Is "In-Memory Database Cache" option same as that of "TimesTen Cache
    Connect to Oracle" option in TimesTen In-Memory Database?
    ==> Please have a look here: http://www.oracle.com/technology/products/timesten/quickstart/cc_qs_index.html
    This explains the differences.
    4. After integrating "In-Memory Database Cache" option with Oracle 10g, data
    access will happen only through Oracle sqlplus or OCI calls. Am I right here
    in making this statement?
    ==> Please see above mentioned papers
    5. Is it possible to cache the result set of a join query in "In-Memory
    Database Cache"?
    ==> Again ... ;-)
    Kind regards
    Mike

  • Instead-of Trigger of View on a Remote Table Fails!!!

    Hi all,
    I'm trying to create an INSTEAD OF (UPDATE or INSERT) trigger on a view V1 in DATABASE DB1 (Linux 7.3 or 7.2, ORACLE 9.2.0.1.0 - Production).The view V1 is created on a remote table through a DBLINK.But I always get such error when I update the view V1 using statements such as "update v1 set oid=oid+1000" :
    ORA-03113 end-of-file on communication channel
    But I can execute those statements successfully in Oracle of version 9.0.1.0.0 .
    What I want to say is that if some special configs is needed to support instead-of trigger of a view on a remote table ?

    Hi all,
    I'm trying to create an INSTEAD OF (UPDATE or INSERT) trigger on a view V1 in DATABASE DB1 (Linux 7.3 or 7.2, ORACLE 9.2.0.1.0 - Production).The view V1 is created on a remote table through a DBLINK.But I always get such error when I update the view V1 using statements such as "update v1 set oid=oid+1000" :
    ORA-03113 end-of-file on communication channel
    But I can execute those statements successfully in Oracle of version 9.0.1.0.0 .
    What I want to say is that if some special configs is needed to support instead-of trigger of a view on a remote table ?

  • Query remote table not working in PL/SQL

    I have a problem that is killing me to figure out. Basically we trying to query a remote table through PL/SQL and it comes back with invalid column name for the table. But the table exists in the remote database and has the column. The query works fine from the same database outside of PL/SQL, just not in PL/SQL. I'll setup a test case below.
    We have local database called DB1 and remote database called DB2. The table we are querying is called EMP.
    First we create database link:
    create database link DB2.WORLD connect to...
    Test the link:
    select ENAME from [email protected];
    ENAME
    SHAWN
    Works fine.
    Now we put this query inside a PL/SQL block:
    declare
    l_ename varchar2(20);
    begin
    select ename into l_ename from [email protected];
    end;
    This fails with the following error:
    select ename
    ERROR at line 274:
    ORA-06550: line 274, column 7:
    PL/SQL: ORA-00904: invalid column name
    ORA-06550: line 271, column 3:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 279, column 9:
    PL/SQL: ORA-00904: invalid column name
    ORA-06550: line 277, column 3:
    PL/SQL: SQL Statement ignored
    Now, I've tried changing how we select from the remote table, I've put the select statement in a cursor, tried creating a synonym which points to the remote table and selecting using the synonym in PL/SQL, it always returns the same error. But always works outside of PL/SQL.
    Now the user we are connecting to the remote database as, has select on the EMP table, through a role, along with 30 other tables, all the other tables are able to be selected through the database link, in PL/SQL, it's just this one table.
    Additionally I can go to another database, and create the same database link, and the query in PL/SQL works fine to the remote table. It's just this one table, from this one database, that doesn't work just in PL/SQL. Any ideas would be appreciated, I've exhausted everything.
    Also, creating a copy of the table using "create table as select * from..." we can select from the copy of the table using PL/SQL through the database link. The problem is this is a central warehouse table, and is used my multiple applications and updated constantly, so dropping a recreating this table is a last resort.
    Yes, this process did work, for over a year, then suddenly it stopped. Of course, no one made any changes to either database, that's always the case. I know the code didn't change though, it was still timestamped from a year ago.
    Thanks in advance.

    Could this be a variant on an old favourite, viz privileges being granted through roles. We cannot use objects in PL/SQL if our privileges are assigned through a role.
    Maybe what has changed is that instead of being granted privileges on EMP@DB2 directly the privileges have been re-organised so that your user has them granted through a role.
    Cheers, APC

  • Database Cache and Gateways

    We are considering using Oracle Database Cache to speed up a web application that reads data from a mainframe database. Since Database Cache only works with Oracle databases, we plan to create a new Oracle database that acts as a gateway (using ODBC) to the mainframe.
    The question we have is whether this would be possible and would make sense from a performance perspective. It is possible that Database Cache makes clever use of Oracle metadata (table update timestamps, etc) which would not be available for tables linked through ODBC. In this case, Database Cache might not work properly.
    Is it possible to configure Database Cache in such a way that that the application reads data from the mainframe only when the data in the cache is more than an hour old?

    moving up...
    Hi
    I have a question regarding the 9iAS database cache: when I
    select a table to be cached, does the cache also pull up the
    indexes definition from the origin database? Another way to put
    it: if I cache a table which has an index on the PK ( on the
    origin database ), is the index also created on the db cache or
    it performs a full scan for every query?
    Thanks
    Ramiro

  • Joining to remote table

    - I have two databases A and B
    - A has a db link to B
    I want to execute a select query in A which joins to a table in B using db link.
    select * from a_table where id in ( select id from b_table@B )
    Now the problem is, even though the local 'a_table' is very small, the remote table in B is really huge and hence the query is very slow.
    It seems like the join operation brings the whole remote data to A for performing the join.
    My question is, is it possible to do the other way? That is is, take the small 'a_table' to the remote database, perform the join there and then bring back the data.
    Any other hints/thoughts to solve this also is greatly appreciated.

    I am really sorry. The sample query was the other way round. A mistake in my description.
    I want to select data from B which joins to a table in A using db link.
    select * from b_table@B where id in ( select id from a_table )
    Arun, Thanks for the reply. But I am not sure if it will solve problem of transporting data from one db to another for performing the join.

  • Insertion into local table from remote table with contains clause

    Hi all,
    We are tasked to insert some rows into our database from another database. We tried to use DBLinks to link the 2 databases and were able to use Select statements to filter out the data that we need to insert into our database.
    These statements take the form of: Select * from RemoteTable where contains@RemoteLink(IndexColumn, 'car')>0;
    where RemoteLink is the DBLink that we have created.
    However Oracle gave us an error (ORA-00949: illegal reference to remote table) when we tried to insert the dataset from the above statement into our local table. We used the following statement in doing so: Insert Into LocalTable (Select * from RemoteTable where contains@RemoteLink(IndexColumn, 'car')>0);
    Even if we use Create Table, Oracle gave us the same error when we tried to push the data from the Select Statement into the new table.
    Could anyone advise us whether it is possible to insert such data into a local table? And if som what is the proper way of doing it?
    Many thanks to any advises.

    Hi,
    there is document 261741.1 on Metalink. This states explicitly that it is not possible to invoke remote user-defined operators, and contains is such. The solution given in the article is to create a wrapper function on the remote site and this one calling in stead of contains.
    Herald ten Dam
    htendam.wordpress.com

  • Issue with query involving remote tables

    Hi I have a query inside a procedure that has 4 union all statements ,2 of which are based on tables at a remote database.
    The query is something like
    Select col1, col2, col3…..col n from Table_a, table_b, table c where join condition and certain hard-coded conditions based on run time parameters
    Union all
    Select col1, col2, col3…..col n from Table_a, table_b , table c where some join condition and certain hard-coded conditions based on run time parameters
    Union all
    Select col1, col2, col3…..col n from Table_a@remote_db, table_b@remote_db, table c@remote_db where join condition and certain hard-coded conditions based on run time parameters
    Union all
    Select col1, col2, col3…..col n from Table_a @remote_db, table_b @remote_db, table c@ remote_db where some join condition and certain hard-coded conditions based on run time parameters
    The join conditions on the tables are quite good and when executed individually bring data in good time.The queries on the remote database also run fine when I execute them in the remote database.
    However when I run this query, it doesn’t get data at all and after hours of running I have to cancel or kill it.I don’t get anything in the long-ops and in the wait class it just shows “SQL*Net message from dblink” or “SQL*Net more data to dblink”.
    I thought that there could be some latency issues AND the data retreival over the dblink could be slow, so I tried the /*+driving_site(rmote table alias)*/ hint , after which it comes up in the long ops as its reading from Table a/ table b from my current database but the wait time is something like millions of seconds and it runs forever.
    The issue is Table A and Table B both in the remote and the current database are huge tables with at least 40-50 million records in them.
    Can anyone suggest an easy way out in this scenario, other than the hard way of re-designing the entire program(which I am afraid I might have to in the end).
    Thanks

    @metzquar I Put the hint in the unions where I am accessing the remote tables
    @blushadow .. i was thinking about that but as these remote tables are in a sort of archived database, I dont think I will be allowed to create a mview.But thats a good suggestion.
    @Earth.. I tried that , but the table population itself gets very time consuming
    Thanks

  • Unable to insert into remote table

    I have created a dblink (public), and a synonym(synonym1) pointing to a table in the remote database.
    When I try to create a form based on the synonym the form creation fails with many errors saying "Synonym Trnslation no longer supported". I have tested the synonym via a dynamic page an it is valid and working.
    I then try to refer to the object directly by using owner.table@dblink. This works fine until I try and insert into the remote table. Then I get the error "An unexpected error occurred: ORA-22816: unsupported feature with RETURNING clause (WWV-16016) ". Has anyone solved this. I can only assume that portal can somehow insert data into a remote table via a form. What use is it if it cant???

    I am not clear on that Synonym ... but the following note solved the problem:
    Subject: How to create a form on a view (and avoid WWV-16016)
    Doc ID: Note:155654.1 Type: PROBLEM
    Last Revision Date: 19-MAR-2003 Status: PUBLISHED
    Problem Description
    Portal 3.0.9.X
    If you create an updateable view on two tables, with the needed
    associated "INSTEAD_OF" trigger to perform the insert or update.
    A Form on this view created in Portal returns the following error on
    insert or update:
    An unexpected error occurred: ORA-22816: unsupported feature with
    RETURNING clause (WWV-16016).
    Let's take a sample:
    CREATE OR REPLACE VIEW V_EMP_DEPT ( EMPNO,
    ENAME, JOB, DEPTNO, DNAME,
    LOC ) AS select
    e.empno
    ,e.ename
    ,e.job
    ,d.deptno
    ,d.dname
    ,d.loc
    from emp e, dept d
    where e.deptno = d.deptno
    grant select,insert,update,delete on v_emp_dept to public;
    create or replace TRIGGER VEMPDEPT_INSTEAD_OF_TRG
    INSTEAD OF UPDATE or INSERT
    ON v_emp_dept
    REFERENCING OLD AS OLD NEW AS NEW
    declare
    begin
    if updating then
    if :new.empno != :old.empno then
    raise_application_error(20001,'EMPNO could not be modified');
    end if;
    if :new.loc != :old.loc then
    raise_application_error(20001,'LOC could not be modified');
    end if;
    if :new.dname != :old.dname then
    raise_application_error(20001,'dname could not be modified');
    end if;
    if :new.ename != :old.ename then
    update emp set ename=:new.ename where empno = :old.empno;
    end if;
    if :new.job != :old.job then
    update emp set job=:new.job where empno = :old.empno;
    end if;
    if :new.deptno != :old.deptno then
    update emp set deptno=:new.deptno where empno = :old.empno;
    end if;
    end if;
    if inserting then
    -- specify only valid deptumbers
    insert into emp(empno,ename,job,deptno) values
    (:new.empno,:new.ename,:new.job,:new.deptno);
    end if;
    end;
    - Create a "Forms Based on a Table or View" on this view : 'V_EMP_DEPT'
    - In the step 4, choose 'order by dname' in place of 'rowid'
    The rest is default
    - Run the form
    - Push on the button query
    - change one of the field and push the update button
    You will see the error
    Error: An unexpected error occurred: ORA-22816: unsupported feature
    with RETURNING clause (WWV-16016)
    Explanation
    You are running in Bug 1589656. The code generated by Portal is using
    RETURN clause for the UPDATE or INSERT SQL call to get the ROWID.
    This is not possible on a VIEW created on two (or more) tables.
    Solution Description
    A possible workaround is to replace the insert button code and update button
    code with calls to procedures doing exactly what is done in the trigger.
    Assumption is made that the empno column could not be updated.
    This implies that the validation options updatable checkbox for the empno column
    is unchecked.
    In the above example, this gives:
    -- procedure to insert data as done in the trigger
    create or replace procedure V_EMP_DEPT_INSERT(
    p_session in out PORTAL30.wwa_api_module_session
    IS
    "_block" varchar2(30) := 'DEFAULT';
    rec SCOTT.V_EMP_DEPT%ROWTYPE;
    begin
    rec.EMPNO:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_EMPNO',
    p_index => 1
    rec.ENAME:=p_session.get_value_as_VARCHAR2(
    p_block_name => "_block",
    p_attribute_name => 'A_ENAME',
    p_index => 1
    rec.JOB:=p_session.get_value_as_VARCHAR2(
    p_block_name => "_block",
    p_attribute_name => 'A_JOB',
    p_index => 1
    rec.DEPTNO:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_DEPTNO',
    p_index => 1
    insert into scott.emp(empno,ename,job,deptno)
    values (rec.empno,rec.ename,upper(rec.job),rec.deptno);
    exception
    when others then
    rollback;
    raise;
    end;
    -- procedure that update data as done in the trigger
    create or replace procedure V_EMP_DEPT_UPDATE(
    p_session in out PORTAL30.wwa_api_module_session
    IS
    "_block" varchar2(30) := 'DEFAULT';
    old_rec SCOTT.V_EMP_DEPT%ROWTYPE;
    new_rec SCOTT.V_EMP_DEPT%ROWTYPE;
    begin
    new_rec.EMPNO:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_EMPNO',
    p_index => 1
    new_rec.ENAME:=p_session.get_value_as_VARCHAR2(
    p_block_name => "_block",
    p_attribute_name => 'A_ENAME',
    p_index => 1
    new_rec.JOB:=p_session.get_value_as_VARCHAR2(
    p_block_name => "_block",
    p_attribute_name => 'A_JOB',
    p_index => 1
    new_rec.DEPTNO:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_DEPTNO',
    p_index => 1
    new_rec.LOC:=p_session.get_value_as_NUMBER(
    p_block_name => "_block",
    p_attribute_name => 'A_LOC',
    p_index => 1
    select empno, ename, job, deptno, loc
    into old_rec.empno, old_rec.ename, old_rec.job,
    old_rec.deptno, old_rec.loc from scott.V_EMP_DEPT
    where empno = new_rec.empno;
    if new_rec.empno != old_rec.empno then
    raise_application_error(20001,'EMPNO could not be modified');
    end if;
    if new_rec.loc != old_rec.loc then
    raise_application_error(20001,'LOC could not be modified');
    end if;
    if new_rec.dname != old_rec.dname then
    raise_application_error(20001,'dname could not be modified');
    end if;
    if new_rec.ename != old_rec.ename then
    update scott.emp set ename=new_rec.ename where empno =
    old_rec.empno;
    end if;
    if new_rec.job != old_rec.job then
    update scott.emp set job=new_rec.job where empno = old_rec.empno;
    end if;
    exception
    when NO_DATA_FOUND then
    raise_application_error(20001,'EMPNO could not be modified');
    end;
    After creating this two procedures you have to edit the form and replace the
    Insert and Update button PLSQL event handling code.
    For the insert button: Select Insert in the PL/SQL Button Event Handler window
    and replace the original code with the following one::
    --- Type your PL/SQL code here...
    -- doInsert;--- This is the default handler
    --- ...and here, thanks...
    V_EMP_DEPT_INSERT( p_session => p_session);
    For the update button: Select Update in the PL/SQL Button Event Handler window
    and replace the original code with the following one:
    --- Type your PL/SQL code here...
    -- doUpdate;--- This is the default handler
    --- ...and here, thanks...
    V_EMP_DEPT_UPDATE( p_session => p_session );
    Remarks
    1) Don't forget to uncheck the updatable validation option for the empno column or
    you may see some errors raised by the update procedure or update the wrong record.
    2) If you don't want to write the "instead of trigger", you can simplify
    the code above by:
    - writing no instead of trigger at all
    - write the logic to the underlying tables in PL/SQL trigger of Portal
    ( here V_EMP_DEPT_UPDATE, V_EMP_DEPT_INSERT)
    - Manohar

  • Oracle 8i database cache

    I have installed cache as part of installation of IAS. I have also configured cache orgin database. When i am trying to cache the table of origin database, it is giving the following error:
    'Caching table LEARN.DEMON on cache ora_9i-cache ...
    ERROR: Unable to cache table LEARN.DEMON on cache ora_9i-cache. WTE-03614 Error caching table LEARN.DEMON: Error importing dependencies to cache.
    Processing failed with one error.'
    any solutions

    hi
    where did u install ur database server is it in the same machine?
    if it is in the different machine u will find the oracle home of oracle/ora81 (origin database) in that machine
    Hope this helps u
    null

Maybe you are looking for

  • When adding event in iCal, the event becomes full-day by default. How to change?

    Also, when de-clicking full-day the events becomes timed 10am-6pm. When changing start time, the end time follows with this 6 hr gap. Not the worst problem to deal with in this world, but...still.  Any way of changing this little detail? I.e. to be a

  • Sequencing Screen Captures in Edit Mode

    I've used Camtasia alot and am transitioning to Captivate. To test recording and editing in Captivate, I recorded one minute of screen activity to simulate capturing an application demo. When I end the recording, it converts the recording to thumbnai

  • Federated search - specifying the service configuration page

    I've built an interface (web service) to the Portal federated search specification so users can search libraries in our company's document management system (Panagon). I want to specify an administration page, where an administrator can set a propert

  • New computer from mac to windows

    I currently have a older mac with CS3 suite and would like to get a new computer but a windows. I have the serial number somewhere but will I have problems since I have software meant for Mac or do I have to buy the software over again? thank you

  • Itunes to ipod song organzing

    ok well lets see if i can explain this and still make sense... i have the Sweat album by Nelly, but i also have some songs by him that are not on that album, ok so when i listen to my ipod and i go to the Nelly category i only see all the songs from