ORA-00902 when altering object types in a PL/SQL procedure
The types are altered to the same, so why gives it an error?
Here is how to see the error:
1. Create the described objects below in an Oracle database (I used 8.1.7).
2. Create a bpel-project using the procedure (via a database adapter), and deploy it.
3. Check to see it works.
4. Drop the object-types and create them again, and recompile the procedure.
5. Activate the bpel-process again - and it will fail with error code 902: invalid datatype (and ORABPEL 11811).
CREATE OR REPLACE
TYPE T_TEST AS OBJECT
( AAR NUMBER,
BILAGNR NUMBER
CREATE OR REPLACE
TYPE T_TESTS
IS TABLE OF T_TEST
CREATE OR REPLACE
PROCEDURE TestAlterType (aType T_TESTS) IS
BEGIN
NULL;
END;
Regards,
Flemming
In such situation, I changed the BPEL wrapper package and made the BPLE generated wrapper package an Invalid Object (Ref below if needed). Now, I tested the Application from BPEL console. Then I got the Application Package is not exists. (Basically an error condition).I think now the Toplink cache gets disrupted. Then I corrected the BPEL generated Wrapper Package. Then executed the BPEL wrapper Package in database. Now I used BPEL console to test it again. It worked fine...
This way you can avoid Restarting the OPMN..
(One easy Step to Make Invalid Object)
1) Intentionally remove the ending ';' in the BPEL wrapper packages. And run the script in database. This Package body will become invalid.
Similar Messages
-
When is object type decided?
I'd like to know when "OLTP Object Type(*)" is decided.
Though I created the planned order in APO, "OLTP Object Type" wasn't determined.
I checked existed planned order in my system and I found some planned orders have already been assigned "5" for "OLTP Object Type" but the others haven't been assinged yet.
When is object type decided? And how can we control this?
*OLTP Object Type = R/3 Object Type = Order_Type (import parameter of "BAPI_MOSRVAPS_SAVEMULTI3"(Order Category in OLTP System))
The selectable values are the following.
0 Stock
1 Purchase Requisition
2 Purchase Order
3 Sales Order
4 Planning
5 Planned Order
6 Production Order
7 Reservation
8 APO Local Order
9 Advanced Shipping Notification
A Order Confirmation
B Delivery
I Inspection Lot
M Maintenance Order
P Project Order
R Proposed Order
T Shipment
V VMI Stock Transfer Order
Not yet determined
You can check the "OLTP Object Type" from transaction code "/n/sapapo/om16" (Ordmap Anchor Table tab).Hello Shohei,
"OLTP Object Type(*)" is of more importance to the external system; surely, it would be assigned after the number is changed by the CIF .
The document is created an send it to R/3 or ECC (if you have publication types, Integration models, etc...); when the external system confirm the document and return it to SCM via CIF, the "OLTP Object Type(*)" should be assigned.
Probably you only have this number for documents working on planning version 000, and not for other planning versions.
At the end: "OLTP Object Type(*)" is decided by the external system, when documents go trough CIF.
Please check the following documentation:
"Order Category in OLTP System
The (OLTP or R/3) order category is used in addition to the order number to identify an order that has been transferred from an external (or R/3) system to the APO system.
Some examples of order categories are sales orders (fixed value 3), purchase orders (fixed value 2), and production orders (fixed value 6).
You can use various (OLTP or R/3) order categories for certain APO business objects, such as production orders or in-house production.
For example, a procurement order (BUS10502) in the APO system can contain both procurement orders (category 2) and purchase requisitions (category 1). In APO, the order category is only used to identify an order in combination with the order number. The category is also used in part to determine if an order/schedule line in the APO system can be changed by a user or not (a purchase order, for example, may no longer be changed, while a purchase requisition may still be changed). Generally, the order category is of more importance to the external system. For example, the R/3 system needs to know whether it is a purchase order or a purchase requisition that is being dealt with.
If an SAP (e.g. R/3) system is not linked to the APO system, and this system is to be used to exchange the order information that requires a certain order category, we recommend that you use the standard values, for example category 2 for business object BUS10502.
Orders that are created within an APO system, for example in a planning run, are not given an (OLTP) order category when created, since they were not transferred to the APO system from an external system. These orders all automatically receive (for example, when they are imported) the order category 8 (APO local order). These orders have an APO internal order category which distinguishes between criteria such as in-house production or external procurement. In a subsequent (optional) step, an external system can then decide whether an order created in APO is a purchase order (category 2) or a purchase requisition (category 1) and assign it an (OLTP) order category and an (external) order number.
You find these values in the documentation of the respective function or of the domain fixed values.
Note that certain functions (for example, configurations) are only possible for certain order categories."
Regards,
Gustavo Pérez -
Is there a switch for 'FORCE' when creating object type?
Where is the property to indicate whether or not to include the keyword FORCE when creating an object type?
Thanks, the support that SDDM provides for Object Types is much better than Oracle Designer. I am looking forward to the release where we can flag a method's parameter as 'DEFAULT NULL' and especially the ability to include an inherited or included attribute as part of the primary key or the primary key. With the last release where the method body is stubbed out with 'BEGIN NULL; END;' really provided the basic ability for rapid prototyping. Once the key 'FORCE' is in place, the ability to rapid prototype will become even more functional.
-
Ora-00942 when querying object privs
Hi, I have a OEM 9.2 accessing an Oracle 9.2 instance. When querying object privs I get error 942. All else works OK. I have 07_dictionary_accesibility=true and the OEM user has DBA and select any dictionary privs. oms.nohup does not show anything unusual neither dbsnmp.log . Any ideas?
there will still be some sys objects that may throw this
-
IN PP01 WHEN BP Object type is selected, no infotypes come to screen
Hi friends,
We are planning to implement cProjects and make it integrated with HR module.
However, at the very first place, when I try to create a Business Partner and check whether it is reflected in cProjects, I could not create a business partner thru PP01. None of the infotypes are coming in any of the tabs (active, planned, etc.)
Pls comment on this issue.
Regards,
Dilekcompare
ur ides System with the present one
i think u know the switch
V_T77SO
and organisational assigment it is ORGA but dont know the other one i wil check and let i know
here in my development it is working fine for me through PPO2 -
TYPE OR TABLE DEPENDENCY OF OBJECT TYPE (ORA-2303)
제품 : SQL*PLUS
작성날짜 : 2004-05-20
==================================================
TYPE OR TABLE DEPENDENCY OF OBJECT TYPE (ORA-2303)
==================================================
PURPOSE
Type이나 table의 dependency가 있는 type을 drop하거나 replace하고자
하면 ORA-02303 error가 난다. 이 error의 원인을 알아보도록 한다.
Explanation
Object의 attribute나 method를 수정하기 위해서는 object type을 drop하고 재생성
해야 한다. Type이나 table의 dependency가 있는 type을 drop하거나 replace하고자
하면 ORA-02303 error가 난다. Object type은 type (nested table 또는 VARRAY)
또는 object table로써 구체적으로 표현된다. 만약 data의 보존이 필요하다면
temporary table에 manual하게 옮겨놓아야 한다.
SQL Reference guide에 의하면 DROP TYPE FORCE 옵션은 recommend하지 않는다.
왜냐하면 이 옵션을 쓰게 되면 복구가 불가능하고 dependency가 있던 table들은
access하지 못하는 결과를 초래한다.
Example
아래의 query 1, 2, 3은 dependency을 확인하는 query문이다.
1. Find nested tables
select owner, parent_table_name, parent_table_column
from dba_nested_tables
where (table_type_owner, table_type_name) in
(select owner, type_name
from dba_coll_types
where elem_type_owner = '<typeOwner>'
and elem_type_name = '<typeName>');
2. Find VARRAYs
select owner, parent_table_name, parent_table_column
from dba_varrays
where (type_owner, type_name) in
(select owner, type_name
from dba_coll_types
where elem_type_owner = '<typeOwner>'
and elem_type_name = '<typeName');
3. Find object tables
select owner, table_name
from dba_object_tables
where table_type_owner = '<typeOwner>'
and table_type = '<typeName>'
and nested = 'NO';
Example ) Logon as Scott
/* Create an user defined object type */
SQL> create type object_type as object (
col1 number,
col2 varchar2(20))
Type created.
/* Create nested table type */
SQL> create type object_ntable as table of object_type
Type created.
/* Create varray type*/
SQL> create type object_varray as varray(5) of object_type
Type created.
/* Create parent table with nested table and varray */
SQL> create table master (
col1 number primary key,
col2_list object_ntable,
col3_list object_varray)
nested table col2_list store as master_col2
Table created.
/* Create object table */
SQL> create table object_table of object_type (col1 primary key)
object id primary key;
Table created.
ORA-2303 results if attempt to drop type with dependencies
SQL> drop type object_type;
drop type object_type
ERROR at line 1:
ORA-02303: cannot drop or replace a type with type or table dependents
위의 queery 1,2,3을 이용하여 object type dependency을 확인한다.
-- Find nested tables utilizing object type
SQL> select owner, parent_table_name, parent_table_column
from dba_nested_tables
where (table_type_owner, table_type_name) in
(select owner, type_name
from dba_coll_types
where elem_type_owner = 'SCOTT'
and elem_type_name = 'OBJECT_TYPE');
OWNER PARENT_TABLE_NAME PARENT_TABLE_COLUMN
SCOTT MASTER COL2_LIST
-- Find VARRAYs utilizing object type
SQL> select owner, parent_table_name, parent_table_column
from dba_varrays
where (type_owner, type_name) in
(select owner, type_name
from dba_coll_types
where elem_type_owner = 'SCOTT'
and elem_type_name = 'OBJECT_TYPE');
OWNER PARENT_TABLE_NAME PARENT_TABLE_COLUMN
SCOTT MASTER COL3_LIST
-- Find object tables
SQL> select owner, table_name
from dba_object_tables
where table_type_owner = 'SCOTT'
and table_type = 'OBJECT_TYPE'
and nested = 'NO';
OWNER TABLE_NAME
SCOTT OBJECT_TABLE
참고)
bulletin : 11576 처럼 utility을 이용하는 방법이 있다.
우리는 여기서 주의하여야 할 것은 script $ORACLE_HOME/rdbms/admin/utldtree.sql
을 내가 보고자 하는 user에서 돌려야 한다는 것이다.
$sqlplus scott/tiger
SQL> @$ORACLE_HOME/rdbms/admin/utldtree.sql
SQL> exec deptree_fill('TYPE','SCOTT','OBJECT_TYPE');
PL/SQL procedure successfully completed.
SQL> select * from ideptree;
DEPENDENCIES
TYPE SCOTT.OBJECT_TYPE
TYPE SCOTT.OBJECT_NTABLE
TABLE SCOTT.MASTER
TYPE SCOTT.OBJECT_VARRAY
TABLE SCOTT.MASTER
TABLE SCOTT.MASTER_COL2
TABLE SCOTT.OBJECT_TABLE
Reference Documents
Korean bulletin : 11576
<Note:69661.1>Hi Carsten,
Thanks for the sharp hint. It works.
However, when I create a table using the schema, it gives me this error:
varray DOC."LISTOFASSIGNEDNUMBER"."ASSIGNEDNUMBER"
ERROR at line 14:
ORA-02337: not an object type column
Here is the script:
CREATE TABLE CUSTOMMANIFEST (
ID NUMBER PRIMARY KEY,
DOC sys.XMLTYPE
xmltype column doc
XMLSCHEMA "http://www.abc.com/cm.xsd"
element "CustomManifest"
varray DOC."LISTOFMANIFESTPORTINFO"."MANIFESTPORTINFO"
store as table MANIFESTPORTINFO_TABLE
(primary key (NESTED_TABLE_ID, ARRAY_INDEX))
organization index overflow
varray DOC."LISTOFASSIGNEDNUMBER"."ASSIGNEDNUMBER"
store as table ASSIGNEDNUMBER_TABLE
(primary key (NESTED_TABLE_ID, ARRAY_INDEX))
organization index overflow
LISTOFASSIGNEDNUMBER itself is complexType and not sure where is the error....
You may note there are more than two hierachy/levels...
Thanks. -
EA3/EA2/EA1 - Script output when creating/altering objects
Another picky post :)
I noticed something odd with the script output when altering objects as part of running a script (F5). When running an alter command with more than a two separating characters (ie space, tab or new line) between any of the alter, object type or object name, the object name is not reported in the script output. However, when there is only a single separating character, the object name is reported in the script output. If I have three separating characters between the alter and the object type, the object type isn't reported in the script output either.
For example:
alter view my_view compile;
alter view my_view compile;
alter view my_view compile;
alter view my_view compile;Generates the following in script output:
alter view succeeded.
alter view succeeded.
alter view my_view succeeded.
alter succeeded.When running the first three of these as a statement (F9), the status line shows "alter view Statement Processed". When running the last one, we only get "alter Statement Processed".Also noticed that there is a similar problem with create statements, for example:
create or replace force view my_view as select * from dual;
create or replace force view my_view as select * from dual;
create or replace force view my_view as select * from dual;
create or replace force view my_view as select * from dual;
create or replace force view my_view as select * from dual;
create or replace view my_view as select * from dual;
create or replace view my_view as select * from dual;
create or replace view my_view as select * from dual;
create or replace view my_view as select * from dual;Generates the following script output:
create or replace force succeeded.
create succeeded.
create or succeeded.
create or replace succeeded.
create or replace force succeeded.
create or replace view succeeded.
create succeeded.
create or succeeded.
create or replace succeeded.Note that in this case the feedback on the status line when running each of these as a statement matches the script output (except succeeded is replaced by Statement Processed). -
Query Operator "IS" is not working good for object type "String"
Hi,
I have a problem with advanced search. When the object type is String, and I want to search directly value (for exemple 'a') i have returned all value starts with 'a', even though I set Query Operator to "IS"
When I use Query operator "setByUser", and then set property to "IS", query behaviour is correct.
Behaviour example for operator "IS":
values: a, ab, abc
searching: 'a' --> expected results: a results: a, ab, abc
Any sugestions??
Sorry for my English
Regards,
Wojciech MularczykSyed,
Only under advanced search. The operator used for quick search is defined through two properties in JhsAdvancedSearch bean class:
private String defaultStringOperator = "startsWith";
private String defaultNonStringOperator = "is";
So, if you have a String attribute which holds numbers and you want to apply the "is" operator to this attribute, you can change the default value of "defaultStringOperator" by creating a custom template for searchBean.vm, and add the following property:
<managed-property>
<property-name>defaultStringOperator </property-name>
<value>is</value>
</managed-property>
Note hat you can already apply this technique in the current release.
Steven Davelaar,
JHeadstart Team. -
DISTINCT on object type collection not working with GROUP BY
Hello,
I have an object type with collection defined as:
create or replace type individu_ot as object (
numero_dossier number(10),
code_utilisateur varchar2(8 char),
nom varchar2(25 char),
prenom varchar2(25 char),
map member function individu_map return number
create or replace type body individu_ot is
map member function individu_map return number
is
begin
return SELF.numero_dossier;
end individu_map;
end;
create or replace type individu_ntt is table of individu_ot
/When I use it in simple SQL without any aggregation, the distinct keyword works well and returns me the distinct entry of my object type in the collection:
SQL> select cast(collect(distinct individu_ot(indivmc.numero_dossier, indivmc.idul, indivmc.nom, indivmc.prenom)) as individu_ntt) as distinct_list
from site_section_cours sisc
inner join enseignant_section_mc ensemc
on sisc.code_session = ensemc.code_session and
sisc.numero_reference_section_cours = ensemc.numero_reference_section_cours
inner join individu_mc indivmc
on ensemc.numero_dossier_pidm = indivmc.numero_dossier
where sisc.seq_site_cours = 6
DISTINCT_LIST(NUMERO_DOSSIER,CODE_UTILISATEUR,NOM,PRENOM)
INDIVIDU_NTT(INDIVIDU_OT(15,PROF5,Amidala,Padmé))
1 row selected.However in SQL with broader selection with group by, the distinct isn't working anymore.
SQL> select *
from (
select sisc.seq_site_cours,
cast(collect(distinct individu_ot(indivmc.numero_dossier, indivmc.idul, indivmc.nom, indivmc.prenom)) as individu_ntt) as distinct_list
from site_section_cours sisc
inner join enseignant_section_mc ensemc
on sisc.code_session = ensemc.code_session and
sisc.numero_reference_section_cours = ensemc.numero_reference_section_cours
inner join individu_mc indivmc
on ensemc.numero_dossier_pidm = indivmc.numero_dossier
group by sisc.seq_site_cours
where seq_site_cours = 6
SEQ_SITE_COURS DISTINCT_LIST(NUMERO_DOSSIER,CODE_UTILISATEUR,NOM,PRENOM)
6 INDIVIDU_NTT(INDIVIDU_OT(15,PROF5,Amidala,Padmé),INDIVIDU_OT(15,PROF5,Amidala,Padmé),INDIVIDU_OT(15,PROF5,Amidala,Padmé),INDIVIDU_OT(15,PROF5,Amidala,Padmé),INDIVIDU_OT(15,PROF5,Amidala,Padmé))
1 row selected.there is case where I need to return more than one collections, with distinct entries in it.
Is there something I am missing?
Thanks
BrunoNot a bug, rather an undocumented feature.
Here are some alternatives you might want to test :
1) Using the SET operator to eliminate duplicates :
SELECT sisc.seq_site_cours,
set(
cast(
collect(individu_ot(indivmc.numero_dossier, indivmc.idul, indivmc.nom, indivmc.prenom))
as individu_ntt
) as distinct_list
FROM site_section_cours sisc
INNER JOIN enseignant_section_mc ensemc
ON sisc.code_session = ensemc.code_session
AND sisc.numero_reference_section_cours = ensemc.numero_reference_section_cours
INNER JOIN individu_mc indivmc
ON ensemc.numero_dossier_pidm = indivmc.numero_dossier
GROUP BY sisc.seq_site_cours
;2) Using MULTISET with a subquery
SELECT sisc.seq_site_cours,
CAST(
MULTISET(
SELECT distinct
indivmc.numero_dossier, indivmc.idul, indivmc.nom, indivmc.prenom
FROM enseignant_section_mc ensemc
INNER JOIN individu_mc indivmc
ON ensemc.numero_dossier_pidm = indivmc.numero_dossier
WHERE sisc.code_session = ensemc.code_session
AND sisc.numero_reference_section_cours = ensemc.numero_reference_section_cours
AS individu_ntt
) AS distinct_list
FROM site_section_cours sisc
; -
"ORA-00902: invalid datatype" when trying to register local schema
I'm trying to register a local schema which uses/includes a global schema(s). I validated the schemas using XMLSpy.
Registering the global schema(s) was successful. Registering these global schemas was done under user "Generic". For local schemas, that use global schema, a new user is created, and the following script is executed.
SQL> --
SQL> -- Create user
SQL> --
SQL> create user &1 identified by &2
2 temporary TABLESPACE temp
3 default TABLESPACE users;
old 1: create user &1 identified by &2
new 1: create user Simple identified by Simple
User created.
Elapsed: 00:00:00.03
SQL> --
SQL> -- Grant privileges
SQL> --
SQL> grant create session to &1;
old 1: grant create session to &1
new 1: grant create session to Simple
Grant succeeded.
Elapsed: 00:00:00.01
SQL> grant resource to &1;
old 1: grant resource to &1
new 1: grant resource to Simple
Grant succeeded.
Elapsed: 00:00:00.01
SQL> -- Dunno if following is required for local schemas, but if I remove I can't FTP
SQL> grant dba, xdbadmin to &1;
old 1: grant dba, xdbadmin to &1
new 1: grant dba, xdbadmin to Simple
Grant succeeded.
Elapsed: 00:00:00.02
SQL>
SQL> --
SQL> -- Connect ;-)
SQL> --
SQL> connect &1/&2@SVF91;
Connected.
===========================================================
SQL> --
SQL> -- Register the schema in Oracle
SQL> --
SQL> BEGIN
2 DBMS_XMLSchema.registerSchema(
3 schemaURL => '&1',
4 schemaDoc => xdbURIType('&2').getClob(),
5 local => TRUE,
6 genTypes => TRUE,
7 genBean => FALSE,
8 genTables => TRUE);
9 END;
10 /
old 3: schemaURL => '&1',
new 3: schemaURL => 'http://http://ehvl091a:8080/home/Simple/xsd/SimplePOI.xsd',
old 4: schemaDoc => xdbURIType('&2').getClob(),
new 4: schemaDoc => xdbURIType('/home/Simple/xsd/SimplePOI.xsd').getClob(),
BEGIN
ERROR at line 1:
ORA-31084: error while creating table "SIMPLE"."SIMPLE_XPOI" for element
"XPOIS"
ORA-00902: invalid datatype
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 20
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 31
ORA-06512: at line 2
The schema I use is:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:POI="POI" xmlns:xdb="http://xmlns.oracle.com/xdb" targetNamespace="POI" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true">
<xs:include schemaLocation="http://ehvl091a:8080/home/Generic/xsd/POI.xsd"/>
<xs:element name="XPOIS" xdb:defaultTable="SIMPLE_XPOI">
<xs:annotation>
<xs:documentation>A collection of XPOI</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Simple" minOccurs="3" maxOccurs="unbounded" xdb:columnProps="NOT SUBSTITUTABLE">
<xs:complexType>
<xs:complexContent>
<xs:extension base="POI:POIType"/>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I'm new at this XML (Oracle) stuff, so i could really use some pointers on how to tackle this. Thanks in advance.The following example works for me...
SQL> connect / as sysdba
Connected.
SQL> --
SQL> drop user global cascade
2 /
User dropped.
SQL> drop user local cascade
2 /
User dropped.
SQL> create user global identified by global
2 /
User created.
SQL> grant connect, resource, alter session, create view, xdbadmin to global
2 /
Grant succeeded.
SQL> create user local identified by local
2 /
User created.
SQL> grant connect, resource, alter session, create view to local
2 /
Grant succeeded.
SQL> connect global/global
Connected.
SQL> --
SQL> var schemaURL varchar2(256)
SQL> var schemaPath varchar2(256)
SQL> --
SQL> begin
2 :schemaURL := 'poTypes.xsd';
3 :schemaPath := '/public/poTypes.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<!-- edited with XML Spy v4.0 U (http://www.xmlspy.com) by Mark (Drake) -->
5 <xs:schema xmlns="http://xmlns.oralce.com/demo/xdb/purchaseOrderTypes" targetNamespace="http://xmlns.oralce.com/demo/xdb/purchaseOrderT
ypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
6 <xs:complexType name="LineItemsType" xdb:SQLType="LINEITEMS_T">
7 <xs:sequence>
8 <xs:element name="LineItem" type="LineItemType" maxOccurs="unbounded" xdb:SQLName="LINEITEM" xdb:SQLCollType="LINEIT
EM_V"/>
9 </xs:sequence>
10 </xs:complexType>
11 <xs:complexType name="LineItemType" xdb:SQLType="LINEITEM_T">
12 <xs:sequence>
13 <xs:element name="Description" type="DescriptionType" xdb:SQLName="DESCRIPTION"/>
14 <xs:element name="Part" type="PartType" xdb:SQLName="PART"/>
15 </xs:sequence>
16 <xs:attribute name="ItemNumber" type="xs:integer" xdb:SQLName="ITEMNUMBER" xdb:SQLType="NUMBER"/>
17 </xs:complexType>
18 <xs:complexType name="PartType" xdb:SQLType="PART_T">
19 <xs:attribute name="Id" xdb:SQLName="PART_NUMBER" xdb:SQLType="VARCHAR2">
20 <xs:simpleType>
21 <xs:restriction base="xs:string">
22 <xs:minLength value="10"/>
23 <xs:maxLength value="14"/>
24 </xs:restriction>
25 </xs:simpleType>
26 </xs:attribute>
27 <xs:attribute name="Quantity" type="moneyType" xdb:SQLName="QUANTITY"/>
28 <xs:attribute name="UnitPrice" type="quantityType" xdb:SQLName="UNITPRICE"/>
29 </xs:complexType>
30 <xs:simpleType name="ReferenceType">
31 <xs:restriction base="xs:string">
32 <xs:minLength value="18"/>
33 <xs:maxLength value="30"/>
34 </xs:restriction>
35 </xs:simpleType>
36 <xs:complexType name="ActionsType" xdb:SQLType="ACTIONS_T">
37 <xs:sequence>
38 <xs:element name="Action" maxOccurs="4" xdb:SQLName="ACTION" xdb:SQLCollType="ACTION_V">
39 <xs:complexType xdb:SQLType="ACTION_T">
40 <xs:sequence>
41 <xs:element name="User" type="UserType" xdb:SQLName="ACTIONED_BY"/>
42 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_ACTIONED"/>
43 </xs:sequence>
44 </xs:complexType>
45 </xs:element>
46 </xs:sequence>
47 </xs:complexType>
48 <xs:complexType name="RejectionType" xdb:SQLType="REJECTION_T">
49 <xs:all>
50 <xs:element name="User" type="UserType" minOccurs="0" xdb:SQLName="REJECTED_BY"/>
51 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_REJECTED"/>
52 <xs:element name="Comments" type="CommentsType" minOccurs="0" xdb:SQLName="REASON_REJECTED"/>
53 </xs:all>
54 </xs:complexType>
55 <xs:complexType name="ShippingInstructionsType" xdb:SQLType="SHIPPING_INSTRUCTIONS_T">
56 <xs:sequence>
57 <xs:element name="name" type="NameType" minOccurs="0" xdb:SQLName="SHIP_TO_NAME"/>
58 <xs:element name="address" type="AddressType" minOccurs="0" xdb:SQLName="SHIP_TO_ADDRESS"/>
59 <xs:element name="telephone" type="TelephoneType" minOccurs="0" xdb:SQLName="SHIP_TO_PHONE"/>
60 </xs:sequence>
61 </xs:complexType>
62 <xs:simpleType name="moneyType">
63 <xs:restriction base="xs:decimal">
64 <xs:fractionDigits value="2"/>
65 <xs:totalDigits value="12"/>
66 </xs:restriction>
67 </xs:simpleType>
68 <xs:simpleType name="quantityType">
69 <xs:restriction base="xs:decimal">
70 <xs:fractionDigits value="4"/>
71 <xs:totalDigits value="8"/>
72 </xs:restriction>
73 </xs:simpleType>
74 <xs:simpleType name="UserType">
75 <xs:restriction base="xs:string">
76 <xs:minLength value="1"/>
77 <xs:maxLength value="10"/>
78 </xs:restriction>
79 </xs:simpleType>
80 <xs:simpleType name="RequestorType">
81 <xs:restriction base="xs:string">
82 <xs:minLength value="0"/>
83 <xs:maxLength value="128"/>
84 </xs:restriction>
85 </xs:simpleType>
86 <xs:simpleType name="CostCenterType">
87 <xs:restriction base="xs:string">
88 <xs:minLength value="1"/>
89 <xs:maxLength value="4"/>
90 </xs:restriction>
91 </xs:simpleType>
92 <xs:simpleType name="VendorType">
93 <xs:restriction base="xs:string">
94 <xs:minLength value="0"/>
95 <xs:maxLength value="20"/>
96 </xs:restriction>
97 </xs:simpleType>
98 <xs:simpleType name="PurchaseOrderNumberType">
99 <xs:restriction base="xs:integer"/>
100 </xs:simpleType>
101 <xs:simpleType name="SpecialInstructionsType">
102 <xs:restriction base="xs:string">
103 <xs:minLength value="0"/>
104 <xs:maxLength value="2048"/>
105 </xs:restriction>
106 </xs:simpleType>
107 <xs:simpleType name="NameType">
108 <xs:restriction base="xs:string">
109 <xs:minLength value="1"/>
110 <xs:maxLength value="20"/>
111 </xs:restriction>
112 </xs:simpleType>
113 <xs:simpleType name="AddressType">
114 <xs:restriction base="xs:string">
115 <xs:minLength value="1"/>
116 <xs:maxLength value="256"/>
117 </xs:restriction>
118 </xs:simpleType>
119 <xs:simpleType name="TelephoneType">
120 <xs:restriction base="xs:string">
121 <xs:minLength value="1"/>
122 <xs:maxLength value="24"/>
123 </xs:restriction>
124 </xs:simpleType>
125 <xs:simpleType name="DateType">
126 <xs:restriction base="xs:date"/>
127 </xs:simpleType>
128 <xs:simpleType name="CommentsType">
129 <xs:restriction base="xs:string">
130 <xs:minLength value="1"/>
131 <xs:maxLength value="2048"/>
132 </xs:restriction>
133 </xs:simpleType>
134 <xs:simpleType name="DescriptionType">
135 <xs:restriction base="xs:string">
136 <xs:minLength value="1"/>
137 <xs:maxLength value="256"/>
138 </xs:restriction>
139 </xs:simpleType>
140 </xs:schema>');
141 begin
142 if (dbms_xdb.existsResource(:schemaPath)) then
143 dbms_xdb.deleteResource(:schemaPath);
144 end if;
145 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
146 end;
147 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 FALSE,TRUE,FALSE,FALSE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> connect local/local
Connected.
SQL> --
SQL> var schemaURL varchar2(256)
SQL> var schemaPath varchar2(256)
SQL> --
SQL> begin
2 :schemaURL := 'po.xsd';
3 :schemaPath := '/public/po.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<xs:schema xmlns="http://xmlns.oralce.com/demo/xdb/purchaseOrder" targetNamespace="http://xmlns.oralce.com/demo/xdb/purchaseOrder" xm
lns:types="http://xmlns.oralce.com/demo/xdb/purchaseOrderTypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.c
om/xdb" version="1.0" xdb:storeVarrayAsTable="true">
5 <xs:import namespace="http://xmlns.oralce.com/demo/xdb/purchaseOrderTypes" schemaLocation="poTypes.xsd"/>
6 <xs:element name="PurchaseOrder" type="PurchaseOrderType" xdb:defaultTable="PURCHASEORDER"/>
7 <xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
8 <xs:sequence>
9 <xs:element name="Reference" type="types:ReferenceType" xdb:SQLName="REFERENCE"/>
10 <xs:element name="Actions" type="types:ActionsType" xdb:SQLName="ACTIONS"/>
11 <xs:element name="Reject" type="types:RejectionType" minOccurs="0" xdb:SQLName="REJECTION"/>
12 <xs:element name="Requestor" type="types:RequestorType" xdb:SQLName="REQUESTOR"/>
13 <xs:element name="User" type="types:UserType" xdb:SQLName="USERID"/>
14 <xs:element name="CostCenter" type="types:CostCenterType" xdb:SQLName="COST_CENTER"/>
15 <xs:element name="ShippingInstructions" type="types:ShippingInstructionsType" xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
16 <xs:element name="SpecialInstructions" type="types:SpecialInstructionsType" xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
17 <xs:element name="LineItems" type="types:LineItemsType" xdb:SQLName="LINEITEMS"/>
18 </xs:sequence>
19 </xs:complexType>
20 </xs:schema>');
21 begin
22 if (dbms_xdb.existsResource(:schemaPath)) then
23 dbms_xdb.deleteResource(:schemaPath);
24 end if;
25 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
26 end;
27 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,TRUE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> desc PURCHASEORDER
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "po.xsd" Element "PurchaseOrder") STORAGE Object-relational TYPE "PURCHASEORDER_T"
SQL> desc PURCHASEORDER_T
PURCHASEORDER_T is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
REFERENCE VARCHAR2(30 CHAR)
ACTIONS GLOBAL.ACTIONS_T
REJECTION GLOBAL.REJECTION_T
REQUESTOR VARCHAR2(128 CHAR)
USERID VARCHAR2(10 CHAR)
COST_CENTER VARCHAR2(4 CHAR)
SHIPPING_INSTRUCTIONS GLOBAL.SHIPPING_INSTRUCTIONS
_T
SPECIAL_INSTRUCTIONS VARCHAR2(2048 CHAR)
LINEITEMS GLOBAL.LINEITEMS_T
SQL>I'm not sure what you were trying here in your xml schema
xdb:columnProps="NOT SUBSTITUTABLE">
or whether or not this annotation is the source of the problem -
PL/SQL: ORA-22806: not an object or REF when Using Record in Package
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
I have declared a record type in my package
create or replace
PACKAGE MYPKG AS
TYPE MYREC IS RECORD (VAL1 varchar2(20), val2 date);
PROCEDURE display_error (pSQLERRM number);
PROCEDURE P_LOAD_DATA (pStartDate Date, pEndDate Date);
FUNCTION F_EPI(refno1 in NUMBER, refno2 in NUMBER) return MYREC;
END MYPKG;
--In My Package Body
FUNCTION F_EPI(refno1 in NUMBER, refno2 in NUMBER) return MYREC is
F_param MYREC;
BEGIN
select myvarchar2, mydate into MYREC from MYTable
where myrefno1 = refno1
and myrefno2 = refno2
Exception
when others then
display_error(SQLERRM);
RETURN F_param;
END F_EPI ;
PROCEDURE P_LOAD_DATA (pStartDate Date, pEndDate Date) IS
insert into atable(myvarchar, mydate)
select F_EPI(refno1,refno2).val1,F_EPI(refno1,refno2).val2 from tab2;
END P_LOAD_DATA;
I get errors
Error(187,7): PL/SQL: SQL Statement ignored
Error(225,7): PLS-00382: expression is of wrong type
Error(225,7): PL/SQL: ORA-22806: not an object or REF
When I compile the package.
When I try to call the function from SQL I get an Invalid datatype error.Hi,
Before posting any query/plsql blocks, please ensure that you have written it clean and complete with less syntax errors. ( at least general syntax errors, you can avoid). Then somebody can have an interest to check your logical error.
About your posting, refer below solution step-by-step. It may help you, about what you are looking for? By the way, you must be knowing, what you are going to to do with. I haven't concentrated about your requirement; as it was not missing in your posting.
drop table test;
create table test(myvarchar varchar2(20), mydate date);
create or replace
package mypkg as
type myrec is record (val1 varchar2(20), val2 date);
--procedure display_error (psqlerrm in number); -- if you are passing sqlerrm, then parameter needs to be string type
procedure display_error (psqlerrm in varchar2);
procedure p_load_data (pstartdate in date, penddate in date);
function f_epi(refno1 in number, refno2 in number) return myrec;
end mypkg;
Package created.
--in my package body
create or replace
package body mypkg as -- added
procedure display_error (psqlerrm in varchar2) -- if you are declared a proc/func in spec, it needs to define in pkg body
is
begin
null; -- you should know, what to do here
dbms_output.put_line('Err -'||sqlerrm);
end display_error;
function f_epi(refno1 in number,refno2 in number)
return myrec
is
f_param myrec;
begin
-- select myvarchar2, mydate into MYREC from mytable
-- where myrefno1 = refno1
-- and myrefno2 = refno2;
select ename, hiredate into f_param from emp -- added demo logic by using emp
where empno = refno1
and mgr = refno2;
return f_param; -- added
exception
when others then
raise; -- if you are using OTHERS then, just raise it
display_error(sqlerrm);
--return f_param; -- what is this?
end f_epi;
procedure p_load_data (pstartdate in date, penddate in date) -- you must be knowing the use of 2 params ???
is
v_rec myrec; -- added
begin -- Added
--insert into atable(myvarchar, mydate)
-- select f_epi(refno1,refno2).val1,f_epi(refno1,refno2).val1 from tab2;
-- demo logic added with static params to call f_epi
v_rec:= f_epi(7499,7698);
insert into test values v_rec;
--null;
end p_load_data;
end mypkg;
Package body created.
SQL> exec mypkg.p_load_data(null,null);
PL/SQL procedure successfully completed.
SQL> select * from test;
MYVARCHAR MYDATE
ALLEN 20-FEB-81
Thanks! -
ORA-30626: function/procedure parameters of remote object types not support
Hello,
I am trying to create a dynamic LOV.
I have a table and package in a remote database, I am connecting to the database using dblink. When I access package I am getting error
ORA-30626: function/procedure parameters of remote object types are not supported
However I can access table with [email protected], not the package!
How can I solve this problem?Did you ever get an answer/workaround to this? I'm having similar problems in 10g.
-
Error when generating java classes from object types
Hi,
I'm using JDeveloper version 10.1.3.0.2
I created an object type in the database, the definition is:
TYPE domain_cls IS OBJECT (
domain_idx NUMBER(3)
) NOT INSTANTIABLE NOT FINAL
I tried to create a java class for this object using JDeveloper, by using generate java menu item.
I got the following error:
oracle.jpub.JPubException: Warning: Cannot determine what kind of type is OBJMOI. DOMAIN_CLS. The following error occurred: ORA-06550: line 1, column 13:
PLS-00103: Encountered the symbol "SYS" when expecting one of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "SYS" to continue.
at oracle.jpub.sqlrefl.SqlReflector.addSqlType(SqlReflector.java:519)
at oracle.jpub.sqlrefl.SqlReflector.addSqlUserType(SqlReflector.java:707)
at oracle.jpub.publish.Publisher.addTypeOrPackage(Publisher.java:209)
at oracle.jpub.publish.IntypeParser.TypeDeclaration(IntypeParser.java:238)
at oracle.jpub.publish.IntypeParser.CompilationUnit(IntypeParser.java:75)
at oracle.jpub.Doit.main(Doit.java:257)
at oracle.jpub.Doit.main(Doit.java:102)
at oracle.jdevimpl.cm.dt.jpub.JPubModel.publish(JPubModel.java:1047)
at oracle.jdevimpl.wizard.jpub.JPubPanel.publish(JPubPanel.java:516)
at oracle.jdevimpl.cm.dt.jpub.JPubAddin._doJPub(JPubAddin.java:174)
at oracle.jdevimpl.cm.dt.jpub.JPubAddin.handleEvent(JPubAddin.java:81)
at oracle.ide.IdeAction.performAction(IdeAction.java:661)
at oracle.ide.IdeAction$2.run(IdeAction.java:889)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
any body can hlep in that pleaseI would recommend using JAXB instead of the Oracle class generator. This will give a standards based object-to-XML platform.
Oracle provides two JAXB implementations: one in the TopLink product, and the other in the XDK.
For an example of using TopLink JAXB see:
http://www.oracle.com/technology/products/ias/toplink/technical/tips/jaxb/index.htm
TopLink also provides the ability to map existing Java objects to an existing XML Schema, for an example of this see:
http://www.oracle.com/technology/products/ias/toplink/technical/tips/ox/index.htm
-Blaise -
OS=Win2003
DB=10gR2
Version = 102.0.4
Hi,
I am running a impdp on a 30gb file and well it seems to have gone fine (much faster then it normally does to be honest), but towards the end it fails, and when researching this error, it seems to be very vague and I was wondering if someone can help me. Below is the log, but I have taken parts out of it that are not relevant.
Import: Release 10.2.0.4.0 - Production on Wednesday, 16 April, 2008 15:22:18
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."IMPGEMDEV041608" successfully loaded/unloaded
Starting "SYSTEM"."IMPGEMDEV041608": system/********@iworksdb directory=DATA_PUMP_DIR dumpfile=expdpgemdev.dmp job_name=impgemdev041608 TABLE_EXISTS_ACTION=APPEND SCHEMAS=GEMDEV LOGFILE=IMPIWORKS_BOON.log REMAP_SCHEMA=GEMDEV:IWORKS REMAP_TABLESPACE=IWORKS_INDEX:IWORKS_IDX REMAP_TABLESPACE=IWORKS_IOT:IWORKS_IDX REMAP_TABLESPACE=IWORKS_TABLES:IWORKS_TABLES EXCLUDE=GRANT exclude=statistics STREAMS_CONFIGURATION=N
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"IWORKS" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
ORA-31684: Object type TYPE:"IWORKS"."T_NUMBER_TAB" already exists
ORA-31684: Object type TYPE:"IWORKS"."T_VARCHAR2_TAB" already exists
Processing object type SCHEMA_EXPORT/TABLE/TABLE
ORA-39152: Table "IWORKS"."SYS_TOKENTYPE" exists. Data will be appended to existing table but all dependent metadata will be skipped due to table_exists_action of append
ORA-31684: Object type PACKAGE:"IWORKS"."CONT_FEE_DEF_UC" already exists
ORA-31684: Object type PACKAGE:"IWORKS"."COPAYCALCFLAG" already exists
ORA-31684: Object type VIEW:"IWORKS"."VWTREE" already exists
ORA-31684: Object type VIEW:"IWORKS"."V_ROUTE_DTL_GROUP" already exists
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type SCHEMA_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
ORA-39083: Object type PROCOBJ failed to create with error:
ORA-06550: line 2, column 11:
PLS-00103: Encountered the symbol "VARCHAR2" when expecting one of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "VARCHAR2" to continue.
ORA-06550: line 3, column 12:
PLS-00103: Encountered the symbol "VARCHAR2" when expecting one of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "VARCHAR2" to continue.
ORA-06550: line 4, column 19:
PLS-00103: Encountered the symbol "VARCHAR
ORA-39083: Object type PROCOBJ failed to create with error:
ORA-06550: line 6, column 16:
PLS-00103: Encountered the symbol "RAYSQLACCESS9889405" when expecting one of the following:
* & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LIKE4_ LIKEC_ between || multiset member SUBMULTISET_
The symbol "* was inserted before "RAYSQLACCESS9889405" to continue.
ORA-06550: line 7, column 17:
PLS-00103: Encountered the symbol "SQL" when expectin
Job "SYSTEM"."IMPGEMDEV041608" completed with 2831 error(s) at 15:30:37
Any help will be much appreciatedI can not seem to find any object named PROCOBJ.
As for the object called RAYSQLACCESS9889405...no idea what this is.
I checked the source for any invalid objects and none. -
ORA-39083: Object type TRIGGER failed to create with error:
i m getting these two error when i import data using impdp.
ORA-39083: Object type TRIGGER failed to create with error:
ORA-00942: table or view does not exist
i have exported (expdp) data from production db, when i importing (impdp) the dump file to the test db i m geting the above two errors.
example:
ORA-39083: Object type TRIGGER failed to create with error:
ORA-00942: table or view does not exist
Failing sql is:
CREATE TRIGGER "NEEDLE"."CC_BCK_TRG" BEFORE INSERT OR UPDATE
ON NIIL.cc_bck_mgmt REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW
DECLARE
w_date DATE;
w_user VARCHAR2(10);
BEGIN
SELECT USER,SYSDATE INTO w_user,w_date FROM DUAL;
IF INSERTING THEN
:NEW.cretuser :=w_user;
:NEW.cretdate :=w_date;
END IF;
IF UPDATING THEN
:NEW.modiuser :=w_user;
:NEW.modidate :=w_date;
END IF;
END;
status of the above trigger in pro db is valid. and source table also exist even though i m getting error when i import
please suggest me...perhaps you don't have table... (impdp created trigger before create table)
check about "NIIL.cc_bck_mgmt" table.
and then create it (trigger) manual ;)
Good Luck.
Maybe you are looking for
-
How to Connect My Printer to The Network
My printer is LaserJet M1212nf. According to the brief introduction I should connect the printer to the network first in order to enable its e-printing function. I'm working at home. I don't share information with other computers. Does "network"
-
Unable to run code analysis with WDK 9926
Hi, I am trying to run code analysis with WDK 9926 and seeing below issue? can anybody help me to resolve this ? Error: ==== C:\sw\dev\T4\windows\Src\kernel\vbd>msbuild.exe cht4vbd.vcxproj /p:Configuration="Windows 8.1 Debug" /P:Platform=x64 /P:RunCo
-
Firefox will not open old tabs
My computer crashed last evening and on restarting firefox, it goes to a new page without any of the old tabs available. Going under history has all of the options regarding restoring recently closed windows greyed out. I did confirm that under prefe
-
I'm traveling from Ontario to BC via car and had my iPad in my bag with me in the back seat? Nothing out of the usual stopping for gas and when I Pulled it out I noticed a huge crack and not sure what happen or what can be done please help
-
How to persistent static object
JDO always assigns a StateManager to a PersistenceCapable object when creating instance. If an object is static, it'll keep its StateManager for ever after instantiation. So If I excute the following code repeadly, kodo will complain that persistence