ORA-01732
Hai experts
While insering or updating in a view it throw error likd "data manipulation not legal to this view".
My view doesn't have any expression. It depends on single table. But while doing any dml it throws error. How can i rectify it? please help me.
create or replace view emp_ui_v
as select eno,ename,salary from emp;
table desc
eno number(10)
ename varchar2(100)
salary number(10)
Thanks
Menaka.R
If you have an access to Oracle Metalink, then take a look at Note:463025.1.
Hint: Basically this note talks about enabling/disabling the parameter OPTIMIZER_SECURE_VIEW_MERGING
For more information on this parameter, then look in the Oracle Documentations.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams146.htm#REFRN10262
Regards,
Sabdar Syed.
Similar Messages
-
Getting error ORA-01732, after implementation of VPD policy
Hi,
I have created a policy to restrcit the number of records affected in auncondtional select & update (not more than 3 at a time). The policy is working fine for the select staement but when I'm trying to update the same table I'm getting "ORA-01372: data manipulation operation not legal on this view".
I'm using Oracle 10g release 2. & I performed following steps:
SQL> connect SYS as SYSDBA
Enter password: ****************
Connected.
SQL> GRANT EXECUTE ON DBMS_SESSION TO smbdev;
Grant succeeded.
SQL> GRANT EXECUTE ON DBMS_RLS TO smbdev;
Grant succeeded.
SQL> GRANT CREATE ANY CONTEXT to smbdev;
Grant succeeded.
SQL> GRANT create trigger to smbdev;
Grant succeeded.
SQL> GRANT ADMINISTER DATABASE TRIGGER to smbdev;
Grant succeeded.
SQL> connect smbdev@SMBS
Enter password: *******
Connected.
SQL> CREATE OR REPLACE CONTEXT rownum_ctx USING rownum_ctx_pkg;
Context created.
SQL> CREATE OR REPLACE PACKAGE rownum_ctx_pkg IS
2 PROCEDURE set_rownum;
3 END;
4 /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY rownum_ctx_pkg IS
2 PROCEDURE set_rownum
3 AS
4 BEGIN
5 DBMS_SESSION.SET_CONTEXT('rownum_ctx', 'rownum', 4);
6 EXCEPTION
7 WHEN NO_DATA_FOUND THEN NULL;
8 END set_rownum;
9 END;
10 /
Package body created.
SQL> CREATE OR REPLACE TRIGGER set_rownum_ctx_trig AFTER LOGON ON DATABASE
2 BEGIN
3 smbdev.rownum_ctx_pkg.set_rownum;
4 END;
5 /
Trigger created.
SQL> CREATE OR REPLACE FUNCTION get_rownum(
2 schema_p IN VARCHAR2,
3 table_p IN VARCHAR2)
4 RETURN VARCHAR2
5 AS
6 rownum_pred VARCHAR2 (400);
7 BEGIN
8 rownum_pred := 'rownum < SYS_CONTEXT(''rownum_ctx'', ''rownum'')';
9 RETURN rownum_pred;
10 END;
11 /
Function created.
SQL> BEGIN
2 DBMS_RLS.ADD_POLICY (
3 object_schema => 'smbdev',
4 object_name => 'SMB_BOLT_CODE',
5 policy_name => 'rownum_policy',
6 function_schema => 'smbdev',
7 policy_function => 'get_rownum',
8 statement_types => 'select,update’)
9 END;
10 /
PL/SQL procedure successfully completed.
SQL> select * from smbdev.SMB_BOLT_CODES;
CATENTRY_ID SYN_BOLT_CODE
13700 08000026540000
13701 08000026520000
13702 08000026530000
SQL> update smb_bolt_codes set SYN_BOLT_CODE='asd';
update smb_bolt_codes set SYN_BOLT_CODE='asd'
ERROR at line 1:
ORA-01732: data manipulation operation not legal on this view
SQL> select * from tab where tname=’ SMB_BOLT_CODES’;
TNAME TABTYPE CLUSTERID
SMB_BOLT_CODES TABLE
SQL> connect sys@smbs as SYSDBA
Enter password: ***********
Connected.
SQL> select count(*) from smbdev.SMB_BOLT_CODES;
COUNT(*)
101
Please let me know what I'm doing wrong or what I need to change?
Thanks in advance.Welcome to the forum!
This seems odd: you add a policy to an object named SMB_BOLT_CODE, but you query SMB_BOLT_CODES
SQL> BEGIN
2 DBMS_RLS.ADD_POLICY (
3 object_schema => 'smbdev',
4 object_name => 'SMB_BOLT_CODE',
5 policy_name => 'rownum_policy',
6 function_schema => 'smbdev',
7 policy_function => 'get_rownum',
8 statement_types => 'select,update’)
9 END;
10 /
PL/SQL procedure successfully completed.
SQL> select * from smbdev.SMB_BOLT_CODES; --<------ Notice the extra S here...Edited by: Alex Nuijten on Aug 14, 2009 2:28 PM -
ORA-01732: what functions are allowed for view creation?
Hi,
i try to create a view, where i can delete rows. Here my view
CREATE OR REPLACE VIEW myview as select * from (select * from orders order by starttime) where rownum < 4
If i try to delete a row i get:
SQL Error: ORA-01732: Datenmanipulationsoperation auf dieser View nicht zulässig
(translation: data manipulation for this view not allowed)
Breaks the rownum the view? I tested it with rank() over and this breaks it too...sql>
CREATE OR REPLACE VIEW myview
as
select * from (select * from emp order by hiredate) where rownum<4;
View created
sql>
create or replace trigger trig1
instead of delete
on myview
for each row
begin
delete from emp
where empno = :old.empno;
end;
Trigger created.
sql>select * from myview;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
sql>
delete from myview
where rownum=1;
1 row deleted.
sql>select * from myview;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
Message was edited by:
jeneesh -
ORA-01732: data manipulation operation not legal on this view
I have a table, when I want to update some row in it, it gives this error. Why?? It's not view, it's table!
hi,
http://www.dbmotive.com/oracle_error_codes.php?errcode=01732
go through above link it will help you.
regards
Taj -
How do I order ResultSet AND update? My attempts yield ORA-00907 or ORA_01732
I am using JDev 9.0.3 to create an application I run using Java 1.3.1 and Oracle 9.2.0.1.0 JDBC drivers.
I want to select the rows of a single table ordered by a "sortorder" column, iterate through the records, update as required, and occasionally move to the insert row, insert a record, and move back to where I left off.
Can anyone supply the recommended way to do this?
Now if I drop the "order by" clause/requirement I can do this just fine.
However, if I add the "order by" clause (as below) I get error ORA-01732 "manipulation operation not legal on this view" when issuing rs.insertRow() (note NOT moveToInsertRow(), updateLong(), etc. but the actual insertRow() )
myconn.prepareStatement(
"select rowid, temptopsort.* from temptopsort order by sortorder"
, ResultSet.TYPE_SCROLL_INSENSITIVE
, ResultSet.CONCUR_UPDATABLE
I get this same result with ResultSet.TYPE_SCROLL_SENSITIVE, with JDK 1.4.1 (and appropriate Oracle ojdbc14.jar, etc.)
So again my questions is HOW DO YOU ITERATED THROUGH AND ORDERED RESULT SET AND UPDATE/INSERT?
Thanks
R.Parr
Temporal ArtsThomas,
Oracle was the first RDBMS I used (way back, around the year 1990, I believe). Several years later, I moved from Oracle to Informix. It took me a long time to realize that, although Informix and Oracle are both RDBMSs, they are very different. What I needed to do was forget how I used to work with Oracle, and learn how to work with Informix.
Naturally, before I came to this realization, I spent a lot of energy cursing Informix and wondering, "why doesn't it work like Oracle does?"
However, after I made the "mind-switch", and learned to do things the Informix way, everything was smooth sailing (and very enjoyable, too :-)
So I'm only guessing, of-course, but I get the feeling that you may be encountering a similar reaction to me, now that you are migrating from "MySQL" to "Oracle".
The usual advice I see given to people in (what I assume to be) your situation, is to peruse the Oracle documentation and/or the book "Expert One-on-One Oracle" by Thomas Kyte.
Good Luck,
Avi. -
Interactive report based on complex view
firefox 24 , apex 4.0 , db11gxe ,
hi all,
i created an interactive report with this code :
select c.client_id , c.client_name , c.age , c.email , c.phone ,
p.payment_date , sum(p.amount) "summary"
from clients c , payments p
where c.client_id = p.client_id
group by c.client_id , c.client_name , c.age , c.email , c.phone ,
p.payment_date;
but the problem was i could not delete any of the rows of the report , because there was no checkbox existed , so i created one with "apex_application.checkbox" , and i have got it now , but
i still can not delete any rows ,
i created a button to submit the page , and a process with this code
FOR i in 1..APEX_APPLICATION.G_F01.count
LOOP
DELETE FROM cp
WHERE client_id = APEX_APPLICATION.G_F01(i);
END LOOP;
and sure nothing was deleted , and i am facing this error
ORA-01732: data manipulation operation not legal on this viewWhat is the object "CP" ?
It sounds like it is a view. If it's the same you've used for the IR, then check out "key preserved views"
Oracle doc - http://docs.oracle.com/cd/B28359_01/server.111/b28310/views001.htm#ADMIN11784
Tom Kyte - http://asktom.oracle.com/pls/asktom/f?p=100:11:6474092145067::::P11_QUESTION_ID:548422757486
There could be another issue once you address the error - depending on how you've defined apex_application.checkbox2 (the other is deprecated)
You may not be associating the correct value in g_f01 -
Error updating tables based on schema
Hello,
I'm trying to update a table based on the next schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="HILO" xdb:SQLType="HILO_TYPE" xdb:defaultTable="HILO_TABLE">
<xs:complexType>
<xs:sequence>
<xs:element name="MENSAJE" maxOccurs="unbounded" xdb:SQLType="MENSAJE_TYPE" xdb:maintainOrder="false">
<xs:complexType>
<xs:sequence>
<xs:element name="FECHA" type="xs:date" xdb:SQLType="DATE"/>
<xs:element name="TITULO" xdb:SQLType="VARCHAR2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="200"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CUERPO" type="xs:string" xdb:SQLType="VARCHAR2"/>
<xs:element name="DNI_CREADO_POR" xdb:SQLType="VARCHAR2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="9"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ASIGNATURA" xdb:SQLType="VARCHAR2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="APROBADO" xdb:SQLType="VARCHAR2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="APROBADO"/>
<xs:enumeration value="RECHAZADO"/>
<xs:enumeration value="PENDIENTE"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute name="NUMERO" type="xs:int" use="required" xdb:SQLType="INTEGER"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="CONTADOR" type="xs:int" use="required" xdb:SQLType="INTEGER"/>
</xs:complexType>
</xs:element>
</xs:schema>
And the update that i'm trying to do is the next one:
UPDATE hilo_table p
SET value(p) =
updatexml(value(p),'/HILO/MENSAJE/CUERPO/text()', 'Edit' )
where existsnode(VALUE(p), 'HILO[@CONTADOR="1"]') = 1;
ERROR en línea 1:
ORA-01732: operación de manipulación de datos no válida en esta vista
I have updated another tables based on schema and it works fine, any idea?OK this is your decision. However If you are building a production system that is important to your orgnanization as the product manager I strongly recommend that you either upgrade to a least 9.2.0.3.0 or discontinue using XML DB technology completely
There are probably somewhere in the order of 500 serious XML DB related bugs fixed between 9.2.0.1.0 and 9.2.0.7.0, all of which have been regarded as serious enough to impossible for a customer to develop or deploy a production system. None of these will EVER be fixed or available as patches for 9.2.0.1.0.
The way in which we store the data on the disc is different in 9.2.0.3.0, and while in theory we migrate the on disc format when you upgrade in practice I know that is has never been tested with any significant amount of data present.
Also you really want to take the support situation into account. Image this, it's 3:00am in the morning and your production system fails due one of the bugs that have been fixed in a later release of the product. You cannot find a workaround and you call oracle support for help. They WILL say, sorry there is nothing we can do until you upgrade to 9.2.0.3.0. Now you have to upgrade in hurry and then re-test everything you have done before you can even start working on a fix.
From a business perspective staying on 9.2.0.1.0 and continuing to use the XML DB technology makes no sense. I hope I have made this clear. If you want I will be more than happy to discuss this issue with your development managers. -
Updatable Materialized View with Union ALL
(please don't ask about db structure)
DB: 11gR2
create table table_1 (
id number primary key,
val varchar2(100)
create table table_2 (
id number primary key,
val varchar2(100)
insert into table_1(id) values (0);
insert into table_1(id) values (2);
insert into table_1(id) values (3);
insert into table_1(id) values (4);
insert into table_1(id) values (5);
insert into table_2(id) values (10);
insert into table_2(id) values (12);
insert into table_2(id) values (13);
insert into table_2(id) values (14);
insert into table_2(id) values (15);
update table_1 set val='Table1 val:'||id;
update table_2 set val='Table2 val:'||id;
create view v_table_all as
select * from table_1
view V_TABLE_ALL created.
select * from v_table_all;
ID VAL
0 Table1 val:0
2 Table1 val:2
3 Table1 val:3
4 Table1 val:4
5 Table1 val:5
select column_name, updatable, insertable, deletable
from user_updatable_columns
where table_name = 'V_TABLE_ALL'
COLUMN_NAME UPDATABLE INSERTABLE DELETABLE
ID YES YES YES
VAL YES YES YES
update v_table_all set val='XXX changed' where id = 3;
1 row updated.
select * from table_1;
ID VAL
0 Table1 val:0
2 Table1 val:2
3 XXX changed
4 Table1 val:4
5 Table1 val:5
rollback;
select * from table_1;
ID VAL
0 Table1 val:0
2 Table1 val:2
3 Table1 val:3
4 Table1 val:4
5 Table1 val:5
create or replace view v_table_all as
select * from table_1
union select * from table_2;
view V_TABLE_ALL created.
select * from v_table_all;
ID VAL
0 Table1 val:0
2 Table1 val:2
3 Table1 val:3
4 Table1 val:4
5 Table1 val:5
10 Table2 val:10
12 Table2 val:12
13 Table2 val:13
14 Table2 val:14
15 Table2 val:15
select column_name, updatable, insertable, deletable
from user_updatable_columns
where table_name = 'V_TABLE_ALL'
COLUMN_NAME UPDATABLE INSERTABLE DELETABLE
ID NO NO NO
VAL NO NO NO
trying update:
update v_table_all set val='XXX changed' where id = 3;
SQL-Fehler: ORA-01732: Datenmanipulationsoperation auf dieser View nicht zulässig
01732. 00000 - "data manipulation operation not legal on this view"
*Cause:
*Action:
drop view v_table_all;
view V_TABLE_ALL dropped.all is ok before this point.
now we want create a new materialized view with some query
create materialized view v_table_all
as
select * from table_1
union all select * from table_2 ;
materialized view V_TABLE_ALL created.
select column_name, updatable, insertable, deletable
from user_updatable_columns
where table_name = 'V_TABLE_ALL'
COLUMN_NAME UPDATABLE INSERTABLE DELETABLE
ID YES YES YES
VAL YES YES YES it seems to be ok with update.
but...
update v_table_all set val='XXX changed' where id = 3;
SQL-Fehler: ORA-01732: Datenmanipulationsoperation auf dieser View nicht zulässig
01732. 00000 - "data manipulation operation not legal on this view"
*Cause:
*Action:How can solve this issue??
Any suggestionLooks like user_updatable_columns sort of thinks the MV is just a table - I don't know about that...
An MV on a single table can be updated - I tried that and it works:
create materialized view mv_table_1 for update
as
select * from table_1;I noticed [url http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/advmv.htm#sthref294]examples stating the UNION ALL needs a "marker" so Oracle can know from the data which source table a row in the MV originates from - like this:
create materialized view v_table_all for update
as
select 'T1' tab_id, table_1.* from table_1
union all
select 'T2' tab_id, table_2.* from table_2 ;But that also fails (the "marker" requirement was specifically for FAST REFRESH, so it was just a long shot ;-) )
What are you planning to do?
<li>Create the MV.
<li>Update records in the MV - which then is no longer consistent with the source data.
<li>Schedule a complete refresh once in a while - thereby overwriting/losing the updates in the MV.
If that is the case, I suggest using a true table rather than an MV.
<li>Create table t_table_all as select ... .
<li>Update records in the table - which then is no longer consistent with the source data.
<li>Schedule a job to delete table and insert into table select ... once in a while - thereby overwriting/losing the updates in the table.
In other words a kind of "do it yourself MV".
I cannot see another way at the moment? But perhaps try in the data warehousing forum - the people there may have greater experience with MV's ;-) -
I am trying to save contents of xml file into database tables. I know I have to use dbms_xmlsave.insertxml, but it does not allow you to work with multiple tables, so I created a view to join 2 tables together. But when I try to insert into the view I get this error:
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
oracle.xml.sql.OracleXMLSQLException: Exception
'oracle.jdbc.driver.OracleSQLException:ORA-01732: data manipulation operation
not legal on this view
' encountered during processing ROW element 1All prior XML row changes were
rolled back. in the XML document.
ORA-06512: at "SYS.DBMS_XMLSAVE", line 91
ORA-06512: at line 31
My xmldatagram looks like this:
<?xml version = "1.0"?>
<warranty_claim>
<ROW>
<customer_claim_no>12345</customer_claim_no>
<claim_date>2003-SEP-24</claim_date>
<repair_shop_site_name>test supplier</repair_shop_site_name>
<failed_part_no>12345</failed_part_no>
<other_part>
<other_part_item>
<customer_claim_no>12345</customer_claim_no>
<part_no>54321</part_no>
<unit_price>10.2</unit_price>
<quantity>10</quantity>
<total_price>102</total_price>
</other_part_item>
<other_part_item>
<customer_claim_no>12345</customer_claim_no>
<part_no>98767</part_no>
<unit_price>20.2</unit_price>
<quantity>10</quantity>
<total_price>202</total_price>
</other_part_item>
</other_part>
</ROW>
</warranty_claim>
create or replace type ph_other_part as object(
customer_claim_no varchar2(100),
part_id number,
part_no varchar2(100),
description varchar2(100),
unit_price number,
quantity number,
total_price number,
part_failed varchar2(100))
create or replace type ph_othpart_tab as table of ph_other_part
create or replace view ph_wc_view
as select customer_claim_no,
claim_date,
repair_shop_site_name,
failed_part_no,
CAST(MULTISET(select customer_claim_no,
part_id,
part_no,
description,
unit_price,
quantity,
total_price,
part_failed
from ph_wc_part pwp
where pwp.customer_claim_no = pwc.customer_claim_no
) AS sys.ph_othpart_tab ) other_part
from ph_warranty_claim pwc
main script
declare
insCtx dbms_xmlsave.ctxType;
rowcount number:=0;
v_tablename varchar2(100):='ph_wc_view';
xmldoc clob;
errorNum number;
errorMsg varchar2(200);
begin
begin
select data
into xmldoc
from cic.cic_temp
where data_id = 2;
exception when others then
dbms_output.put_line('Error getting xmldoc. '||sqlerrm(sqlcode));
end;
insCtx := dbms_xmlsave.newcontext(v_tablename);
dbms_xmlsave.setIgnoreCase(insCtx,1);
dbms_xmlsave.clearupdatecolumnlist(insCtx);
dbms_xmlsave.setupdatecolumn(insCtx,'customer_claim_no');
dbms_xmlsave.setupdatecolumn(insCtx,'claim_date');
dbms_xmlsave.setupdatecolumn(insCtx,'repair_shop_site_name');
dbms_xmlsave.setupdatecolumn(insCtx,'failed_part_no');
dbms_xmlsave.setupdatecolumn(insCtx,'other_part');
rowcount := dbms_xmlsave.insertXML(insCtx,xmldoc);
dbms_xmlsave.closecontext(insCtx);
commit;
dbms_output.put_line('Rows inserted: '||rowcount);
end;Hi,
For your XML file I think you just need to enclose XML elemnts in ROWSET AND ROW TAGS - so xml should look like :
<ROWSET>
<ROW>
<DEPT>
</DEPT>
and just pass it as CLOB to dbms_xmlsave.insertXML proc.
I hope it should work.
I am also trying to insert XML file but with a bit complex structure having multiple nested elements.
I am not sure how to transform the external XML file to wrap it in ROWSET/ROW using XSLT. It's mandatory to use ROWSET/ROW tags to be able to insert in oracle tables. I am facing this problem right now. I am using object views to accomplish the purpose but still needs to figure out the way to apply stylesheet to incoming XML file.
If you come to know of any way, pls do let me know also.
Thanks -
Unable to start replicat process
Hi,
We have configured goldengate between two oracle system for uni directional replication, it's running for few hours after that in target side the replicat process is abended with below error message,
2012-08-02 10:12:07 WARNING OGG-01004 Aborted grouped transaction on 'ACCOUNT.ACCOUNT_STATS', Database error 1732 (OCI Error ORA-01732: data manipulation
operation not legal on this view (status = 1732). DELETE FROM "ACCOUNT"."ACCOUNT_STATS" WHERE "REP_NAME" = :b0 AND "DAILY" is NULL AND "WEEKLY"
is NULL AND "COUNT" is NULL AND "COUNT" = :b4 AND ROWNUM = 1).
i found some of the solution in google but no luck... there is a table name and MV in both the database , the name of the two objects are in same name. so i can't exclude the MV in replicat process.
SQL> select owner,object_name,object_type from all_objects where object_name ='RC_REPS_STATS';
OWNER OBJECT_NAME OBJECT_TYPE
ACCOUNT ACCOUNT_STATS TABLE
ACCOUNT ACCOUNT_STATS MATERIALIZED VIEW
also there is no constraint on that tables , Can any one help on this to resolve this issue?You're the victim of a bad database design. The application updating the same base tables would have the same problem but my guess is that only the target system has the materialized views. Regardless, a viable work around would be to create a "normal" view on the table with a unique name and then map to the new view.
Good luck,
-joe -
Error import in CI_PERSONAL_DATA
I am making an import of data to te PERSONAL_DATA component in Peoplesoft HCM 9.2 with CI_PERSONAL_DATA component interface, but I have this error:
Error Position: 12 Return: 1732 - ORA-01732: data manipulation operation not legal on this view
Failed SQL stmt: INSERT INTO PS_PERS_SRCH_GBL(OPRID,ROWSECCLASS,EMPLID,EMPL_RCD,NAME,NAME_DISPLAY_SRCH,NAME_PSFORMAT,LAST_NAME_SRCH,SECOND_LAST_SRCH,FIRST_NAME,LAST_NAME,SECOND_LAST_NAME,NAME_AC,MIDDLE_NAME,NAME_DISPLAY,PER_ORG,POI_TYPE,BUSINESS_UNIT,SETID_DEPT,DEPTID,SETID_LOCATION,LOCATION,COMPANY,REG_REGION,INSTITUTION,NATIONAL_ID,HR_STATUS,MILITARY_SERVICE,MIL_RANK,MIL_WORN_RANK,APPT_TYPE,EMPL_STATUS,OTHER_ID_JPN,FUTURE_FLG,REPORTS_TO,SUPERVISOR_ID,SETID_JOBCODE,JOBCODE) VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,:22,:23,:24,:25,:26,:27,:28,:29,:30,:31,:32,:33,:34,:35,:36,:37,:38)
In dev environment works fine, but I dont know why result this error in other environments.
Thanks in advance.I experienced weird behaviour with CI's w.r.t. PeopleCode execution and default values too.
If you're using a CI, all validations are executed on submitting it, so values are not necessarily the same in the CI fields as on screen. My guess is that the "FetchValue" you call, does not yet return the name you set, because it uses some obscure derived field that is populated on the page but not through your CI. -
Hi,
I read and work on the "BPEL with Reliable Processing" cookbook.
http://www.oracle.com/technology/pub/articles/bpel_cookbook/qualcomm-bpel.html
It's great!
I try to enhance the process by adding notion of priority between different records.
A priority-based process will favour those processes with high priority values.
To achieve that, I made the following modifications:
1) Add the "PRIORITY" column into the "DB_POLL_SOURCE" table.
CREATE TABLE "DB_POLL_SOURCE"
"ID" NUMBER (17,0) NOT NULL,
"VALUE1" VARCHAR2 (32),
"VALUE2" VARCHAR2 (32),
"VALUE3" VARCHAR2 (32),
"PROCESS_NOT_BEFORE" DATE,
"RETRY_COUNT" NUMBER (7,0) DEFAULT 0 NOT NULL,
"BPEL_STATE" VARCHAR2 (16) DEFAULT 'P_NEW',
"CREATED_DTS" DATE DEFAULT SYSDATE,
"MODIFIED_DTS" DATE DEFAULT SYSDATE,
"PRIORITY" NUMBER (7,0) DEFAULT 5 NOT NULL
2) Add an order by clause to sort the "PRIORITY" column in descending order.
3) Add the where clause (rownum<N) for getting the first N records from the query record set.
CREATE OR REPLACE VIEW DB_POLL_SOURCE_VW
(ID, BPEL_STATE)
AS
select *
from (
select
dbps.ID,
dbps.BPEL_STATE
from
DB_POLL_SOURCE dbps
where
(dbps.PROCESS_NOT_BEFORE is NULL or dbps.PROCESS_NOT_BEFORE < SYSDATE)
and dbps.BPEL_STATE like 'P_%'
order by dbps.PRIORITY desc
where rownum < 5
The problem is that the view must be updatable and ROWNUM cannot be used inside an updatable view.
The message error I got is the following:
ORA-01732: data manipulation operation not legal on this view.
So my question is:
How can I define an updatable view to sort the "PRIORITY" column and then limit the number of rows returned?
Thanks a lot
OlivierIf you want to update a view, you must use database triggers to perform this. You can user the statement:
CREATE OR REPLACE TRIGGER <triggername>
INSTEAD OF INSERT (or other UPDATE/DELETE or both)
ON <view>
FOR EACH ROW
BEGIN
.. PLSQL code here ..
END <triggername>;
/ -
Materialized Views from 9i to 10g
Hi All
I have read that Materialized views in oracle 9i or 10g does not differ alot and that in 10g the query_rewrite is compulsory... With this in mind I have done an import of full database from oracle 9i 9.2.0.1 to a database in 10g, 10.2.0.3. the import as such did not throw any messages..
however, when I tried to re-import data schema wise from user1 in 9i to user1 in 10g, all the materialised views are failing to import data.. with ora-01732 error message.. where an update/insert is not allowed on views.. however, I expected tht once the import is complete, I could quickly recompile the views .. and restore the data. But when I try doing it.. .these tables in 10.2.0.3 database do not show up as snapshot tables which they are in source 9i..
I tried to avoid importing these in my next attempt.. but no luck.. I am at the moment unsure if i am missing any thing on the target database which is 10g? Please advice.
SaratIt is the same user who is doing both import as well as export... I create a full schema dmp file from the exp utility in 9i.. which is later imported as the same user into the schema in 10g for the data refresh..
my exp and imp commands are as below..
exp u1/u1 file=D:\Database\u01.dmp buffer=200000 compress=Y grants=y log=D:\Database\u01-emp.log STATISTICS=NONE
imp file=e:\u01.dmp buffer=1073741824 statistics=none ignore=y resumable=y
when prompted, supply u01 login credentials..
the target machine has more cpu and ram and so the difference in buffer values..
on source oracle is 9.2.0.1 and on target it is 10.2.0.3. I did not set any value for query rewrite or any additional parameter in the target.. as I read it is by default true.
please advice.
sarat -
Materialized views on prebuilt tables - query rewrite
Hi Everyone,
I am currently counting on implementing the query rewrite functionality via materialized views to leverage existing aggregated tables.
Goal*: to use aggregate-awareness for our queries
How*: by creating views on existing aggregates loaded via ETL (+CREATE MATERIALIZED VIEW xxx on ON PREBUILT TABLE ENABLE QUERY REWRITE+)
Advantage*: leverage oracle functionalities + render logical model simpler (no aggregates)
Disadvantage*: existing ETL's need to be written as SQL in view creation statement --> aggregation rule exists twice (once on db, once in ETL)
Issue*: Certain ETL's are quite complex via lookups, functions, ... --> might create overy complex SQLs in view creation statements
My question: is there a way around the issue described? (I'm assuming the SQL in the view creation is necessary for oracle to know when an aggregate can be used)
Best practices & shared experiences are welcome as well of course
Kind regards,
Peterstreefpo wrote:
I'm still in the process of testing, but the drops should not be necessary.
Remember: The materialized view is nothing but a definition - the table itself continues to exist as before.
So as long as the definition doesn't change (added column, changed calculation, ...), the materialized view doesn't need to be re-created. (as the data is not maintained by Oracle)Thanks for reminding me but if you find a documented approach I will be waiting because this was the basis of my argument from the beginning.
SQL> select * from v$version ;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> desc employees
Name Null? Type
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
SQL> select count(*) from employees ;
COUNT(*)
107
SQL> create table mv_table nologging as select department_id, sum(salary) as totalsal from employees group by department_id ;
Table created.
SQL> desc mv_table
Name Null? Type
DEPARTMENT_ID NUMBER(4)
TOTALSAL NUMBER
SQL> select count(*) from mv_table ;
COUNT(*)
12
SQL> create materialized view mv_table on prebuilt table with reduced precision enable query rewrite as select department_id, sum(salary) as totalsal from employees group by department_id ;
Materialized view created.
SQL> select count(*) from mv_table ;
COUNT(*)
12
SQL> select object_name, object_type from user_objects where object_name = 'MV_TABLE' ;
OBJECT_NAME OBJECT_TYPE
MV_TABLE TABLE
MV_TABLE MATERIALIZED VIEW
SQL> insert into mv_table values (999, 100) ;
insert into mv_table values (999, 100)
ERROR at line 1:
ORA-01732: data manipulation operation not legal on this view
SQL> update mv_table set totalsal = totalsal * 1.1 where department_id = 10 ;
update mv_table set totalsal = totalsal * 1.1 where department_id = 10
ERROR at line 1:
ORA-01732: data manipulation operation not legal on this view
SQL> delete from mv_table where totalsal <= 10000 ;
delete from mv_table where totalsal <= 10000
ERROR at line 1:
ORA-01732: data manipulation operation not legal on this view While investigating for this thread I actually made my own question redundant as the answer became gradually clear:
When using complex ETL's, I just need to make sure the complexity is located in the ETL loading the detailed table, not the aggregate
I'll try to clarify through an example:
- A detailed Table DET_SALES exists with Sales per Day, Store & Product
- An aggregated table AGG_SALES_MM exists with Sales, SalesStore per Month, Store & Product
- An ETL exists to load AGG_SALES_MM where Sales = SUM(Sales) & SalesStore = (SUM(Sales) Across Store)
--> i.e. the SalesStore measure will be derived out of a lookup
- A (Prebuilt) Materialized View will exist with the same column definitions as the ETL
--> to allow query-rewrite to know when to access the table
My concern was how to include the SalesStore in the materialized view definition (--> complex SQL!)
--> I should actually include SalesStore in the DET_SALES table, thus:
- including the 'Across Store' function in the detailed ETL
- rendering my Aggregation ETL into a simple GROUP BY
- rendering my materialized view definition into a simple GROUP BY as wellNot sure how close your example is to your actual problem. Also don't know if you are doing an incremental/complete data load and the data volume.
But the "SalesStore = (SUM(Sales) Across Store)" can be derived from the aggregated MV using analytical function. One can just create a normal view on top of MV for querying. It is hard to believe that aggregating in detail table during ETL load is the best approach but what do I know? -
Update a table from a view (WITH)
Hello,
Is the below valid? Can I update table1 from table2 (view)?
Oracle is 9i
UPDATE
WITH t2 AS (
SELECT....................
SELECT t1.name n1, t2.name n2
FROM cell_info t1, t2
WHERE t1.cell = t2.cell
AND t1.name IS NULL
SET n1 = n2;
SQL Error: ORA-01732: data manipulation operation not legal on this view
01732. 00000 - "data manipulation operation not legal on this view"Hi,
there are cases where you can update an inline view :Scott@my10g SQL>create table t1 as select level id, chr(96+level) val
2 from dual
3 connect by level <= 6
4 /
Table created.
Scott@my10g SQL>create table t2 as select level id, cast(null as varchar2(30)) val
2 from dual
3 connect by level <= 6
4 /
Table created.
Scott@my10g SQL>alter table t1 add constraint t1_pk primary key (id);
Table altered.
Scott@my10g SQL>alter table t2 add constraint t2_pk primary key (id);
Table altered.
Scott@my10g SQL>select * from t1;
ID VAL
1 a
2 b
3 c
4 d
5 e
6 f
6 rows selected.
Scott@my10g SQL>select * from t2;
ID VAL
1
2
3
4
5
6
6 rows selected.
Scott@my10g SQL>update (
2 select t1.id, t1.val t1val, t2.val t2val
3 from t1
4 join t2
5 on t1.id=t2.id
6 )
7 set t2val=t1val
8 /
6 rows updated.
Scott@my10g SQL>select * from t2;
ID VAL
1 a
2 b
3 c
4 d
5 e
6 f
6 rows selected.
Maybe you are looking for
-
Is it possible to make "Payment Term" field display only for Transaction code f-43 and FB60 ?
-
Can I open Premier CS6 file created on PC, in CS5 on Mac
I am working on a video simultaneously with another editor, the idea is that we both edit and both projects should hopefully be vastly different and then once complete to make a master project and take the best cuts of both projects. Initially we we
-
Hello, I'm having issues reading and plotting my F32 file in Labview. I followed the example labview offers, and followed the method of another forum post, but both ways give me nonsense answers. Can someone help me? Thanks in advance!
-
Spry Blind Effect - Initial state closed
Hi, I was wondering if its possible to have the Blind effect, set to be closed initially and then "Blind down"? I've tried setting the "Blind from" fields but it doesn't seem to work. The div container is always open initially then toggles up and d
-
JTabbedPane tab alignment top - right hand side
Hi all, On a JTabbedPane, I would like to force the tab alignment on the top right or left hand side. This is because on a mac the default alignment is centered. So I would like to force the alignment on top - right or top - left, which one ever come