SQL error: ORA-01779: cannot modify a column that matches a key examine
Hi allThe requirement is that I have two tables s_party_d and S_CONTACT_d. the need to update the column name with FST_NAME | ',' | Last_name when column rowid in both tables are equal. I used the query previously below: -.
Update
(select
E1. Name,
e.FST_NAME,
Select
Of
s_party_d e1,
E S_CONTACT_d
where
E1. Game of ROW_ID = e.ROW_ID)
name = FST_NAME | ',' | LAST_NAME;
But I get the error message when executing the query
Error in the command line: 31 column: 3
Error report:
SQL error: ORA-01779: cannot modify a column that is mapped to a table not preserved key
01779 00000 - 'impossible to change a column that is mapped to a non-preserved table at key'
* Cause: An attempt was made to insert or update columns in a join finds out who
map to a table not kept the key.
* Action: Change the directly underlying base tables.
Can U please tell me why this error and how to solve?
Thank you
Mathon
Mathon wrote:
So, I have to look into some other method... I can't achieve this using a single update statement...
Well, no matter what you do you need to decide what FST_NAME | ',' | Name to use. As I already pointed out for each line of the line of the s_party_d table there are several rows in table S_CONTACT_d. Again, you must yo decide what S_CONTACT_d table row you want to use. For example:
update s_party_d e1
set e1.name = (
select max(e.FST_NAME) ||', '|| max(e.LAST_NAME)
from S_CONTACT_d e
where e1.ROW_ID=e.ROW_ID
)
where e1.ROW_ID in (
select e.ROW_ID
from S_CONTACT_d e
)
/
SY.
Tags: Database
Similar Questions
-
ORA-01779: cannot modify a column that is mapped to a table not preserved key
Hello
I'm doing update join with the type of activity of lag on my 10.2.0.3
Here's a simple test case:
Problem with tgt.id2 + 1, but I need that in my logic, so how do I get around this?create table test1 (id1 number, id2 number, before varchar2(10), after varchar2(10)); alter table test1 add constraint pk1 primary key (id1, id2); SQL> insert into test1 values(1,1 , 'a','b'); 1 row created. SQL> insert into test1 values(1,2 , 'b','c'); 1 row created. SQL> commit; select * from test1; ID1 ID2 BEFORE AFTER ----- ---------- ---------- ---------- 1 1 a b 1 2 b c update (select src.before src_before, tgt.before tgt_before from test1 src , test1 tgt where src.id1 = tgt.id1 and src.id2 = tgt.id2 + 1 ) set tgt_before = src_before / set tgt_before = src_before * ERROR at line 2: ORA-01779: cannot modify a column which maps to a non key-preserved table
Concerning
GregG
Published by: 3 Sep 2012 GregG 13:23
removed and src.id2 = 1
Published by: 3 Sep 2012 GregG 13:31
Corrected as pointed by DomHave you tried something like this:
UPDATE test1 a SET a.before = (SELECT b.before FROM test1 b WHERE b.id1 = a.id1 AND b.id2 = a.id2 - 1) WHERE EXISTS (SELECT 1 FROM test1 c WHERE c.id1 = a.id1 AND c.id2 = a.id2 - 1)
-
Cannot modify a column that is mapped to a table not preserved key
I use Oracle 12 c.
I get this error in updating the column in a TWG.
Scripts to create the TWG, TABLE & Qry Oracle is provided below.
GLOBAL TEMPORARY TABLE
GLOBAL TEMPORARY TABLE
CREATE GLOBAL TEMPORARY TABLE ROAD ( SNO NUMBER(5, 0) , ROADID NUMBER(5, 0) NOT NULL , ROADNAME VARCHAR2(50 CHAR) , ROADSC VARCHAR2(10 CHAR) , SUBAREAID NUMBER(5, 0) , AREAID NUMBER(5, 0) , SEQNO NUMBER(5, 0) , SEQNOCUR NUMBER(5, 0) , ADDEDIT VARCHAR2(1 BYTE) , ISBULK NUMBER(1, 0) , ROWNO NUMBER(5, 0) , ERROR VARCHAR2(200 BYTE) , COMPID NUMBER(5, 0) , CONSTRAINT ROAD_PK PRIMARY KEY ( ROADID ) USING INDEX ( CREATE UNIQUE INDEX ROAD_PK ON ROAD (ROADID ASC) NOPARALLEL ) ENABLE ) ON COMMIT DELETE ROWS;
TABLE MROAD
CREATE TABLE MROAD ( ROADID NUMBER(10, 0) NOT NULL , ROADNAME VARCHAR2(50 CHAR) , SUBAREAID NUMBER(10, 0) , AREAID NUMBER(10, 0) , SEQNO NUMBER(10, 0) , ROADSC VARCHAR2(10 CHAR) , COMPID NUMBER(10, 0) , CONSTRAINT MROAD_PK PRIMARY KEY ( ROADID ));
CREATE PROCEDURE
PROCEDURE ROAD_SAVE_NEW( v_Data XMLTYPE DEFAULT NULL) IS v_CompID NUMBER(5):= 0; rc sys_refcursor; BEGIN INSERT INTO Road ( SNO , ROADID , ROADNAME , ROADSC , SUBAREAID , AREAID , SEQNO , SEQNOCUR , ADDEDIT , ISBULK , COMPID ) SELECT Row_Number() OVER(ORDER BY 1) SNo , XT.* , v_CompID FROM XMLTABLE('/QueryParam/RoadXML/Road' PASSING v_SPParamList COLUMNS "RoadID" NUMBER(5) PATH 'RoadID', "RoadName" VARCHAR2(50) PATH 'RoadName', "RoadSC" VARCHAR2(10) PATH 'RoadSC', "SubAreaID" NUMBER(5) PATH 'SubAreaID', "AreaID" NUMBER(5) PATH 'AreaID', "SeqNo" NUMBER(5) Path 'SeqNo', "SeqNoCur" NUMBER(5) Path 'SeqNoCur', "AddEdit" VARCHAR2(1) PATH 'AddEdit', "IsBulk" NUMBER(1) PATH 'IsBulk') XT; UPDATE (SELECT B.ERROR ERROR_0 FROM MROAD A INNER JOIN Road B ON A.RoadID != B.RoadID AND A.RoadSC = B.RoadSC AND A.RoadSc != '' ) SET ERROR_0 = 'R114|Short Code Already Exist'; END ROAD_SAVE_NEW;
APPEAL PROCEDURE
DECLARE xmlData XMLTYPE := XMLTYPE('<QueryParam> <RoadXML> <Road> <RoadID>0</RoadID> <AreaID>94</AreaID> <SubAreaID>3</SubAreaID> <RoadSC><![CDATA[SP]]></RoadSC> <RoadName><![CDATA[6th A Road]]></RoadName> <SeqNo>0</SeqNo> <SeqNoCur>0</SeqNoCur> <IsBulk>true</IsBulk> <AddEdit>A</AddEdit> </Road> <Road> <RoadID>0</RoadID> <AreaID>94</AreaID> <SubAreaID>3</SubAreaID> <RoadSC><![CDATA[RR]]></RoadSC> <RoadName><![CDATA[Sojati Gate Bari]]></RoadName> <SeqNo>0</SeqNo> <SeqNoCur>0</SeqNoCur> <IsBulk>true</IsBulk> <AddEdit>A</AddEdit> </Road> <Road> <RoadID>0</RoadID> <AreaID>94</AreaID> <SubAreaID>3</SubAreaID> <RoadSC><![CDATA[CR]]></RoadSC> <RoadName><![CDATA[6th A Road]]></RoadName> <SeqNo>0</SeqNo> <SeqNoCur>0</SeqNoCur> <IsBulk>true</IsBulk> <AddEdit>A</AddEdit> </Road> <Road> <RoadID>0</RoadID> <AreaID>94</AreaID> <SubAreaID>3</SubAreaID> <RoadSC><![CDATA[TR]]></RoadSC> <RoadName><![CDATA[TripoliyaRoad]]></RoadName> <SeqNo>0</SeqNo> <SeqNoCur>0</SeqNoCur> <IsBulk>true</IsBulk> <AddEdit>A</AddEdit> </Road> </RoadXML> </QueryParam>'); BEGIN ROAD_SAVE_NEW( v_Data => xmlData ); END;
I Know Oracle applies UJVC on update on view joined queries.
This is the result I get in mssql
How do I do this in Oracle.
Found the answer:
CREATE OR REPLACE PROCEDURE proc_RoadSave AS xmlData XMLTYPE := XMLTYPE.CreateXML( '<QueryParam> <RoadXML> <Road> <RoadID>0</RoadID> <AreaID>94</AreaID> <SubAreaID>3</SubAreaID> <RoadSC><![CDATA[SP]]></RoadSC> <RoadName><![CDATA[6th A Road]]></RoadName> <SeqNo>0</SeqNo> <SeqNoCur>0</SeqNoCur> <IsBulk>1</IsBulk> <AddEdit>A</AddEdit> </Road> <Road> <RoadID>0</RoadID> <AreaID>94</AreaID> <SubAreaID>3</SubAreaID> <RoadSC><![CDATA[RR]]></RoadSC> <RoadName><![CDATA[Sojati Gate Bari]]></RoadName> <SeqNo>0</SeqNo> <SeqNoCur>0</SeqNoCur> <IsBulk>1</IsBulk> <AddEdit>A</AddEdit> </Road> <Road> <RoadID>0</RoadID> <AreaID>94</AreaID> <SubAreaID>3</SubAreaID> <RoadSC><![CDATA[CR]]></RoadSC> <RoadName><![CDATA[6th A Road]]></RoadName> <SeqNo>0</SeqNo> <SeqNoCur>0</SeqNoCur> <IsBulk>1</IsBulk> <AddEdit>A</AddEdit> </Road> <Road> <RoadID>0</RoadID> <AreaID>94</AreaID> <SubAreaID>3</SubAreaID> <RoadSC><![CDATA[TR]]></RoadSC> <RoadName><![CDATA[TripoliyaRoad]]></RoadName> <SeqNo>0</SeqNo> <SeqNoCur>0</SeqNoCur> <IsBulk>1</IsBulk> <AddEdit>A</AddEdit> </Road> </RoadXML> </QueryParam>' ); rc sys_refcursor; BEGIN execute immediate 'truncate table GTT.Road'; INSERT INTO GTT.Road ( SNO , ROADID , ROADNAME , ROADSC , SUBAREAID , AREAID , SEQNO , SEQNOCUR , ADDEDIT , ISBULK , ROWNO , ERROR , COMPID ) SELECT row_number() OVER(ORDER BY 1) Sno , XT.RoadID , XT.RoadName , XT.RoadSC , XT.SubAreaID , XT.AreaID , XT.SeqNo , XT.SeqNoCur , XT.AddEdit , XT.IsBulk , CAST(0 AS NUMBER(5)) ROWNO , CASE WHEN mRoad.RoadID IS NOT NULL THEN CASE WHEN XT.RoadSC = mRoad.RoadSC AND XT.RoadName = mRoad.RoadName THEN 'XXX' WHEN XT.RoadSC = mRoad.RoadSC THEN 'R114|Short Code Already Exist' WHEN XT.RoadName = mRoad.RoadName THEN ',R104|Entry Already Exist' END ELSE NULL END ERROR ,CAST(0 AS NUMBER(10)) COMPID FROM XMLTABLE('/QueryParam/RoadXML/Road' PASSING xmlData COLUMNS RoadID NUMBER(10) PATH 'RoadID', RoadName VARCHAR2(50 CHAR) PATH 'RoadName', SubAreaID NUMBER(10) PATH 'SubAreaID', AreaID NUMBER(10) PATH 'AreaID', SeqNo NUMBER(10) PATH 'SeqNo', RoadSC VARCHAR2(10 CHAR) PATH 'RoadSC', SeqNoCur NUMBER(5) PATH 'SeqNoCur', AddEdit VARCHAR2(1 CHAR) PATH 'AddEdit', IsBulk NUMBER(1) PATH 'IsBulk') XT LEFT JOIN mRoad ON XT.RoadID != mRoad.RoadID AND (XT.RoadSC = mRoad.RoadSC OR XT.RoadName = mRoad.RoadName) AND XT.RoadSC IS NOT NULL; OPEN rc FOR SELECT * FROM GTT.Road Where Error IS NULL; sys.dbms_sql.return_result(rc,TRUE); OPEN rc FOR SELECT * FROM GTT.Road WHERE ERROR IS NOT NULL; sys.dbms_sql.return_result(rc,TRUE); END proc_RoadSave;
Post edited by: Sunil K. I found my answer it is also what I did to solve the problem.
I found my answer, you can see the end of the question where I put the solution.
Thank you everyone who helped or at least tried to help.
Kind regards.
-
Gets the error ORA-01779 after I added the column
Hi, I'm a total newbie in APEX but collaborated with ordinary development Oracle (tables, views, packages, triggers, etc) for a number of years.
I ve been assigned in order to respect an existing application to APEX. One task is to add a column to a single character named 'ACTIVE' to a database table and also present on a current project list page. The value can be 'Y' or 'n'. In the view which is the source of data for the project page ad 'Y' turned into 'Yes' and 'n' turned into 'no '. So far so good, everything works well.
There is another page on which it is possible to create new or modify existing projects. This page uses a view as a source of data. On this page, I added a group of radiobutton that contains two options: 'Yes' and 'no '. When I select to edit a project in the project list page the second page is loaded and the correct option, 'yes' or 'No', is marked on the page. This group of radiobutton works exactly like a couple of other groups of radiobutton also represented with a single character column in the database. So far so good!
However, when I try to save the project file by clicking on "Apply Changes" I get this error:
ORA-20001: DML error: p_rowid = 50, ID = p_alt_rowid, p_rowid2 =, p_alt_rowid2 is. ORA-01779: cannot modify a column that is mapped to a table not preserved key
What is the problem here? The new 'ACTIVE' column is added to the view, when I run the view I Don t get all records in duplicate, the underlying table has a column id as the primary key.
Since I Don t know that APEX is under the hood it s hard tp what's wrong. Anyone knows the solution to this problem?
/ MagnusHello Magnus,
Is there an INSTEAD OF trigger defined on the view? Have you added the new column ACTIVE there too?
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this response in marking it as useful or Correct ;-) -
Error ORA-01779: table preserved key not on update
Hello.
I'm doing this update:
What I get is:UPDATE ( SELECT aux.o_customer AS a1, REGEXP_REPLACE(kna.kunnr,'^0*','') AS a2 FROM payer_catalog cli, customer_master_cat kna, aux_customer aux WHERE aux.o_customer = cli.cte_num AND cli.cte_num = kna.cte_num ) SET a1 = a2;
ERROR at line 1:
ORA-01779: cannot modify a column that is mapped to a table not preserved key >
I have read on the key preserved table, but I'm going through a difficult time. Given that I did not understand the concept. Your help is greatly appreciated, so I can understand the question.
It's the table create:
And some inserts:CREATE TABLE AUX_CUSTOMER ( KEY_GUIDE VARCHAR2(30 CHAR), O_CUSTOMER VARCHAR2(10 CHAR), O_NAME VARCHAR2(80 CHAR) ); CREATE TABLE CUSTOMER_MASTER_CAT ( KUNNR VARCHAR2(10 BYTE), NAME1 VARCHAR2(100 BYTE), NAME2 VARCHAR2(100 BYTE), CTE_NUM VARCHAR2(10 BYTE) ) ; CREATE TABLE PAYER_CATALOG ( CTE_NUM VARCHAR2(10 BYTE), PAYER VARCHAR2(100 BYTE) );
This are not the tables I have created, I just checked the information.Insert into AUX_CUSTOMER (KEY_GUIDE,O_CUSTOMER,O_NAME) values ('171109366944 23/01/12','N001210514',null); Insert into AUX_CUSTOMER (KEY_GUIDE,O_CUSTOMER,O_NAME) values ('005107145536 23/01/12','N001210600',null); Insert into AUX_CUSTOMER (KEY_GUIDE,O_CUSTOMER,O_NAME) values ('666318008569 23/01/12','0000104574',null); Insert into AUX_CUSTOMER (KEY_GUIDE,O_CUSTOMER,O_NAME) values ('043188136629 23/01/12','N001210514',null); INSERT INTO CUSTOMER_MASTER_CAT (KUNNR,NAME1,NAME2,CTE_NUM) VALUES ('0000008147','HONDA MOTOR','COMPANY LTD','N001210514'); Insert into CUSTOMER_MASTER_CAT (KUNNR,NAME1,NAME2,CTE_NUM) values ('0000009559','APPLE','INC','N001210515'); Insert into CUSTOMER_MASTER_CAT (KUNNR,NAME1,NAME2,CTE_NUM) values ('0000104574','SAMSUNG ELECTRONICS ','INC',null); Insert into PAYER_CATALOG (CTE_NUM,PAYER) values ('N001210514','HONDA'); Insert into PAYER_CATALOG (CTE_NUM,PAYER) values ('N001210515','EXTERNAL CUSTOMER'); Insert into PAYER_CATALOG (CTE_NUM,PAYER) values ('N001210516','CELLULAR COMPANY');
Kind regards.Hello
If it is not clear how to do an UPDATE, there is a good chance that the UPDATE is not the right tool for the job.
Try instead MERGER.MERGE INTO aux_customer dst USING ( SELECT aux.key_guide , MIN ( REGEXP_REPLACE ( kna.kunnr , '^0*' ) ) AS a2 FROM payer_catalog cli , customer_master_cat kna , aux_customer aux WHERE aux.o_customer = cli.cte_num AND cli.cte_num = kna.cte_num GROUP BY aux.key_guide ) src ON (dst.key_guide = src.key_guide) WHEN MATCHED THEN UPDATE SET dst.o_customer = src.a2 ;
What are the results you want from the given sample data?
The MERGE statement above let aux_customer that looks like this:KEY_GUIDE O_CUSTOMER O_NAME ------------------------------ ---------- ---------- 005107145536 23/01/12 N001210600 043188136629 23/01/12 8147 171109366944 23/01/12 8147 666318008569 23/01/12 0000104574
Whether you use the FUSION or the UPDATE, if you update the actual table or view online, please make sure that the query that produces the new product (at most) one value of 1 line for each line in the table updated.
-
Hi all
your help is greatly appreciated...
Calling B.fucntion inside an A.fonctions to insert data into a table.
Here when you call the B.fucntion to insert data in the table... receiver AM a mistakeOmitted in B - SQL Error: ORA-14551: cannot perform a DML operation inside a query...
Can someone please help me to clarify this...
The FUNCTION A(varUPD_TYPE IN VARCHAR2) RETURN VARCHAR2 IS
varRETURN_VALUE VARCHAR2 (25): = NULL;numALLOWED_COUNT PROD. PROCESS_COUNTER. TYPE % ALLOWED_COUNT;
numLAST_COUNT_ADDED PROD. PROCESS_COUNTER. TYPE % LAST_COUNT_ADDED;
dtCHANGE_DATE DATE: = NULL;
varSTMT VARCHAR2 (2000);
bln_Allowed BOOLEAN;
myVar VARCHAR2 (32767).
BEGINIF varUPD_TYPE = "A" THEN
BEGIN
SELECT CH_DATE, LAST_COUNT_ADDED, ALLOWED_COUNT
IN dtCH_DATE, numLAST_COUNT_ADDED, numALLOWED_COUNT
PROD. PROCESS_COUNTER
WHERE NOM_PROCESSUS = "DAILY".
AND COUNTER_IND = A 'IF dtCH_DATE < = trunc (sysdate) THEN
numLAST_COUNT_ADDED: = 0;
END IF;EXCEPTION
WHILE OTHERS THEN
numLAST_COUNT_ADDED: = 0;
numALLOWED_COUNT: = 1;
END;
IF numALLOWED_COUNT > = numLAST_COUNT_ADDED + 1 THEN
bln_Allowed: = True;
varSTMT: = "UPDATE PROD. TMS_PROCESS_COUNTER ';
varSTMT: = varSTMT | ' SET last_count_added = ' | (numLAST_COUNT_ADDED + 1);
varSTMT: = varSTMT | "WHERE nom_processus =" DAILY "';
varSTMT: = varSTMT | "AND COUNTER_IND ="D"';
IF varSTMT IS NOT NULL
THEN
MyVar: = B(96,varSTMT);
PROC_LOG (' CALL B ': myVar);
IF myvar > 0 THEN
NULL;
END IF;
END IF;
On the other
End if;END IF;
EXCEPTION WHEN OTHERS THEN
PROC_LOG ("A failed '");
PROC_LOG (' SQL error: ' |) SUBSTR (SQLERRM, 1, 1000));
RETURNS A NULL VALUE.
PUT AN END TO;The FUNCTION B(numTABLE_ID IN NUMBER, varSQL_STATEMENT IN VARCHAR2) RETURNS NUMBER IS
varINSERT_BATCH_STMT VARCHAR2 (32767): = NULL;
varADD_REC_TYPE BATCH_TABLES. TYPE % ADD_REC_TYPE;BEGIN
INSERT INTO BATCH_STATEMENT (ID, TABLE_ID, STATEMENT, QUEUE_SEQUENCE_ID)
VALUES (Numidian, numTABLE_ID, varSQL_STATEMENT, 1);EXCEPTION WHEN OTHERS THEN
PROC_LOG ('B failed');
PROC_LOG (' SQL error: ' |) SUBSTR (SQLERRM, 1, 1000));
RETURNS - 1;
END B;
Structure of the Batch_statement table:
ID Number (15) not null
number (2) not null table_id
Statement varchar2 (4000) not null
Queue_sequence_id number (5) not nullWhy do you do such coding mess full of bad practices.
Remove the exceptions WHEN OTHERS, you're a turing a mistake in this way, they are bugs and (never) use functions to perform DML.
Functions are not intended for DML. Period.
-
Get an error SQL Error: ORA-01407:
Hi all
When iam trying to remove some rows from a table, iam getting the following error:
Error from the 1 in the command line:
delete from cu_cdm_svc_job_STEP where SVC_JOB_KEY = 292
Error report:
SQL error: ORA-01407: cannot update ("FACETS_CUSTOM". "" "" CDM_SVC_JOB_STEP '. "" SVC_JOB_KEY') with the NULL value
01407 00000 - "can not update (%s) null.
* Cause:
* Action:
Kindly help. Thanks in advance.Hello and welcome!
You have foreign keys hanging out, doing so ON DELETE SET NULL?
-
SQL error: ORA-31038: invalid number '420,05' when extracting data from XML
Hello everyone ,
J’ai créé dietingDBMS_XMLSCHEMA. REGISTERSCHEMA (SCHEMAURL = > 'OrdenDetalle.xsd', SCHEMADOC = > ' <? xml version = "1.0" encoding = "UTF?) 8 "? >
" < xs: schema xmlns: XS =" http://www.w3.org/2001/XMLSchema ">
< xs: element name = "Monsigniore" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "Quantity" type = "Integer" / >
< xs: element name = "FechaCreacion" type = "xs: DateTime" / >
< xs: element name = "Version" type = "xs: String" / >
< xs: ELEMENT ref = "News" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< xs: element name = "News" >
< xs: complexType >
< xs: Choice >
< xs: element name = "OrdenCompra" type = "T_OrdenCompra" / >
< / xs: Choice >
< / xs: complexType >
< / xs: element >
< name XS: complexType = "T_OrdenCompra" >
< xs: SEQUENCE >
< xs: element name = "Code" type = "xs: String" / >
< xs: element name = "Number" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoEstado" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoLicitacion" type = "xs: String" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Description" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoTipo" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Type" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TipoMoneda" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "State" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoEstadoProveedor" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "EstadoProveedor" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: ELEMENT ref = "Fechas" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TieneItems" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "PromedioCalificacion" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CantidadEvaluacion" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Well" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Freighters" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TotalNeto" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "PorcentajeIva" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Impuestos" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Total" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Financing" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Country" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TipoDespacho" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FormaPago" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: ELEMENT ref = "Comprador" minOccurs = "0" maxOccurs = "1" / >
< xs: ELEMENT ref = "Proveedor" minOccurs = "0" maxOccurs = "1" / >
< xs: ELEMENT ref = "Items" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< xs: element name = "Items" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "Quantity" type = "Integer" / >
< xs: element name = "News" >
< xs: complexType >
< xs: SEQUENCE >
< xs: ELEMENT ref = "Item" minOccurs = "0" maxOccurs = "unbounded" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< name XS: complexType = "OrdenCompraBusqueda" >
< xs:complexContent >
< xs:extension base = "T_OrdenCompra" >
< / xs:extension >
< / xs:complexContent >
< / xs: complexType >
< xs: element name = "Item" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "Correlativo" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoCategoria" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Category" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoProducto" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Product" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "EspecificacionComprador" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "EspecificacionProveedor" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Quantity" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Moneda" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
"< xs: element name ="PrecioNeto"type ="XS: Decimal"minOccurs ="0"maxOccurs ="1"/ >
< xs: element name = "TotalCargos" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TotalDescuentos" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TotalImpuestos" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Total" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< xs: element name = "Fechas" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "FechaCreacion" type = "xs: DateTime" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FechaEnvio" type = xs: DateTime "" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FechaAceptacion" type = xs: DateTime "" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FechaCancelacion" type = xs: DateTime "" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FechaUltimaModificacion" type = xs: DateTime "" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< xs: element name = "Comprador" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "CodigoOrganismo" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreOrganismo" type = "xs: String" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "RutUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoUnidad" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Activity" type = "xs: String" nillable = "true" / >
< xs: element name = "DireccionUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "ComunaUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "RegionUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Country" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CargoContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FonoContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "MailContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< xs: element name = "Proveedor" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "Code" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Number" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Activity" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoSucursal" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreSucursal" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "RutSucursal" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Address" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Comuna" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Region" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Country" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CargoContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FonoContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "MailContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< / xs: Schema >
', LOCAL = > true, GENTYPES = > false, GENBEAN = > false, GENTABLES = > false,
FORCE = > false, OPTIONS = > DBMS_XMLSCHEMA. REGISTER_BINARYXML, OWNER = > USER);
I have a table with one xml domain.
CREATE TABLE XML_Orden_Detalle (Fecha_GET date default current_date not null,
Fecha_Ordenes number not null,
Correlativo_Ordenes number not null,
Codigo_Orden varchar2 (20) not not null primary key,
Cant_Item,
Date of InicioProceso,
Date of FinProceso,
Xmltype Orden_Detalle not null)
Orden_Detalle XMLTYPE COLUMN
STORE AS BINARY XML
XMLSCHEMA " " http://xmlns.Oracle.com/xdb/schemas/CCS_XML/OrdenDetalle.xsd "" "
ELEMENT "command";
I inserted data like that, without any Errors:" < Command containing = ' http://www.w3.org/2001/XMLSchema "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance ">
< Number > 1 < / quantity >
< FechaCreacion > 2015-05-28T 12: 10:26.947000 < / FechaCreacion >
v1 < version > < / Version >
< Return >
< OrdenCompra xsi: type = "OrdenCompraBusqueda" >
3879-2661-SE14 < code > < / code >
< Number > PSP DAEM 2014. COFFEE BREAK PARA FRINGE OP21838 < / number >
< CodigoEstado > 6 < / CodigoEstado >
3902 5-on 14 < CodigoLicitacion > < / CodigoLicitacion >
< Description > PSP DAEM 2014. COFFEE BREAK PARA FRINGE OP21838 < / description >
< CodigoTipo > 8 < / CodigoTipo >
< Type > SE < / Type >
< TipoMoneda > CLP < / TipoMoneda >
Is < State > < / Estado >
< CodigoEstadoProveedor > 4 < / CodigoEstadoProveedor >
Is < EstadoProveedor > < / EstadoProveedor >
< Fechas >
< FechaCreacion > 2014-12-29T 17: 43:32.287000 < / FechaCreacion >
< FechaEnvio > 2014-12-31T 10: 32:35.480000 < / FechaEnvio >
< FechaAceptacion > 2015 - 01-01 T 21: 03:03.660000 < / FechaAceptacion >
< FechaCancelacion xsi: Nil = "true" / >
< FechaUltimaModificacion > 2014-12-29T 17: 51:00.000000 < / FechaUltimaModificacion >
< / Fechas >
< TieneItems > 1 < / TieneItems >
< PromedioCalificacion > 5 < / PromedioCalificacion >
< CantidadEvaluacion > 1 < / CantidadEvaluacion >
< Well > 0 < / well >
cargo <>0 < / cargo >
< TotalNeto > 53782 < / TotalNeto >
< PorcentajeIva > 19 < / PorcentajeIva >
< Impuestos > 10218 < / Impuestos >
< total > 64000 < / Total >
< Financing > 1140569 < / financing >
< Country > CL < / Pais >
< TipoDespacho > 12 < / TipoDespacho >
< FormaPago > 2 < / FormaPago >
< comprador >
< CodigoOrganismo > 118069 < / CodigoOrganismo >
< NombreOrganismo > Ilustre municipalidad of Bulnes < / NombreOrganismo >
< RutUnidad > 69.141.200 - 8 < / RutUnidad >
< CodigoUnidad > 4799 < / CodigoUnidad >
Daem < NombreUnidad > < / NombreUnidad >
< Actividad / >
< DireccionUnidad > VICTOR BIANCHI Nº415 < / DireccionUnidad >
Bulnes < ComunaUnidad > < / ComunaUnidad >
< RegionUnidad > Region del Biobio < / RegionUnidad >
< Country > CL < / Pais >
Antonella Brunetti < NombreContacto > < / NombreContacto >
Adquisiciones < CargoContacto > < / CargoContacto >
< FonoContacto > 56-42-2204053-2204054 < / FonoContacto >
< MailContacto > [email protected] < / MailContacto >
< / comprador >
< Proveedor >
< Code > 275020 < / code >
Luis < number > < / number >
< Activity > MANUFACTURING OF PAN, BLOCK PANADERIA Y PRODUCTOS < / activity >
< CodigoSucursal > 280820 < / CodigoSucursal >
Luis < NombreSucursal > < / NombreSucursal >
< RutSucursal > 5.940.940 - 9 < / RutSucursal >
< Address > Carlos Palacios 125 < / address >
Bulnes < Comuna > < / Comuna >
Region del Biobio < region > < / region >
< Country > CL < / Pais >
< NombreContacto > Luis Leonardo Valdés Landero < / NombreContacto >
Gerente < CargoContacto > < / CargoContacto >
< FonoContacto > (56) (42) 631498 < /FonoContacto >
< MailContacto > [email protected] < / MailContacto >
< / Proveedor >
elements <>
< Quantity > 7 < / quantity >
< Return >
< item >
< Correlativo > 1 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > 3 LITROS BEBIDAS < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 10 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 1550 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 15500 < / Total >
< / point >
< item >
< Correlativo > 2 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > DEEMED OF 1 1/2 LITYROS < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 10 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 1150 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 11500 < / Total >
< / point >
< item >
< Correlativo > 3 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > PACKAGES SERVILLETAS < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 8 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 170 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 1360 < / Total >
< / point >
< item >
< Correlativo > 4 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > pounds OF AZÚCAR < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 5 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 580 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 2900 < / Total >
< / point >
< item >
< Correlativo > 5 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > NESCAFE < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 2 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 3900 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 7800 < / Total >
< / point >
< item >
< Correlativo > 6 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > CAJAS OF TE 20 BOWL < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 5 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 340 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 1700 < / Total >
< / point >
< item >
< Correlativo > 7 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
TRITON GALLETAS < EspecificacionComprador > < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 31 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto >420,05< / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 13021,550000000001 < / Total >
< / point >
< / News >
< / object >
< / OrdenCompra >
< / News >
< / Monsigniore >
However when I extract data, for example:
Select *.
from xmltable (to_char (' / Monsigniore/news/OrdenCompra/Items/News/Item[1] ''))
passage (select Orden_Detalle
of xml_Orden_Detalle
where Fecha_Ordenes = 20150101 and Correlativo_ordenes = 83)
path of columns Correlativo varchar2 (15) 'Correlativo '.
, Path of varchar2 (15) CodigoCategoria 'CodigoCategoria '.
, Path Categoria Varchar2 (100 CHAR) "category.
, Path of varchar2 (15) CodigoProducto 'CodigoProducto '.
, Path of Producto Varchar2 (100 CHAR) 'product '.
, Path of the EspecificacionComprador Varchar2 (100 CHAR) "EspecificacionComprador".
, Path of the EspecificacionProveedor Varchar2 (100 CHAR) "EspecificacionProveedor".
, Amount varchar2 (15) path 'amount '.
, Path of the Moneda Varchar2 (16 CHAR) "Moneda".
, Path of varchar2 (15) PrecioNeto 'PrecioNeto '.
, Path of varchar2 (15) TotalCargos 'TotalCargos '.
, Path of varchar2 (15) TotalDescuentos 'TotalDescuentos '.
, Path of varchar2 (15) TotalImpuestos 'TotalImpuestos '.
, Path of varchar2 (15) total 'Total '.
);
delivery the following error:
Informed of error:
SQL error: ORA-31038: Valor number no valido: "420,05."
«31038 00000 - "value not valid %s: \"%s\»»
* Cause: The text in the XML document does not represent a valid
value given the data type and other constraints in the schema.
* Action: Make sure the value specified in the XML documents is valid
regarding the data type and other constraints in the schema.
Note that extract le agenda [1] but the reported error is à la point [7]
Please If anyone can Help me with le solution for no report error
Thank you very much in advanceCarlosin Chile, the decimal point are ', 'no'.', the xml data table is OK for us
You do not understand.
Regardless of the locale, numeric values limited by a type of data XS: Decimal must use a point in a correct XML representation, otherwise, the document is not valid by the XSD.
(3) TO_CHAR (...) the code is part of a procedure
Again, do NOT build a dynamic path like that.
Why not just move through the records returned by the query (if you need close at all)?
FOR rec in)
SELECT x.*
From your_table t
XMLTABLE (...) x
)
LOOP
END LOOP;
What is the role of the v_CantItems variable? Paging?
Whence its value?
-
SQL error: ORA-00979: not a GROUP BY
Hi team,
I am trying to execute the query
SELECT DISTINCT comp.company_name |' -' || COMP.contract_number AS 'company_name '.
, UPPER (bh.first_name) AS 'budget_holder '.
, INITCAP (sup.first_name) |' -' || SUP. Surname AS 'supervisor '.
, INITCAP (emp.status) AS "Department".
, INITCAP (emp.first_name |) » '|| EMP. Surname) AS "employee."
r.employee_id
, emp.paaf_number AS 'paaf_num '.
, emp.employee_payroll_number AS 'payroll_num '.
, emp.discipline AS 'discipline '.
, NVL (SUM (tg.week_day1), 0) AS "day 1".
, NVL (SUM (tg.week_day2), 0) AS "day 2".
, NVL (SUM (tg.week_day3), 0) AS day '3 '.
, NVL (SUM (tg.week_day4), 0) AS "day4.
, NVL (SUM (tg.week_day5), 0) AS "day5".
, NVL (SUM (tg.week_day6), 0) AS "day6.
, NVL (SUM (tg.week_day7), 0) AS "day 7".
r.valid_from
r.valid_to
Tw_roster_data r
JOIN tw_employee emp
ON emp.employee_id = r.employee_id
JOIN tg tw_timesheet_stage
ON tg.employee_id = r.employee_id
AND tg.week_commencing = r.valid_from
JOIN the tw_contracting_company comp
ON comp.contracting_company_id = r.contracting_company_id
JOIN tw_supervisor sup
ON sup.supervisor_id = tg.supervisor_id
JOIN tw_budget_holder bh
ON bh.budget_holder_id = sup.budget_holder_id
WHERE r.contracting_company_id = 101
AND r.VALID_FROM = January 31, 2015.
AND r.VALID_TO = February 6, 2015"
Group of r.employee_id, comp.company_name, bh.first_name,
EMP.paaf_number, emp.employee_payroll_number, emp.discipline,
r.valid_from, r.valid_to;
But still the error below
Error in the command line: 1 column: 17
Error report-
SQL error: ORA-00979: not a GROUP BY expression
00979 00000 - "not a GROUP BY expression"
Can help.
Hello
When to use analytical function oracle other columns used based on the analysis, must be included in the GROUP BY Clause
SELECT expression1, expression2, ... expression_n, aggregate_function (expression) FROM tables WHERE conditions GROUP BY expression1, expression2, ... expression_n;
SQL 101: Seen are medium and other aggregate data
SELECT DISTINCT comp.company_name || ' - ' || comp.contract_number AS "company_name", UPPER (bh.first_name) AS "budget_holder", INITCAP (sup.first_name) || ' - ' || sup.surname AS "supervisor", INITCAP (emp.status) AS "department", INITCAP (emp.first_name || ' ' || emp.surname) AS "employee", r.employee_id, emp.paaf_number AS "paaf_num", emp.employee_payroll_number AS "payroll_num", emp.discipline AS "discipline", NVL (SUM (tg.week_day1), 0) AS "day1", NVL (SUM (tg.week_day2), 0) AS "day2", NVL (SUM (tg.week_day3), 0) AS "day3", NVL (SUM (tg.week_day4), 0) AS "day4", NVL (SUM (tg.week_day5), 0) AS "day5", NVL (SUM (tg.week_day6), 0) AS "day6", NVL (SUM (tg.week_day7), 0) AS "day7", r.valid_from, r.valid_to FROM tw_roster_data r JOIN tw_employee emp ON emp.employee_id = r.employee_id JOIN tw_timesheet_stage tg ON tg.employee_id = r.employee_id AND tg.week_commencing = r.valid_from JOIN tw_contracting_company comp ON comp.contracting_company_id = r.contracting_company_id JOIN tw_supervisor sup ON sup.supervisor_id = tg.supervisor_id JOIN tw_budget_holder bh ON bh.budget_holder_id = sup.budget_holder_id WHERE r.contracting_company_id = 101 AND r.VALID_FROM = '31-JAN-2015' AND r.VALID_TO = '06-FEB-2015' GROUP BY comp.contract_number ,comp.company_name ,bh.first_name ,sup.first_name ,sup.surname , emp.status ,emp.first_name ,emp.surname r.employee_id, emp.paaf_number, emp.employee_payroll_number, emp.discipline, r.valid_from, r.valid_to;
-
Nice day
I'm under EBS 11.5.10 with DB 10.2.0.4. I applied patch 7429271 following the steps described in the Doc id 233044.1.
After restarting the application, I had one "node id does not exist for the current application" when forms started.
After serving nodes (exec fnd_conc_clone.setup_clean) DNF, I ran successfully on the dbtier autoconfig but got the error below in the layer of apps.
I also noticed that the content of my BCD file has been deleted and replaced by the model data (all values are by default). I tried to restore but it just had class written once again with default data.
Hope my explanation was clear enough.
Any suggestions?
-adconfig.log error-
Unique constraint error (00001) is OK if the key already exists
java.sql.SQLException: ORA-01400: cannot insert NULL into ('APPLSYS". "" "" FND_NODES '. "" NODE_NAME')
ORA-06512: at the 'APPS '. FND_CONCURRENT', line 1504
ORA-06512: at the 'APPS '. FND_APP_SERVER_PKG', line 163
ORA-06512: at line 1
-Database error change the server
You have the latest applied AutoConfig patch (Patch 9535311 - T2K AUTOCONFIG AND TEMPLATES CUMULATIVE HOTFIX U)? If this isn't the case, please apply the patch and then try.
Additionally, make sure that you have entered in the file/etc/hosts.
Thank you
Hussein
-
SQL error: ORA-00910: specified length too long for its data type
Using Oracle 11.2.0.1 on Oracle Linux 5.8 x 64
I try to install Zabbix http://www.zabbix.com and uses the Oracle database as the data store. The script of the diagram provided below does not work.
When I run it, I getCREATE TABLE maintenances ( maintenanceid number(20) NOT NULL, name nvarchar2(128) DEFAULT '' , maintenance_type number(10) DEFAULT '0' NOT NULL, description nvarchar2(2048) DEFAULT '' , active_since number(10) DEFAULT '0' NOT NULL, active_till number(10) DEFAULT '0' NOT NULL, PRIMARY KEY (maintenanceid) );
According to the oracle documentation for nvarchar2 limit is 4000. What am I missing here?Error at Command Line:5 Column:42 Error report: SQL Error: ORA-00910: specified length too long for its datatype 00910. 00000 - "specified length too long for its datatype" *Cause: for datatypes CHAR and RAW, the length specified was > 2000; otherwise, the length specified was > 4000. *Action: use a shorter length or switch to a datatype permitting a longer length such as a VARCHAR2, LONG CHAR, or LONG RAW
"4000 bytes is the ultimate maximum." You can say 4000 * characters *, but it will always be limited to 4000 * bytes *. "
http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:1224836384599 #201073000346459201\"The maximum length of the column is determined by the definition of national character set. The width of the character NVARCHAR2 data specifications match the number of characters. The authorized maximum column size is 4000 bytes. »
http://docs.Oracle.com/CD/E11882_01/server.112/e26088/sql_elements001.htm#SQLRF50976Furthermore, you treat numbers as STRINGS, remove the quotes around your zero.
-
HELP to ' SQL error: ORA-00937: not a function of simple-group.
< p >
Hello world:
I have a forum based on oracle 11g database. There two tables: article of thread and the relationship between the two is "one-to-many.
I want to list the total number of seen of all the discussions in each section, and I write the sql code:
Select s.secname, sum (sum1) of join of s section
(select secid, sum1 sum (thrviewednum) of the Group of threads by secid) tt WE s.secid = tt.secid;
The 'secid' column is the pharmacokinetics of the section table and FK of the table of thread, the "thrviewednum" the number of views of a thread.
But I get the error:
Error in the command line: 1 column: 7
Error report:
SQL error: ORA-00937: not a function of simple-group
I can't understand the problem, could someone help me? Thank you.
< /p >Hello
Use this
Select s.secname, sum (sum1) of join of s section
(select secid, sum1 sum (thrviewednum) of the thread by secid group) THE group s.secid tt = tt.secid by s.secname;
This is because the select statement contains a column that is not part of any group function, so this column must be there in the group by clause
Concerning
-
whenever I run this code I get this error
SQL Error: ORA-30926: failed to get a stable set of rows in the source tables
30926 00000 - "impossible to get a stable set of rows in the source tables.
* Cause: A stable set of rows could not be achieved due to the large dml
activity or one not deterministic where clause.
* Action: Remove any non deterministic of the clauses and reissue of the dml.
Don't know wht goes wrong!
SQL:
MERGE IN VENDORS_ACTIVE_DATE s
USING (nvl (d.VENDOR, s.VENDOR) selection of the SELLER,
NVL (d.COMPANY_CODE, s.COMPANY_CODE) COMPANY_CODE.
(case when ((d.VENDOR = s.VENDOR) and (d.COMPANY_CODE = s.COMPANY_CODE)))
)
then "MATCH".
When d.COMPANY_CODE is null
then 'DELETE '.
When s.COMPANY_CODE is null
then "INSERT."
else 'UPDATE '.
chck end)
from (select * from VENDORS_ACTIVE_DATE where COMPANY_CODE = 2) s
full outer join (select * provider where COMPANY_CODE = 2) d
on (d.COMPANY_CODE = s.COMPANY_CODE AND s.COMPANY_CODE = 2)
) d
WE (d.COMPANY_CODE = s.COMPANY_CODE AND d.chck in ('UPDATE', 'GAME', 'DELETE'))
WHEN MATCHED THEN
UPDATE SET s.VENDOR = d.VENDOR
WHERE d.chck in ('UPDATE', 'DELETE')
DELETE WHERE d.chck = 'DELETE '.
WHEN NOT MATCHED THEN
INSERT (SELLER, COMPANY_CODE)
VALUES (d.VENDOR, d.COMPANY_CODE)
Work request: (deleted the duplicate data in tables (source and target))
MERGE IN VENDORS_ACTIVE_DATE s
USING (nvl (d.VENDOR, s.VENDOR) selection of the SELLER,
NVL (d.ACTIVEDATE, s.ACTIVEDATE) ACTIVEDATE.
NVL (d.COMPANY_CODE, s.COMPANY_CODE) COMPANY_CODE.
(case when ((d.VENDOR = s.VENDOR))
- AND D.ACTIVEDATE = S.ACTIVEDATE
and NVL (d.ACTIVEDATE, trunc (sysdate)) = NVL (s.ACTIVEDATE, trunc (sysdate))
and (d.COMPANY_CODE = s.COMPANY_CODE)
)
then "MATCH".
When d.COMPANY_CODE is null
then 'DELETE '.
When s.COMPANY_CODE is null
then "INSERT."
else 'UPDATE '.
chck end)
from (select * from suppliers where COMPANY_CODE = 2) d
full outer join (select * from vendors_active_date where COMPANY_CODE = 2) s
on (d.COMPANY_CODE = s.COMPANY_CODE and s.vendor = d.vendor)
) d
WE (d.COMPANY_CODE = s.COMPANY_CODE AND d.VENDOR = s.VENDOR AND d.chck in ('UPDATE', 'GAME', 'DELETE'))
WHEN MATCHED THEN
S.ACTIVEDATE = UPDATE SET d.ACTIVEDATE
WHERE d.chck in ('UPDATE', 'DELETE')
DELETE WHERE d.chck = 'DELETE '.
WHEN NOT MATCHED THEN
INSERT (VENDOR, ACTIVEDATE, COMPANY_CODE)
VALUES (d.VENDOR, d.ACTIVEDATE, d.COMPANY_CODE)
-
Hi all
I am a newbie to Oracle and I am faced with the above error. Please see the below code snippets. Can someone please tell what I am doing wrong? Thank you in advance.
Thank you
CREATE TABLE ABC
(
ID VARCHAR2 ENABLE NUMBER NOT NULL,
FIELD1 ACTIVATE THE NUMBER NOT NULL,
FIELD2 ACTIVATE THE VARCHAR2 (8 BYTE) NOT NULL,
CONSTRAINT JOB_PK PRIMARY KEY (ID)
)
;
CREATE TABLE XYZ
(
ACTIVATE THE NUMBER 4 R_ID NOT NULL,.
ID VARCHAR2 ENABLE NUMBER NOT NULL,
Column1 NUMBER (2.0) default 0.00,.
Column2 NUMBER (2.0) default 0.00,.
COLUMN3 NUMBER (2.0).
NUMBER (2.0) TOTAL 0.00 default.
CONSTRAINT TRIP_PAYMENT_PK PRIMARY KEY (ID)
)
;
create or replace trigger trigger1
After Insert on XYZ
for each line
Declare
number of newTotal;
Start
newTOTAL: =: new. Column1 +: new. Column2 +: new. COLUMN3;
setting a day of XYZ together Total = newTotal;
end;
Insert into ABC (1, 45, ' Demo');
insertion in XYZ (1, 1, 12.50, 10.20 33,50, ");
Error report:
SQL error: ORA-04091: table XYZ is changing, function of triggering/can not see
Try one before line
create or replace trigger trigger1
before inserting on XYZ
for each line
Start
: new. TOTAL: =: new. Column1 +: new. Column2 +: new. COLUMN3;
end; -
SQL error: ORA-01031: insufficient privileges
I am trying to create a view. I logged as a DBA. Please suggest.
create or replace view tspace_vw as
SELECT tablespace_name,
Total_Size 'Total_Size (MB).
Free_space "Free_Space (MB).
(Total_size - free_space) "USED_SPACE (MB).
round (((Total_size-Free_Space)/Total_size) * 100, 2) | ' %' "% USED.
DE)
SELECT a.tablespace_name,
Round(sum(a.bytes)/1024/1024,2) Total_Size,.
Round(sum(b.free_bytes)/1024/1024,2) free_space
FROM dba_data_files a, (SELECT file_id, SUM (bytes) free_bytes
FROM dba_free_space
GROUP BY file_id
) b
WHERE a.file_id = b.file_id
and nom_tablespace not in ('SYSTEM', 'SYSAUX', 'UNDOTBS1', 'TEMP')
GROUP BY a.tablespace_name
)
ORDER BY nom_tablespace;
================================================
SQL error: ORA-01031: insufficient privileges
01031 00000 - "insufficient privileges".
978487 wrote:
I am trying to create a view. I logged as a DBA. Please suggest.
SQL error: ORA-01031: insufficient privileges
01031 00000 - "insufficient privileges".
You must grant the right to SELECT user views the two system.
>
Grant select on dba_data_files Scott;
Grant select on dba_free_space Scott;
>
I'm assuming that "connected is a DBA" means that you granted the DBA role to the user. But you need to grant privileges directly so that they are able to create a view.
See CREATE VIEW in the doc of the SQL language
http://docs.Oracle.com/CD/B28359_01/server.111/b28286/statements_8004.htm
>
The owner of the schema containing the view must have the necessary privileges to either select, insert, update, or delete rows from all tables or views on which the opinion is based. The owner must grant these privileges directly, rather than through a role.
>
Maybe you are looking for
-
Re: Satellite A210 and replacing the screen
Hello I need to replace the screen on my A210 - 1 4. An A210-1AS screen would fit this model?Any help appreciated thanks.
-
More light band/border around the perimeter of display
I searched this forum and find nothing... But I found mention of it here: http://forum.xda-developers.com/showthread.php?t=1207312 and elsewhere on the Web. I can't say exactly when it started, but I can't believe that I missed it when I bought the p
-
Strange phone call from Microtech saying my computer has a virus
This morning I received a strange phone call. The caller ID said TRIKON but speaking men said they were by Microtech. I could barely understand what they said, and they had Middle Eastern accents. They asked that a program on a computer with windows
-
A-team Mobile Accelerator persistence: persistence specific user?
Hey,.is it possible to store user-specific responses of RESTING in the sqlite DB and also reading for the current user?The idea is that another user can log on to the same device and receives different data from webservice - but the old user data cou
-
Self-adhesive transparent GIF - find and share on GIPHYMy picture if you go full screen has white particles everywhere. I don't see it until I save for web. No idea how to solve this problem? I've never had this problem before.