ORA-01733 on update of version (view) table join
I'm doing an update to a table with version of workspace manager (Workspace Manager replaces the table with his own point of view) using a line join view (because the merger does not display of INSTEAD of triggers). It works very well on a normal table and simple updates on the work of versioned table but when I try the join implementation update on a table with version, I get "ORA-01733: virtual column not allowed here."I do not understand why it gives ORA-01733 here. Can someone explain and help me get the join update to work?
The version is 11.2.0.3
I can use the update successfully while the table is not versioned.
The Workspace Manager view isn't a self-join, and the column is not a function or an expression.
I update the columns show also editable in user_updatable_columns
I'm prototyping this for an application. I need to make large updates - there could be 10,000 rows with 80 columns updated, and I will do this for the 200 paintings, so I don't want to upgrade from postcode =(select...) set suppliers
Here is a script to demonstrate the problem:
create table suppliers (supplier varchar2(10) not null, postcode varchar2(10), v1 number, v2 number, v3 number, constraint suppliers_pk primary key (supplier));
create table sup_data (supplier varchar2(10) not null, new_postcode varchar2(10), nv1 number, nv2 number, nv3 number, constraint sup_data_pk primary key (supplier));
insert into suppliers values ('NORTH', null, 1, 2, 3);
insert into sup_data values ('NORTH', '3000', 1.1, 2.2, 3.3);
commit;
update suppliers set postcode='1000', v1=0.1, v2=0.2,
update (select d.postcode, s.new_postcode , d.v1, d.v2, d.v3, s.nv1, s.nv2, s.nv3 from suppliers d join sup_data s on d.supplier = s.supplier)
set postcode= new_postcode, v1 = nv1, v2 = nv2, v3 = nv3 ;
-- That succeeded. Now try with the workspace manager versioning view.
rollback;
exec DBMS_WM.EnableVersioning ('suppliers', hist=> 'VIEW_WO_OVERWRITE');
update (select d.postcode, s.new_postcode , d.v1, d.v2, d.v3, s.nv1, s.nv2, s.nv3 from suppliers d join sup_data s on d.supplier = s.supplier)
set postcode= new_postcode, v1 = nv1, v2 = nv2, v3 = nv3 ;
-- set postcode= new_postcode
-- *
-- ERROR at line 2:
-- ORA-01733: virtual column not allowed here
-- Try with an explicit view:
create view sup_updt as select d.postcode, s.new_postcode , d.v1, d.v2, d.v3, s.nv1, s.nv2, s.nv3 from suppliers d join sup_data s on d.supplier = s.supplier;
select * from user_updatable_columns where table_name = 'SUP_UPDT';
select * from sup_updt;
update sup_updt set postcode= new_postcode, v1 = nv1, v2 = nv2, v3 = nv3 ;
-- update sup_updt set postcode= new_postcode, v1 = nv1, v2 = nv2, v3 = nv3
-- *
-- ERROR at line 1:
-- ORA-01733: virtual column not allowed here
Thanks for your helpPublished by: davidp 2 on April 17, 2013 19:17
Oracle development explained the ORA-1733:
The update fails because the target (select d.postcode, s.new_postcode, d.v1, d.v2, d.v3, s.nv1, s.nv2, v_suppliers s.nv3 d join s on d.supplier = s.supplier sup_data) the update is a non merged display inline. An update on a view must be translatable for an update on an underlying table. Thus, all the views mentioned in the update must be seen that can be merged. The same phenomenon occurs when you create instead of trigger on the view v_suppliers [was] not that can be merged, leading to the error downstream.
For example, an (undocumented) ORA-1733 means "can not update display not merged."
Tags: Database
Similar Questions
-
MV incremental update on remote database table join query
Hello
I am creating a MV with incremental refresh option on a join query with 2 tables of database remote.
Created journals of MV on 2 tables in the remote database.
DROP MATERIALIZED VIEW LOG ON emp;
CREATE MATERIALIZED VIEW LOG ON emp WITH ROWID;
DROP MATERIALIZED VIEW LOG ON dept;
CREATE MATERIALIZED VIEW LOG ON WITH ROWID dept;
Now, try to create the MV,
Mv_emp_dept CREATE MATERIALIZED VIEW
IMMEDIATE CONSTRUCTION
REFRESH QUICKLY
START BY SYSDATE
1 /(24*15) NEXT SYSDATE+.
WITH THE PRIMARY KEY
AS
SELECT e.ename, e.job, d.dname FROM emp@remote_db e, dept@remote_db d
WHERE e.deptno = d.deptno
AND e.sal > 800;
Get the error ORA-12052.
Can you please help me.
Thank you
AnjanNeed to include the ROWID in the mview. Should be something like: -.
CREATE MATERIALIZED VIEW mv_emp_dept BUILD IMMEDIATE REFRESH FAST AS SELECT e.rowid rowide, e.ename, e.job, d.rowid rowidd, d.dname FROM emp@remote_db e,dept@remote_db d WHERE e.deptno=d.deptno AND e.sal>800;
-
ORA-01733-virtual column not allowed here - insert using inline view
Does anyone know why I get ORA-01733-virtual column not allowed here
SQL > select * from v version $;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
AMT for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
-no error without the WITH CHECK option
SQL > INSERT INTO
2 (SELECT
3 location_id,
4 city
5 l.country_id
6 OF country c, localities, regions r l
7 where l.country_id = c.country_id
8 and c.region_id = r.region_id
9 and r.region_name = 'Asia')
10 VALUES (5500, 'Common Wansdworth', 'UK');
1 line of creation.
SQL > rollback;
Complete restoration.
-error with WITH CHECK OPTION
SQL > INSERT INTO
2 (SELECT
3 location_id,
4 city
5 l.country_id
6 OF country c, localities, regions r l
7 where l.country_id = c.country_id
8 and c.region_id = r.region_id
9 and r.region_name = 'Asia' WITH CHECK OPTION)
10 VALUES (5500, 'Common Wansdworth', 'UK');
INSERT INTO
*
ERROR on line 1:
ORA-01733: virtual column not allowed here
I was expecting
ORA-01402: discovers the violation of where WITH CHECK OPTION clause
for the second. Am I missing here?Coskan wrote:
RandolfThanks a lot for the update of this old question
After reading the link, I think I should ignore this error and accept him as ORA-01402The information that you have asked me to check me do not have an understanding of the different error types.
Coskan,
I didn't know this is an old thread that somehow got updated by someone else.
Regarding your question: you're right that the output of the script is not really that useful.
I have just run on 10.2.0.4 and in general, it seems that the output of USER_UPDATABLE_COLUMNS is incorrect regarding the views of join using the WITH CHECK OPTION.
For example although the location_id from the TEST_V_2 column appears as non-editable (probably because of the rule that "the columns used in the join expression" cannot be modified in a join view when you use the WITH CHECK OPTION) I can run successfully your insert if statement I choose a location_id less than 2000.
It seems that summed up the difference if you join more than two tables, you'll always get the error "ORA-01733" when you try to insert in the join with the enabled OPTION CHECK view. For example to add a third table TEST_V_2 which does not change the original view, but simply joined meaning for example COUNTRIES to LOCATIONS, will show the same behavior to throw an ORA-01733, however it works fine when the omission of the WITH CHECK OPTION.
So overall, I tend to say it is really a limitation of the implementation and it is not actually an ORA-01402 but looks like Oracle is simply trying to tell you: Amendment No. INSERT in this possible view. Updates however seem to work, at least I can find some examples of work.
There seems to be other restrictions of implementation with the WITH CHECK OPTION in place even when the only membership as two tables, for example when trying to join the COUNTRIES and PLACES but by selecting only in PLACES and by using a filter on the COUNTRY_ID predicate fails with ORA-01733 when this predicate is applied to the COUNTRY. COUNTRY_ID but it works if this predicate is applied to PLACES. COUNTRY_ID.
I could imagine that Oracle has quietly added some of these restrictions with each patch set due to the angle of the case/adverse reactions encountered. I saw this for other features, too.
Kind regards
RandolfOracle related blog stuff:
http://Oracle-Randolf.blogspot.com/SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676 /.
http://sourceforge.NET/projects/SQLT-pp/ -
Update of a Base Table in a view with a UNPIVOT function.
Hello
I have a requirement to upgrade a Base Table in a view.
This view has the query by using a function of the UNPIVOT operator to display the columns in the tables of the basic of the lines.
I need to update/insert in / remove the Base Table by accessing the view (the user has access to the Base Table, so the DML on the view).
Here is the table I created:-
The sample values are inserted in this table using the script below: -.CREATE TABLE PERSON_DETAILS ( PID VARCHAR2(10 BYTE), FIRSTNAME VARCHAR2(1000 BYTE), LASTNAME VARCHAR2(1000 BYTE), PHONENUMBER VARCHAR2(1000 BYTE), ADDRESS1 VARCHAR2(1000 BYTE), ADDRESS2 VARCHAR2(1000 BYTE), COUNTRY_CODE VARCHAR2(1000 BYTE), LANGUAGE_CODE VARCHAR2(1000 BYTE), EMAIL VARCHAR2(1000 BYTE) )
The code for the display is as below: -.insert into person_details values ('1','XYZ','ABC','1234567890','India','Asia','IN','EN','[email protected]'); insert into person_details values ('2','XYZ2','ABC2','1234567890','India','Asia','IN','EN','[email protected]');
Here are the values of the view:-CREATE OR REPLACE FORCE VIEW PERSON_DETAILS_VIEW ( PID, CD_NAME, CD_VALUE ) AS SELECT "PID", "CD_NAME", "CD_VALUE" FROM person_details UNPIVOT INCLUDE NULLS (cd_value FOR cd_name IN (firstname AS 'First Name', lastname AS 'Last Name', phonenumber AS 'Phonenumber', address1 AS 'address1', address2 AS 'address2', country_code AS 'Country Code', language_code AS 'Language Code', email AS 'Email') );
The user would fire any statement as below: -.PID CD_NAME CD_VALUE 1 First Name XYZ 1 Last Name ABC 1 Phonenumber 1234567890 1 address1 India 1 address2 Asia 1 Country Code IN 1 Language Code EN 1 Email [email protected] 2 First Name XYZ2 2 Last Name ABC2 2 Phonenumber 1234567890 2 address1 India 2 address2 Asia 2 Country Code IN 2 Language Code EN 2 Email [email protected]
The statement above should update the PERSON_DETAILS database table.update person_details_view set cd_value = 'US' where CD_NAME = 'IN'
I understand that I can write an INSTEAD OF trigger, but I don't know what logic to write in the trigger so that the condition is met.
My Version of Oracle
Any help would be much appreciated.Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production PL/SQL Release 11.1.0.7.0 - Production CORE 11.1.0.7.0 Production TNS for Solaris: Version 11.1.0.7.0 - Production NLSRTL Version 11.1.0.7.0 - Production
Thank you
Ankit Khare.
Published by: Ankit_Khare84 on June 28, 2012 14:47It is definitely possible with an INSTEAD of trigger.
for example:
create or replace TRIGGER ioft_person INSTEAD OF UPDATE ON person_details_view FOR EACH ROW declare firstname1 person_details.firstname%type; BEGIN SELECT firstname_new into firstname1 FROM (SELECT pid, cd_name, cd_value FROM ( select * from person_details_view where (pid, cd_name) not in (select :new.pid, :new.cd_name from dual) union all select :new.pid, :new.cd_name, :new.cd_value from dual ) ) PIVOT ( max(cd_value) AS new FOR (cd_name) IN ('First Name' AS firstname, 'Last Name' as lastname, 'Phonenumber' as phonenumber, 'address1' as address1, 'address2' AS address2, 'Country Code' as country_code, 'Language Code' as language_code, 'Email' as email ) ) where pid = :old.pid; UPDATE person_details SET firstname = firstname1 WHERE pid = :old.pid; END ioft_role_perm;
and that run
update person_details_view set cd_value = 'X|X' where cd_name = 'First Name' and pid=1
The logic is: you need to convert back the view through swivel
-
How to make an update of a view online two tables...
When the unique constraint of the second table includes three columns?
I have two tables A and B and I want to update a table column, one using an update of a view online two tables.
Table A:
col1 primary key
col2
Table B:
col1 u1
col2 u2
COL3 u3
COL4
col5
Table col1 primary key, table B has a unique constraint on col1, col2 and col3.
Tables A and B are joined in this way:
And now, I want to update this view and set KEY_OLD = KEY_NEW.select A.col1, A.col2 as KEY_OLD, B.col5 as KEY_NEW from A, B where (B.col1 = 'literal_1') and (B.col2 = 'literal_2') and (A.col1 = B.col3) and (A.col2 = B.col4)
Because of the first three conditions in the where clause for each entry in the table A there is just a matching entry in the table B.
So the table should be preserved in the join key.
But during the update
I get an error ORA-01779.update (select A.col1, A.col2 as KEY_OLD, B.col5 as KEY_NEW from A, B where (B.col1 = 'literal_1') and (B.col2 = 'literal_2') and (A.col1 = B.col3) and (A.col2 = B.col4) ) set KEY_OLD = KEY_NEW;
I did the updates on inline views this way several times in recent weeks and it work very well.
But so far the unique constraint on the table B was just a column ;-)
So what I need is to make it work with the unique constraint on the application of the three-column table B.
Thank you very much in advance for any help.
Hartmut cordiallyPreserved key criteria must be met by the join columns, the optimizer does not agree (in fact I never tried in 11g) just a combination of columns, literals and join.
The alternatives you have are subqueries online (which as you point out can do rather worse), the command MERGE or indicator BYPASS_UJVC semi undocumented.
-
ORA-30506: triggers system cannot rely on tables or views
Hai all,
Why the b/m trigger fails with the error;
create or replace trigger audit_ddl_trg after the ddl on the TABS
*
ERROR on line 1:
ORA-30506: triggers system cannot rely on tables or views
Thank youcreate or replace trigger audit_ddl_trg after ddl on TABS declare sql_text ora_name_list_t; stmt VARCHAR2(4000) := ''; n number; begin if (ora_sysevent='TRUNCATE') then null; else n:=ora_sql_txt(sql_text); for i in 1..n loop stmt:=substr(stmt||sql_text(i),1,4000); end loop; insert into audit_ddl(d, osuser,current_user,host,terminal,owner,type,name,sysevent,sql_txt) values( sysdate, sys_context('USERENV','OS_USER') , sys_context('USERENV','CURRENT_USER') , sys_context('USERENV','HOST') , sys_context('USERENV','TERMINAL') , ora_dict_obj_owner, ora_dict_obj_type, ora_dict_obj_name, ora_sysevent, stmt ); end if; end;
KaiKai,
check this Doc ID metalink note: 107481.1 for the possible resolution, if not, see after outbreak of the sample
CREATE OR REPLACE Trigger test AFTER LOGON ON SCOTT.SCHEMA <==== The corrected line. BEGIN NULL; END;
Concerning
-
update multiple columns in table B of table based on the corresponding pass.
Hello
Will have two tables as below,
Here the table mu got nullability for columns RT_ID, BILL_NO. I need to update this coulmns in the mu of table with the RT_ID, BILL_NO of billing_info of table corresponding to the value of MS.create table billing_info (MS number, RT_ID number, BILL_NO number) create table mu (MS number, RT_ID number, BILL_NO number) insert into billing_info (MS,RT_ID,BILL_NO) values (1,99,635); insert into billing_info (MS,RT_ID,BILL_NO) values (2,99,635); insert into billing_info (MS,RT_ID,BILL_NO) values (3,999,1635); insert into billing_info (MS,RT_ID,BILL_NO) values (4,599,7635); insert into mu(MS) values (1); insert into mu(MS) values (2); insert into mu(MS) values (3); insert into mu(MS) values (4);
How to on this subject.
I tried the follwing examples
http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:43440209618042
and
http://decipherinfosys.WordPress.com/2007/01/31/update-data-in-one-table-with-data-from-another-table/
but without hope...
It throws errors like ora-01779...UPDATE mu SET rt_id = ( SELECT rt_id FROM billing_info WHERE billing_info.ms = mu.ms ) WHERE EXISTS ( SELECT 1 FROM billing_info WHERE billing_info.ms = mu.ms )
updates all lines of MU with the RT_ID of the line in BILLING_INFO where there is a MS value assuming that such a line exists in BILLING_INFO. This assumes that MU is unique in both tables. If there are duplicates, you will need to explain how to know which line of BILLING_INFO corresponds to a particular line of MU.
Of course, from the point of view of standardization, two tables with the same key and the same nonkey column should be extremely unusual.
Justin
-
ORA-12008: error path refresh materialized view
Hello world
I get a weird error when I try to do a quick refresh on my materialized view. My basic approach is simple, that I had a newspaper of MV on my fact table with all the columns required by the materialized view, sequence, including NEW rowid VALUES.
I have my setup of materialized with a view my summary level, COUNT (*) and COUNT (EXP) for every SUM (EXP). I check the MV_CAPABILITIES_TABLE, and of course, it can be run with fast refresh. I have my fact table in the schema USER1 and my materialized in USER2 schema view.
When I create the materialized view, there is no problem. If I immediately executes a fast refresh (EXEC DBMS_MVIEW. REFRESH ('MY_MV', 'F'); ), once again, no problem.
However, if I run the ETLs that update the source fact table, and then I run the quick update again, I get ORA-120008.
But if I do the exact same MV in the scheme of the User1, I have no problem making quick refreshes. What is happening with this? Is the owner of the table must be the one with the materialized view? User1 and USER2 are on the same PB and have the same table space. Should User2 also select additional subsidies on the source fact table? What I give to select on the MVIEW connect you somehow?
Thanks for the help!
-JoeThe mview journal is a separate table. You must grant select, insert, update, delete on it to the user mview.
-
ORA 01407 - cannot update column null - but I put as possible null
Hi, I want to change the column datatype varchar2 to the number, but I have given in the column and I can not remove this column from table so I try this:
change table tux
Add subscribe_type_copy number (3);
updated tux
Set subscribe_type_copy = subscribe_type;
change table tux
change (subscribe_type, null);
updated tux
Set subscribe_type = null;
-mistake here: ORA-01407: cannot update ("TUX". "" NOTIFY ". (' "SUBSCRIBE_TYPE") with the NULL value
-- ? Why? I changed the column to accept NULL value
-I want to do it now:
change table tux
Edit)
subscribe_type number (3) - precision (total number of digits)
);
concerning
What is FK or Pk?
HTH - Antonio NAVARRO
-
Hello
I use the ODP.NET 11.2 (Oracle.DataAccess.dll 4.112.3.0) for .NET 4.5 (in Visual Studio 2012). I can connect to 11g databases but when trying to connect to 9.2.0.8 database, this error is thrown:
ORA-03134: connections to this version of the server are no longer supported
I do not understand why, like I could connect using Toad, but not a .NET application.
Furthermore, I use Windows 7 64 bit.
Any idea?
Thanks in advance,
Dave
Hi Dave,.
I see that you have version 12 of the supplier in the GAC (i.e. Version = 4.121.1.0). But only for the x 86 and you mentioned that you had Windows 7 64 bit. Your application is compiled as x 86, x 64 or Any CPU?
You have confirmed that your application does not load this version? For example, because policy redirects in the GAC (such as Policy.4.112.Oracle.DataAccess, Version = 4.121.1.0).
You can use a tool such as SysInternals Process Explorer or the Assembly Binding Log Viewer (i.e. the SDK fuslogvw) to confirm if necessary.
It is true that version 12 would return ORA-3134 when you attempt to connect to a database of 9.2 because this combination is not supported.
Thank you
Mark
-
ORA-12083: must use DROP MATERIALIZED VIEW to drop
Hi all
Oracle 10 g 2
Solaris 10
face below question... can't go below the user because of the MV... Please let me know how to delete user and MV...
SQL > drop user cascade DW_USR;
*
ERROR on line 1:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-12083: must use DROP MATERIALIZED VIEW to drop
'DW_USR '. "" Dept_account_MV_M ".I tried as you said... .but no luck.
.. is this a bug?I hope that's not a bug...
I hope.. materialized view appears to be abandoned by the drop command but recreation fails because of some disctionary sys tables. the origin of the problem... it's suspicious only...
check once... otherwise connect you SR with metalink...
-
ORA-01731: definition of a circular view encountered
Hello all;
I created a view of table emp1.
SQL > select view_name, text of dba_views where VIEW_NAME = "EMP1_VIEW";
VIEW_NAME TEXT
EMP1_VEW empid select ename, Dept. of emp1, qual
where empid between 1000 and 1010
Now, I tried to use create or replace option
SQL > create or replace view emp1_view as
* Select 2 * of emp1_view with read-only; *
create or replace view emp1_view as
*+
ERROR on line 1:
ORA-01731: definition of a circular view encountered
In fact I want to read only view (emp1_view); without doping.>
Just tried this search in documentation and found this,
>
This article from doc talks about views of the object and does not apply to the example of PAHO.OP uses the SAME object (same name) in the CREATE VIEW as in the SELECT. This is the circular reference OPs.
The views of the object identified in the doc never directly refer to the same object. Each object is a reference to the 'other' object and one of the objects is a view of the object.
-
Facing problem
ORA-1653: impossible to extend the ABC table in tablespace APPS_TS_TX_DATA
Searched many forums but no specific updatePL don't post duplicates - what table belong to which table
-
Version Viewer in CS6 settings
I just updated my V27 Viewer, but when I go to create a new folio it does not give me an option above 25. I use all the DPS tools updated for the latest version of CS6 V27. Has anyone encountered this problem? Is there a setting that needs to be changed?
You may have to scroll to get to 27.
-
need to update Adobe Content Viewer app
Hello
I'm trying to view my publication on the Adobe Content Viewer on iPad via
(1) if creative cloud synchronization
Then I get this message. However when I go to the App Store, it is said that all my applications are to this day.
I deleted the Adobe Content Viewer application from my iPad and reinstalled. I still get the same message.
(2) through Folio Builder Preview
Can someone tell me how I can update my Adobe Viewer when the App store says there is no update available?
There's nothing wrong with my App store app. I've already updated until other applications without problem.
Thank you!
You will have to wait for Apple to approve the new Viewer.
In the meantime, you create as version 24 folios.
Bob
Maybe you are looking for
-
Satellite L50 - A - 1 6: restore the preinstalled recovery Partition
Hi all. I changed the partition of my HARD drive, now the preistalled Partion Recovery is no longer available.I understand that in this way, that the partition table has been altered and if the recovery Partition is not found to restore the factory s
-
How to install qosmioplayer on G10
Hi allI have a problem. I can not install on my G10-104 qosmioplayer. I was download .zip-31-qoplay of this ftp http://support.toshiba-tro.de/tools/qosmio/f10-g10/qoplay/qoplay-31-en.zip. Unzip and burn the bootable CDROM. When I boot this install fr
-
Lightning will fit into socket thunderbolt 2
I have a laptop 2011 with connection Thunderbolt of origin, if I get a unit of storage of say, with Jack Thunderbolt 2 need me an ADJUSTABLE adapter cable?
-
Pavilion G4-1117dx: I forgot the administrator password
I've been locked with disable code 57417663, can anyone help?
-
I started with windows 3.1, upgrade to 95, place leveled for XP and 98 so all my records are updated. I don't want to go to win7. any help will be greatly appreciated.