ORA-01779: cannot modify a column which maps to a non key-preserved table
define cusname='GEORGE';
INSERT INTO (select s.prd_id, s.cus_id, s.qty_sold, s.price from sales s, customers c where s.cus_id=c.cus_id)
VALUES (102,(select cus_id from customers where upper(c_name) like '%GEORGE%'),14,(select price from product where prd_id = 102)*14)
I am getting the following error when I am trying to run the above query.
SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table
01779. 00000 - "cannot modify a column which maps to a non key-preserved table"
*Cause: An attempt was made to insert or update columns of a join view which map to a non-key-preserved table.
*Action: Modify the underlying base tables directly.
CUSTOMERS TABLE
Name
Null
Type
CUS_ID
NOT NULL
NUMBER
C_NAME
VARCHAR2(50)
C_LIMIT
NUMBER
CITY
VARCHAR2(20)
PRODUCT TABLE
Name
Null
Type
PRD_ID
NOT NULL
NUMBER
PRICE
NUMBER
COST
NUMBER
SALES TABLE
Name
Null
Type
PRD_ID
NOT NULL
NUMBER
CUS_ID
NOT NULL
NUMBER
QTY_SOLD
NUMBER
PRICE
NUMBER
Hi,
As the error message sugggested, INSERT directly into the sales table. You can get the values from a sub-query that joins whatever tables are needed, including sales itself. MERGE might be simpler and more efficient than INSERT.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
If you're asking about a DML statement, such as INSERT, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002
Similar Messages
-
Hi,
After using sql loader to import informations in the table fa_mass_additions and after the functionnal uses a treatment to imputate this assets, it asks me to do an update on the table fa_additions to change the value of attribute1 but i get an error
Error report:
ORA-01779: cannot modify a column which maps to a non key-preserved table
ORA-06512: at line 11
01779. 00000 - "cannot modify a column which maps to a non key-preserved table"
*Cause: An attempt was made to insert or update columns of a join view which
map to a non-key-preserved table.
*Action: Modify the underlying base tables directly.
please how can i do this update?Hi,
The "fa_additions" is a view, not a table.
You should update the base table "fa_additions_b".
Regards,
Bashar -
UPDATE with inline view - ORA-01779:cannot modify a column which maps to a
Hello....
With the following SQL, I get the ORA-01779 mentioned in the Subject Line:
update
(select a.old_c1
,a.old_c2
,a.old_c3
,b.old_c1
,b.old_c2
,b.old_c3
from table1 a, table2 b
where a.id = b.id)
set a.old_c1 = b.old_c1
,a.old_c2 = b.old_c2
,a.old_c3 = b.old_c3;
Any help or explanation would be helpful. Thank you.This does not work either.Works for me:
SQL> select * from table1;
ID O O O
101 a b c
102 d e f
SQL> select * from table2;
ID O O O
101 x y z
103 g h i
SQL> update table1 a
2 set (a.old_c1
3 ,a.old_c2
4 ,a.old_c3
5 ) = (select b.old_c1
6 ,b.old_c2
7 ,b.old_c3
8 from table2 b
9 where b.id = a.id
10 )
11 where exists
12 (select 1
13 from table2 b
14 where b.id = a.id
15 );
1 row updated.
SQL> select * from table1;
ID O O O
101 x y z
102 d e fNeed a little more to go on than "doesn't work".
Are you still getting duplicates in the subquery? -
Unable to Insert record In forms: error -ORA-01779 :cannot modify a column
Hi,
I have created one form with two block.
Block-1 : Based on View
Block-2 : Based on table
There is is relationship between Block-1 and Block-2.
Block-1 is populating from LOV.
I just need to insert /update record Block-2 based on data from Block-1
So Block-1 I have made read only at runtime (Inser/update all properties are false).
Now when I insert record in Block-2 based on record from block-1, and getting below error.
"ORA-01779: cannot modify a column which maps to a non key-preserved table"
It is not allowing to insert record.
Please help me.
SubirThe error states that there is some operation on a view, not an a table.
Now when I insert record in Block-2 based on record from block-1What does that mean? How do you insert records in block 2?
When exactly occurs the error? -
ORA-01445: cannot select ROWID from a join view without a key-preserved tab
Hi All,
I have 2 windows in a form. When i click on a button in first window, then 2nd window will be opened. (Note: both windows are based have master-details relationship with Table1 and Table2 respectively)
When i enter the information in 2nd window and click the SAVE Button it has to save those values to database. It used to work fine earlier. now, i am getting the following error.
FRM-40501: ORACLE error: unable to reserve record for update or delete.
ORA-01445: cannot select ROWID from a join view without a key-preserved table
Please help me, how can i resolve this error. Also, guide me what is a key-preserved table.
Thanks in advance,
AmarFirstly: - Please make sure that you have not opened the same record somewhere else in any other form and trying to update from there.
Secondly: - In your window 1 have you opened the same record which you are querying, editing and saving in window 2 ? If yes then this will givbe you error as you are trying to update a record which is already being updated somewhere else.
Please mark if it helps -
ORA-01445 : cannot select rowid from a join view without a key preserved ta
Hi,
I am using Designer6i for generatin forms:
my blokc is based on a view...
when executing the module, I have the following error when trying to change a value of an item :
FRM 40501: unabe to reserve record for update or delete ,
the display error say :
ORA-01445 : cannot select rowid from a join view without a key preserved table!!!!!
Any help please ???you either create an INSTEAD OF trigger for that view or use on-lock trigger on that block to edit, e.g., SELECT ...INTO...FROM...WHERE...FOR UPDATE NOWAIT.
-
Cannot select ROWID from a join view without a key-preserved table at OCI c
Hi All,
Can anybody help me..?
When i am creating the request in the presentation services ..
for some of the columns i am getting the following error..by removing those those columns it's working fine..
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1445, message: ORA-01445: cannot select ROWID from a join view without a key-preserved table at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
Please suggest me a solution..
Thanks in Advance...Looks like you have a view that contains the ROWID of another table. Does the view work first from sqlplus? See whether it returns any data. Its a ORA- specific error. So, the error is related to your view rather than BI EE. Also, how many columns are you trying to pull in your report?
Thanks,
Venkat
http://oraclebizint.wordpress.com -
ORA-00604 & ORA-30512 CANNOT MODIFY TABLE MORE THAN ONCE IN A TRANSACTION
We have a requirement where two tables should be in sync at any given point
in time with respect to the structure of the tables.
Any change on table/column via ALTER (MODIFY, ADD, RENAME COLUMN, DROP
COLUMN) on the parent table should be replicated to the replica table.
I created a DDL_TRIGGER on the schema and the desired result is achieved but
for the following one scenario for which its failing.
The issue is, if we try to reduce the width of the column (via ALTER ..
MODIFY) it fails with the following error
ORA-00604: error occurred at recursive SQL level 1
ORA-30512: cannot modify DEVTESTF_OIM.REPLICA_ABC more than once in a
transaction
Please follow the steps to reproduce the issue (the issue is across the DB
version checked on 10.2, 11.1 and 11.2 DB version)
-- Step1 Create Parent Table
CREATE TABLE abc (col1 VARCHAR2(10))
-- Step2 Create Replica Table
CREATE TABLE replica_abc (col1 VARCHAR2(10))
-- Step3 Create DDL Trigger
CREATE OR REPLACE TRIGGER ddl_trigger
AFTER ALTER ON SCHEMA
DECLARE
operation VARCHAR2(30);
object_name VARCHAR2(30);
l_sqltext VARCHAR2(100);
i PLS_INTEGER;
l_count NUMBER:=0;
sql_text dbms_standard.ora_name_list_t;
BEGIN
i := dbms_standard.sql_txt(sql_text);
SELECT ora_sysevent, ora_dict_obj_name, UPPER(sql_text(i))
INTO operation, object_name, l_sqltext
FROM dual;
IF ora_dict_obj_name = 'ABC' THEN
l_count := INSTR(l_sqltext,'ADD CONSTRAINT',1,1);
l_count := l_count + INSTR(l_sqltext,'DISABLE',1,1);
l_count := l_count + INSTR(l_sqltext,'DROP CONSTRAINT',1,1);
l_count := l_count + INSTR(l_sqltext,'PRIMARY KEY',1,1);
l_count := l_count + INSTR(l_sqltext,'ADD CHECK',1,1);
IF (l_count = 0) THEN
l_count := INSTR(l_sqltext,'ADD',1,1);
l_count := l_count + INSTR(l_sqltext,'MODIFY',1,1);
l_count := l_count + INSTR(l_sqltext,'DROP COLUMN',1,1);
l_count := l_count + INSTR(l_sqltext,'RENAME
COLUMN',1,1);
IF (l_count >0) THEN
l_sqltext := REPLACE(l_sqltext,'TABLE ABC','TABLE REPLICA_ABC');
execute immediate l_sqltext;
END IF;
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
RAISE ;
END;
-- Step 4 Issue the following ALTER command on the Parent table 'ABC'
ALTER TABLE ABC MODIFY COL1 VARCHAR2(9);
will show the following
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-30512: cannot modify DEVTESTF_OIM.REPLICA_ABC more than once in a
transaction
ORA-06512: at line 34
whereas the following commands works fine
ALTER TABLE ABC MODIFY COL1 VARCHAR2(11);
and also the rest of the operations
ALTER TABLE ABC ADD COL2 VARCHAR2(20);
ALTER TABLE ABC RENAME COLUMN COL2 TO COL3;
ALTER TABLE ABC DROP COLUMN COL3;
The issue is while reducing the size of VARCHAR2 columns, while the rest of
option works fine.
Any suggestion or workaround please.It looks like a bug to me. The failing statement from the SQL trace is
PARSE ERROR #12:len=77 dep=3 uid=0 oct=3 lid=0 tim=1263332549608656 err=30512
select /*+ first_rows */ 1 from "TIM"."REPLICA_ABC" where LENGTHB("COL1") > 9and exception cannot explain it. -
ORA-12983: cannot drop all columns in a table
Hi,
I am creating a table with two columns.
I have modified a column as unused using ALTER statement.
After that i have tried to drop the another column by using ALTER statement.
But it throws an error ORA-12983: cannot drop all columns in a table.
is it not possible to achieve this via ALTER statement?
thanksis there any other way to find the name of the columns which have been marked as unused?Don't think so, and you would not be able to do much about. You won't be able to reference it, you won't be able to un-unuse it, and you would even be able to add a new column having same name.
Why are you using SET UNUSED in the first place?
Regards
Peter
Quoting myself:
You won't be able to reference itMaybe not good enough:
SQL> select column_name, data_type, segment_column_id
from user_tab_cols
where table_name = 'T';
COLUMN_NAME DATA_TYPE SEGMENT_COLUMN_ID
SYS_C00001_11051618:28:14$ NUMBER 1
B NUMBER 2
SYS_C00003_11051618:28:14$ NUMBER 3
3 rows selected.
select "SYS_C00003_11051618:28:14$" from t
Error at line 1
ORA-00904: "SYS_C00003_11051618:28:14$": invalid identifier
SQL> alter table t drop column "SYS_C00001_11051618:28:14$";
Table altered.
SQL> select column_name, data_type, segment_column_id
from user_tab_cols
where table_name = 'T';
COLUMN_NAME DATA_TYPE SEGMENT_COLUMN_ID
B NUMBER
1 row selected.
Note: Both columns "disappeared" Thanks MichaelS
Edited by: Peter on May 16, 2011 9:29 AM -
ORA-02348: cannot create VARRAY column with embedded LOB
Hi
This error message I get when I try to create a table from my schema file which has a (sub-) element of type CLOB.
In my XML document I have an element which needs to become declared a CLOB (because it's > 4000 bytes), in my Schema I define it's element node like:
<xs:element name="MocovuState" xdb:SQLType="CLOB">
I can register this Schema file but when I create the table, I get the error:
ORA-02348: cannot create VARRAY column with embedded LOB
Does anybody know how to handle this ?
MarcelYou need to use the xdb:storeVarrayAsTable="true" schema annotation so that unbounded elements are created at schema registration time as nested tables. Varrays can not contain CLOBs/BLOBS. Use the schema annotation xdb:SQLType="CLOB" to tell Oracle XMLDB to use CLOB storage for the element. See your schema below:
P.S. XMLSPY is invaluable as it supports Oracle XML Schema annotations.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" targetNamespace="http://www.yourregisteredschemanamespace.com" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true">
<xs:element name="nRootNode">
<xs:complexType>
<xs:all>
<xs:element name="nID" type="xs:long"/>
<xs:element name="nStringGroup" type="nStringGroup" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:complexType name="nStringGroup">
<xs:sequence>
<xs:element name="nString" type="nString" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="nString" xdb:SQLType="CLOB">
<xs:sequence>
<xs:element name="nValue" type="nValue" minOccurs="0" xdb:SQLType="CLOB"/>
</xs:sequence>
<xs:attribute name="id" type="xs:long" use="required"/>
</xs:complexType>
<xs:simpleType name="nValue">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:schema> -
ORA-12032: cannot use rowid column
Hi,
on 8.1.7 I have the following error :
ORA-12032: cannot use rowid column from materialized view log on "string"."string"
The solution is :
Action: A complete refresh is required before the next fast refresh. Add ROWID columns to the materialized view log, if required.
How can I do a complete refresh before the next fast refresh or Add ROWID columns ? How to know if Add ROWID columns is required ?
Thank you.
PS :
my script is :
START WITH TO_DATE('06-jul-2010 17:57:48','dd-mon-yyyy hh24:mi:ss')
NEXT SYSDATE+1/24user522961 wrote:
Hi,
on 8.1.7 I have the following error :
ORA-12032: cannot use rowid column from materialized view log on "string"."string"
The solution is :
Action: A complete refresh is required before the next fast refresh. Add ROWID columns to the materialized view log, if required.
How can I do a complete refresh before the next fast refresh or Add ROWID columns ? How to know if Add ROWID columns is required ?
Thank you.run above
EXECUTE DBMS_MVIEW.REFRESH('MV_NAME','C'); -
ORA-01776: cannot modify more than one base table through a join view
I have created EO based on a database view than consists of two tables, and only one is updateable.
When I try to update a row using EO, I got a following message: "ORA-01776-cannot modify more than one base table through a join view"
In Forms, this issue is resolved by setting "Query Only" property of non-updateable items to "True".
Is it possible to do something like that in ADF BC?
ThanksThanks for answer.
When I set "updateable" property to "Never", that attribute is protected from any change.
I'm sorry for incomplete usecase.
I have set up a list of value on that attribute, because it is a lookup field for another table and I need to get an ID from that table.
Basically, I need that attribute to be updateble for BC, but not for database.
Edited by: MarioK on Oct 13, 2011 9:28 AM -
ORA-12839: cannot modify an object in parallel after modifying it
Hi,
I am facing a Problem when I am trying to Update a Table:
ORA-12839: cannot modify an object in parallel after modifying it
How to rectify it?
Any help will be highly needful
Thanks and RegardsOr if it needs to be the same transaction leave away any parallelization part as e.g. an append hint:
SQL> create table emp2 as select * from emp where 1=2
Table created.
SQL> insert /*+ append */ into emp2 select * from emp
14 rows created.
SQL> update emp2 set sal=200 where empno=7788
Error at line 11
ORA-12838: cannot read/modify an object after modifying it in parallel -
Error ORA-01779 while updating view
I am using oracle 9i version is 9.2.0.1.0, While updating i am getting error,which i mention below.
ORA-01779:cannot modify a column which maps to a non key-preserved table
In this view there is no any group function.
Help me please.ORA-01779:
cannot modify a column which maps to a non key-preserved table
Cause: An attempt was made to insert or update columns of a join view which map to a non-key-preserved table.
Action: Modify the underlying base tables directly. -
I have a tabular form based on a view like:
select
t1.id,
t2.network_id,
t2.month_id,
t2.icp_ic,
t1.status,
t1.disc_comment
from
table1 t1,
table2 t2
where
t1.month_id (+) = t2.month_id and
t1.network_id (+) = t2.network_id and
t1.icp_id (+) = t2.icp_id
id is a surrogate key of table1 and there is a trigger to populate this on insert. There is also a unique index on table2 (month_id, network_id, icp_id). When I change the disc_comment column through the form and try to save I get an error:
Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01779: cannot modify a column which maps to a non key-preserved table
If I take out the outer join, it works fine. The problem is table1 will not have a row for every row in table 2, hence I need the outer join. Any ideas how I can get around this problem?
Regards
SadanandHi Andy,
Yes I am paginating the form and I am not getting a set of blank rows. What I mean by next set of records is - if the page is showing rows 11 to 20 and I enter a comment against row 15 and save, the form inserts the comment into the table via the INSTEAD OF trigger and the page automatically refreshes with rows 21 to 30 from the query. On the other hand, if I click Prev link and redisplay rows 11 to 20, change the comment and click on Save, the form updates the comment and refreshes the page with rows 11 to 20. If I update the comment again, it redisplays page with rows 11 to 20 and this is the behaviour I desire when I insert data. Remember that I am using outer join, so there will be a mix of inserts and updates of data. I hope my explanation is clear. I have tried removing the tabular form region and starting from scratch but that hasn't helped - maybe I will drop the page and recreate it.
As for checksum error, you are right - it disappears after I logout and login again.
Regards
Sadanand
Maybe you are looking for
-
hi all, in my form 16 there is a notice pay amount which are displaying correctly, but its not getting deducted in calculation. can anyone please tell me that how would i include it for calculation? regards saurabh.
-
I am running an FTP server "Rumpus" and generally it works very well. It does FTP and FTP via HTTP. We use it as an internal FTP server within our company. However, there is a drag and drop feature that has stopped working on most clients that are co
-
Channel Info Banner Display Time
How or where can I set the display time for the channel info banner time? My info banner remains on the screen for about 10 seconds unless I press the exit button.
-
Transport Active Metadata in BW Adapter
Hello Experts! I need your HELP!!!! If I enter in development machine, tcode BWA5 I have a lot of infosources checked as "Active" but there is not any transport requests with this objects. Do I have to activate them in Productive environment or does
-
Weblogic WebServices Client: how to use HTTP 1.1 protocol ?
Hi, I generated a stub ( jar file) to call a weblogic webservice from a client, both in weblogic workshop 8.1.4 and weblogic workshop 10.3. It seems that both jars (generated by weblogic) use HTTP 1.0 protocol (I can see the HTTP 1.0 requests from ac