Error in cast multiset in collections
DECLARE
TYPE emp_dept_rec IS RECORD (
v_sal emp.sal%TYPE,
v_name emp.ename%TYPE,
v_deptname dept.DEPTNAME%type
TYPE emp_dept_tab_type IS TABLE OF emp_dept_rec;
l_emp_dept_tab emp_dept_tab_type;
type emp_tab is table of emp%rowtype;
type l_emp_tab is table of emp%rowtype;
type dept_tab is table of dept%rowtype;
type l_dept_tab is table of dept%rowtype;
cursor e1 is
select * from emp;
cursor d1 is select * from dept;
begin
OPEN e1;
FETCH e1
BULK COLLECT INTO l_emp_tab;
open d1;
FETCH d1
BULK COLLECT INTO l_dept_tab;
select cast(multiset (select em.sal,em,ename ,dep.DEPTNAME
from table(l_emp_tab) em,table(l_dept_tab) dep
where em.deptno=dep.deptno)
as emp_dept_tab_type)
into l_emp_dept_tab ;
end;
it is giving error as
ORA-06550: line 43, column 25:
PL/SQL: ORA-00923: FROM keyword not found where expected
ORA-06550: line 39, column 5:
PL/SQL: SQL Statement ignored
Here is an example.
SQL> CREATE OR REPLACE TYPE emp_rec IS OBJECT (
2 v_sal NUMBER(7,2),
3 v_name VARCHAR2(35),
4 v_empno NUMBER(4),
5 v_deptno NUMBER(2)
6 )
7 ;
8 /
Type created.
SQL> CREATE OR REPLACE TYPE emp_tab IS TABLE OF emp_rec;
2 /
Type created.
SQL> CREATE OR REPLACE TYPE dept_rec IS OBJECT (
2 v_deptno NUMBER,
3 v_dname VARCHAR2(50)
4 )
5 ;
6 /
Type created.
SQL> CREATE OR REPLACE TYPE dept_tab IS TABLE OF dept_rec;
2 /
Type created.
SQL> CREATE OR REPLACE TYPE emp_dept_rec IS
2 OBJECT (
3 v_sal NUMBER,
4 v_name VARCHAR2(35),
5 v_deptname VARCHAR2(30)
6 );
7 /
Type created.
SQL> CREATE OR REPLACE TYPE emp_dept_tab_type IS TABLE OF emp_dept_rec;
2 /
Type created.
SQL> set serverout on
SQL> DECLARE
2 l_emp_dept_tab emp_dept_tab_type; --emp_dept_tab_type declared in database
3 l_emp_tab emp_tab; --emp_tab declared in database
4 l_dept_tab dept_tab; --dept_tab declared in database
5
6 CURSOR e1 IS
7 SELECT emp_rec(sal, ename, empno, deptno) FROM emp; --Note the type casting here
8
9 CURSOR d1 IS
10 SELECT dept_rec(deptno, dname) FROM dept; --Note the type casting here
11 BEGIN
12 OPEN e1;
13
14 FETCH e1 BULK COLLECT
15 INTO l_emp_tab;
16
17 OPEN d1;
18
19 FETCH d1 BULK COLLECT
20 INTO l_dept_tab;
21
22 SELECT CAST(MULTISET (SELECT em.v_sal, em.v_name, dep.v_dname
23 FROM TABLE(l_emp_tab) em, TABLE(l_dept_tab) dep
24 WHERE em.v_deptno = dep.v_deptno) AS emp_dept_tab_type)
25 INTO l_emp_dept_tab
26 FROM DUAL;
27 FOR i IN 1 .. l_emp_dept_tab.COUNT LOOP
28 dbms_output.put_line(l_emp_dept_tab(i)
29 .v_sal || '--' || l_emp_dept_tab(i)
30 .v_name || '--' || l_emp_dept_tab(i).v_deptname);
31 END LOOP;
32
33 END;
34 /
1300--MILLER--ACCOUNTING
5000--KING--ACCOUNTING
2450--CLARK--ACCOUNTING
3000--FORD--RESEARCH
1100--ADAMS--RESEARCH
3000--SCOTT--RESEARCH
2975--JONES--RESEARCH
800--SMITH--RESEARCH
950--JAMES--SALES
1500--TURNER--SALES
2850--BLAKE--SALES
1250--MARTIN--SALES
1250--WARD--SALES
1600--ALLEN--SALES
PL/SQL procedure successfully completed.It is just for educational purpose, because the thing you have achieved by so much programming can be done easily by simple join in the table itself.
user10447332 Newbie
Handle: user10447332
Status Level: Newbie
Registered: Oct 20, 2008
Total Posts: 227
Total Questions: 153 (152 unresolved) >
What a record! and most of the time you don't care to follow/revisit the thread also!.
Similar Messages
-
Select from a collection of collections SELECT - CAST - MULTISET - TABLE
Does someone have a suggestion for the SELECT statement which is performing a CAST?
I am on Oracle 10.2.0.1.0. The goal is to take a collection of a nested table and order it by color, then descr, then grown_by, saving it into an ordered collection (v_List2). Am getting error with ORA-22907 Invalid cast to a type that is not a nested table.
CREATE OR REPLACE TYPE ot_fruit
AS OBJECT
descr VARCHAR2(100)
,color VARCHAR2(50)
,grown_by VARCHAR2(50)
CREATE OR REPLACE TYPE tab_fruitList AS TABLE OF ot_fruit;
CREATE OR REPLACE TYPE ot_tab_fruit
AS OBJECT
fruit tab_fruitList
DECLARE
v_List ot_tab_fruit := ot_tab_fruit(tab_fruitList(ot_fruit('apple','red','tree'),
ot_fruit('blueberry','blue','bush')
v_List2 ot_tab_fruit := ot_tab_fruit(tab_fruitList());
BEGIN
SELECT CAST ( MULTISET ( SELECT * FROM TABLE(v_List)
ORDER BY 2, 3, 1
<b> -- This compiles with ORA-22907 error
AS ot_tab_fruit</b>
) INTO v_List2
FROM DUAL;
FOR i IN v_List2.FIRST..v_List2.LAST
LOOP
DBMS_OUTPUT.PUT_LINE('i='||i||' descr='||v_List2(i).fruit.descr ||' color='||
v_List2(i).fruit.color||' grown_by='||v_List2(i).fruit.grown_by);
END LOOP;
END;Thanks, Kate
Message was edited by:
johnsokThis solution, which works perfectly by the way, came from Avi Abrami. I've highlighted the necessary changes to make the SELECT of a collection of objects work properly.
create or replace type OT_FRUIT as object (
DESCR varchar2(100)
,COLOR varchar2(50)
,GROWN_BY varchar2(50)
create or replace type TAB_FRUITLIST as table of OT_FRUIT;
create or replace type OT_TAB_FRUIT as object (
FRUIT TAB_FRUITLIST
DECLARE
v_List ot_tab_fruit := ot_tab_fruit(tab_fruitList(ot_fruit('apple','red','tree'),
ot_fruit('blueberry','blue','bush')
v_List2 ot_tab_fruit := ot_tab_fruit(tab_fruitList());
BEGIN
SELECT CAST ( MULTISET ( SELECT * FROM TABLE(v_List.fruit)
ORDER BY 2, 3, 1
AS tab_fruitlist
) INTO v_List2.fruit
FROM DUAL;
FOR i IN v_List2.fruit.FIRST..v_List2.fruit.LAST
LOOP
DBMS_OUTPUT.PUT_LINE('i='||i||' descr='||v_List2.fruit(i).descr ||' color='||
v_List2.fruit(i).color||' grown_by='||v_List2.fruit(i).grown_by);
END LOOP;
END;
/ -
I have the following sql
SELECT *
FROM (SELECT updatedby, updateddate, ROWNUM,
ent_id
FROM (SELECT hstbe.updatedby,
hstbe.updateddate,
TO_CHAR
(hstbe.entry_id
) ent_id
FROM hst_rb_booking_entry hstbe
--WHERE hstbe.entry_id = entryid
UNION
SELECT hstli.updatedby,
hstli.updateddate,
hstli.entry_id ent_id
FROM hst_rb_line_item hstli)
-- WHERE hstli.entry_id = be.booking_entry_id)
ORDER BY updateddate)
WHERE ROWNUM < 6)
I am unable to put it in cat multiset as have to retrieve these as collection in my sql of ref cursor. please help me in putting it in cast multiset.Thenks for the reply.
I have allready encounter this page in the past.
I tryed to use "JIMI" wich is a good tool but I haven't found a function to control image resolution in it's documentation.
If you do know how to control dpi threw "JIMI" please tell me. -
Using where clause with cast multiset
version
oracle 10g
how to select values based on values in the object.
CREATE OR REPLACE TYPE init_queue AS OBJECT (
seq_num_q NUMBER,
source_system_name VARCHAR2 (50 BYTE),
milestone_id NUMBER,
milestone_date DATE,
downstream_order_number VARCHAR2 (175 BYTE),
leg_id VARCHAR2 (175 BYTE),
statuspro_captured_date DATE,
pon VARCHAR2 (26 BYTE),
milestone_source VARCHAR2 (26 BYTE),
session_id NUMBER,
reconfirmation_flag CHAR (1 BYTE),
vec_flag CHAR (1 BYTE)
CREATE OR REPLACE TYPE tab_init_queue AS TABLE OF init_queue;
SET serveroutput on;
DECLARE
v_list tab_init_queue := tab_init_queue ();
v_arr_sort tab_init_queue := tab_init_queue ();
BEGIN
SELECT init_queue (seq_num_q,
source_system_name,
milestone_id,
milestone_date,
downstream_order_number,
leg_id,
statuspro_captured_date,
pon,
milestone_source,
session_id,
reconfirmation_flag,
vec_flag
BULK COLLECT INTO v_list
FROM r_cust_status_init_queue;
SELECT CAST (MULTISET (SELECT *
FROM TABLE (v_list)
WHERE v_list.milestone_id = 11 -- * How to select values based on milestone.*
) AS tab_init_queue)
INTO v_arr_sort
FROM DUAL;
DBMS_OUTPUT.put_line (v_arr_sort.COUNT);
END;
/Edited by: new learner on Aug 23, 2010 7:35 PMnew learner wrote:
version
oracle 10g
how to select values based on values in the object.
CREATE OR REPLACE TYPE init_queue AS OBJECT (
seq_num_q NUMBER,
source_system_name VARCHAR2 (50 BYTE),
milestone_id NUMBER,
milestone_date DATE,
downstream_order_number VARCHAR2 (175 BYTE),
leg_id VARCHAR2 (175 BYTE),
statuspro_captured_date DATE,
pon VARCHAR2 (26 BYTE),
milestone_source VARCHAR2 (26 BYTE),
session_id NUMBER,
reconfirmation_flag CHAR (1 BYTE),
vec_flag CHAR (1 BYTE)
CREATE OR REPLACE TYPE tab_init_queue AS TABLE OF init_queue;
SET serveroutput on;
DECLARE
v_list tab_init_queue := tab_init_queue ();
v_arr_sort tab_init_queue := tab_init_queue ();
BEGIN
SELECT init_queue (seq_num_q,
source_system_name,
milestone_id,
milestone_date,
downstream_order_number,
leg_id,
statuspro_captured_date,
pon,
milestone_source,
session_id,
reconfirmation_flag,
vec_flag
BULK COLLECT INTO v_list
FROM r_cust_status_init_queue;
SELECT CAST (MULTISET (SELECT *
FROM TABLE (v_list)
WHERE v_list.milestone_id = 11 -- * How to select values based on milestone.*
) AS tab_init_queue)
INTO v_arr_sort
FROM DUAL;
DBMS_OUTPUT.put_line (v_arr_sort.COUNT);
END;
/Edited by: new learner on Aug 23, 2010 7:35 PMLike this.
DECLARE
v_list tab_init_queue := tab_init_queue ();
v_arr_sort tab_init_queue := tab_init_queue ();
BEGIN
v_list.extend;
v_list(v_list.count) := init_queue(1, '1', 11, sysdate, '1', '1', sysdate, '1', '1', 1, '1', '1');
8
SELECT CAST (MULTISET (SELECT *
FROM TABLE (v_list)
WHERE milestone_id = 11 -- * How to select values based on milestone.*
) AS tab_init_queue)
INTO v_arr_sort
FROM DUAL;
DBMS_OUTPUT.put_line (v_arr_sort.COUNT);
END;
1
PL/SQL procedure successfully completed.
ME_XE?ME_XE?
ME_XE?select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
5 rows selected.
ME_XE?It would have been easier if you'd made a simple example so i didn't have to type out the example record (since your original code referenced a table you didn't provide DDL and INSERTS for).
Something to keep in mind for the future (the easier you make it for us, the more likely we are to help). -
How to get result without single cotes in ''Cast(Multiset( '' Result.
select cast(multiset(select column_name
from user_tab_columns
where table_name = 'DAILY_PRODN_MIS'
and column_name like '%STOCK%'
order by column_name) as tab_type) result from dual;
RESULT
TAB_TYPE('BAGS_STOCK', 'BLUE_DUST_STOCK', 'CEMENT_STOCK', 'CEMENT_STOCK_33', 'CEMENT_STOCK_43', 'CEMENT_STOCK_53', 'CK_ADJ', 'COAL_IND_D_STOCK', 'COAL_IND_D_STOCK_ADJ', 'COAL_IND_E_STOCK', 'COAL_IND_E_STOCK_ADJ', 'COAL_IND_F_STOCK','OCK_ADJ', 'MTD_COAL_IMP_D_STOCK_ADJ', 'MTD_COAL_IMP_E_STOCK_ADJ', 'MTD_COAL_IND_A_STOCK_ADJ', 'MTD_COAL_IND_B_STOCK_', 'YTD_COAL_IMP_B_STOCK_ADJ', 'YTD_COAL_IMP_C_STOCK_ADJ', 'YTD_COAL_IMP_D_STOCK_ADJ', 'YTD_COAL_IMP_E_STOCK_ADJ')
How can i get result without single cotes for each column.Your query currently returns a collection type (tab_type) whereas it appears you want to return a delimited string.
There are actually quite a few ways to achieve this - with your own function, with a user-defined aggregate functions (e.g. Tom Kyte's stragg), with the MODEL clause or with CONNECT BY, e.g.
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> SELECT table_name,
2 SUBSTR (MAX (SYS_CONNECT_BY_PATH (
3 column_name, ',')), 2) column_names
4 FROM (SELECT table_name, column_name,
5 ROW_NUMBER () OVER (
6 PARTITION BY table_name
7 ORDER BY column_id) column_order
8 FROM user_tab_columns
9 WHERE table_name = 'BANK_ACCOUNT'
10 AND column_name LIKE '%U%') utc
11 START WITH column_order = 1
12 CONNECT BY column_order = PRIOR column_order + 1
13 AND table_name = PRIOR table_name
14 GROUP BY table_name;
TABLE_NAME COLUMN_NAMES
BANK_ACCOUNT ACCOUNT_NAME,ACCOUNT_NUMBER
SQL> -
CAST MULTISET using a recursive UDT using REF
I am trying to create a recursive object and populate it using cast and multiset. However I keep getting the following error:
ORA-00932: inconsistent datatypes: expected UDT got CHAR
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:
Error at Line: 96 Column: 47
I have been looking on OTN, Google ... every where I can think of. I am missing somthing simple or it is not possible I have not found documentation either way. Found one reference which was close to what I am doing. However the link to the explanation was broken ( Oracle Forums link ).
I have created a simple example below.
PS. Please no comment on using system ( i know :) ) this is a scratch database.
16:53:49 SQL> CREATE OR REPLACE TYPE system.MY_TYPE;
16:54:02 2 /
Type created.
16:54:04 SQL> CREATE OR REPLACE TYPE system.MY_TYPE_LIST AS TABLE OF REF system.MY_TYPE;
16:54:11 2 /
Type created.
16:54:13 SQL> CREATE OR REPLACE TYPE system.MY_TYPE AS OBJECT
16:54:27 2 ( COLUMN1 VARCHAR2(30),
16:54:35 3 SUB_LIST system.MY_TYPE_LIST
16:54:45 4 );
16:54:52 5 /
Type created.
16:54:55 SQL>
16:54:55 SQL> select system.my_type( tc.column_name, null ) from dba_tab_columns tc where tc.owner='SYS' and tc.table_name='DBA_TABLES';
--Should be noted there are no errors occured here* 16:56:00 SQL>
16:57:57 SQL> select system.my_type(
16:59:14 2 v.view_name,
16:59:20 3 cast( multiset (
16:59:26 4 select
16:59:31 5 tc.column_name,
16:59:36 6 null
16:59:45 7 from dba_tab_columns tc
16:59:51 8 where tc.table_name=v.view_name
16:59:56 9 and tc.owner=v.owner ) as system.my_type_list ) )
17:00:01 10 from dba_views v
17:00:06 11 where v.view_name = 'DBA_TABLES';
tc.column_name,
ERROR at line 5:
ORA-00932: inconsistent datatypes: expected UDT got CHAR
17:00:14 SQL>create or replace type t_lookuprec as object
(Select columns1,2,3,....100
FROM A, B, C, D, E
WHERE ROWNUM < 1);You are correct that you need to use CREATE TYPE to use the type in SQL.
However unless I am mistaken you appear to have invented your own syntax for CREATE TYPE, suggest you refer to Oracle documentation. -
CAST MULTISET...is it supported by BI
In a precedent POst i explained the problems we had with multiple queries to display data as a hierarchical manner, with more than 2 levels
We'd like to explore the way with CAST MULTISET...but before to spend time, we'd like to assure that it is supported by BI Publisher.
As an example ( with one level):
We prepared the Object Types as is :
create or replace TYPE ETAG_T AS OBJECT("@S_NUME_OBJE" NUMBER,
S_NUME_ETAG NUMBER,
C_TYPE_ETAG VARCHAR2(4 CHAR),
L_DESC_ETAG VARCHAR2(50 CHAR),
N_NOMB_PIEC NUMBER,
N_SURF_TOTA NUMBER,
D_MODI DATE,
R_FONC CHAR(5),
R_UTIL CHAR(20),
C_CODE_LANG VARCHAR2(4 CHAR)
create or replace TYPE etaglist_t AS TABLE OF etag_t
create or replace TYPE obje_t as Object (
"@S_NUME_OBJE" NUMBER,
N_NUME_IMME VARCHAR2(5) ,
N_NUME_OBJE VARCHAR2(5) ,
etag_list etaglist_t
Then the data query is (Statement is named Q1):
SELECT
obje_t(s_nume_obje, n_nume_obje, n_nume_imme,
CAST (MULTISET (SELECT S_NUME_OBJE,
S_NUME_ETAG,
C_TYPE_ETAG,
L_DESC_ETAG,
N_NOMB_PIEC,
N_SURF_TOTA,
D_MODI,
R_FONC,
R_UTIL,
C_CODE_LANG
FROM imm.b12_0 eta
WHERE eta.s_nume_obje = obj.s_nume_obje)
AS etaglist_t))
AS "obj"
FROM pointi.b02_v obj
WHERE obj.s_nume_obje= :sNumeObje
As a result , we get only the <obj> element like this :
<LIST_Q1>
<Q1>
<obj/>
</Q1>
</LIST_Q1>
We tried too :
SELECT XMLElement("Object",
obje_t(s_nume_obje, n_nume_obje, n_nume_imme,
CAST (MULTISET (SELECT S_NUME_OBJE,
S_NUME_ETAG,
C_TYPE_ETAG,
L_DESC_ETAG,
N_NOMB_PIEC,
N_SURF_TOTA,
D_MODI,
R_FONC,
R_UTIL,
C_CODE_LANG
FROM imm.b12_0 eta
WHERE eta.s_nume_obje = obj.s_nume_obje)
AS etaglist_t))
AS "obj" ) as "objXML"
FROM pointi.b02_v obj
WHERE obj.s_nume_obje= :sNumeObje
And we get :
<Q1>
<objXML/>
</Q1>
Seems to be not supported isn't it...
LaurentOk thanks,
I already checked your blog before to speak about pl/sql tables ;-)
I think , for maintenance, it will better too , than having a single query with many cast...Multiset , which could have more than 500 lines :-(
But in our case, as we should have kind of hierarchies in the XML (with levels) and collections, i think we should have a mix :
store pl/sql tables in a package, that will be reused from the main query, and certainly continue to use cast multiset to manage theses nested collections.
As you said, i think we could remove the use of Object Types as we do today. -
How does cast multiset work, I have a huge sql whcih is returning one value say p_opp_id ( on the basis of this i need few more coumns) , i was suggested to use cast multiset , what is cast multiset and how it works
CAST(MULTISET(subquery) AS collection_type) converts the result of a subquery into a collection.
An example I had lying around:
CREATE TABLE master (table_name PRIMARY KEY) AS
SELECT table_name
FROM user_tables;
CREATE TABLE detail AS
SELECT table_name, column_name, data_type
FROM user_tab_columns;
CREATE OR REPLACE TYPE name_strvalue_ot AS OBJECT
( name VARCHAR2(30)
, value VARCHAR2(50) );
CREATE OR REPLACE TYPE name_strvalue_tt AS TABLE OF name_strvalue_ot;
SELECT m.table_name
, CAST(
MULTISET
( SELECT name_strvalue_ot(d.column_name, d.data_type)
FROM detail d
WHERE d.table_name = m.table_name
) AS name_strvalue_tt) cols
FROM master m;
BEGIN
FOR r IN
SELECT m.table_name
, CAST(
MULTISET
( SELECT name_strvalue_ot(d.column_name, d.data_type)
FROM detail d
WHERE d.table_name = m.table_name
) AS name_strvalue_tt) cols
FROM master m
LOOP
DBMS_OUTPUT.PUT_LINE(r.table_name || ': ' || r.cols.count || ' columns');
END LOOP;
END;
/ -
RICS0001:Internal Error,unable to process the collected data from the device.
Hi all,
I've got the following error in Inventory Collection: 'RICS0001:Internal Error,unable to process the collected data from the device.'
System is CW LMS 2.6
If I search the web I get the following Cisco document:
http://www.cisco.com/en/US/products/sw/cscowork/ps2073/prod_troubleshooting_guide09186a008036dff2.html
'...in the log directory look for IC_Server.log.'
IC_Server.log:
[ Di Nov 16 15:54:27 CET 2010 ],INFO ,[Thread-25],com.cisco.nm.rmeng.inventory.ics.core.ICSCore,173,Got Async Request, User Name :admin
[ Di Nov 16 15:54:27 CET 2010 ],INFO ,[Thread-25],com.cisco.nm.rmeng.inventory.ics.core.ICSCore,179,Request ID is : 1289919235488
[ Di Nov 16 15:54:27 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.inventory.ics.core.CollectionController,309,Started processing device ID: 3341
[ Di Nov 16 15:54:27 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.util.logger.RMELogger,724,com.cisco.nm.rmeng.util.db.DatabaseConnectionPool,getConnection,59,Inside ICSDatabaseConnection, MAX_COUNT =20
[ Di Nov 16 15:54:28 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.inventory.ics.core.CollectionController,387,Started processing device Name: 9.152.255.101
[ Di Nov 16 15:54:28 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.util.logger.XDILogger,77,com.cisco.nm.xms.xdi.pkgs.SharedInventoryCatIOS.ContainmentAGI_ENTITY_Mib_Non_Modular,g$eval,103,com.cisco.nm.xms.xdi.pkgs.SharedInventoryRouter:ContainmentAGI_ENTITY_Mib_Non_Modular:g$eval:populating ContainmentAG attributes, begins...
[ Di Nov 16 15:54:28 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.util.logger.XDILogger,77,com.cisco.nm.xms.xdi.pkgs.SharedInventoryCatIOS.ContainmentAGI_ENTITY_Mib_Non_Modular,populatingTheChassis,110,com.cisco.nm.xms.xdi.pkgs.SharedInventoryRouter:ContainmentAGI_ENTITY_Mib_Non_Modular:populatingTheChassis:ContainmentAG attributes,collection from the device begins...
[ Di Nov 16 15:54:29 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.util.logger.XDILogger,77,com.cisco.nm.xms.xdi.pkgs.SharedInventoryCatIOS.ContainmentAGI_ENTITY_Mib_Non_Modular,populatingTheChassis,147,com.cisco.nm.xms.xdi.pkgs.SharedInventoryRouter:ContainmentAGI_ENTITY_Mib_Non_Modular:populatingTheChassis:ContainmentAG attributes,collection from the device successful...
[ Di Nov 16 15:54:29 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.util.logger.XDILogger,77,com.cisco.nm.xms.xdi.pkgs.SharedInventoryCatIOS.ContainmentAGI_ENTITY_Mib_Non_Modular,populatingTheChassis,149,com.cisco.nm.xms.xdi.pkgs.SharedInventoryRouter:ContainmentAGI_ENTITY_Mib_Non_Modular:populatingTheChassis:ContainmentAG attributes,population begins...
[ Di Nov 16 15:54:29 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.util.logger.XDILogger,77,com.cisco.nm.xms.xdi.pkgs.SharedInventoryCatIOS.ContainmentAGI_ENTITY_Mib_Non_Modular,populatingTheChassis,216,com.cisco.nm.xms.xdi.pkgs.SharedInventoryRouter:ContainmentAGI_ENTITY_Mib_Non_Modular:populatingTheChassis:Before method getSlotsConfiguredStatistics
[ Di Nov 16 15:54:29 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.util.logger.XDILogger,77,com.cisco.nm.xms.xdi.pkgs.SharedInventoryCatIOS.ContainmentAGI_ENTITY_Mib_Non_Modular,populatingTheChassis,225,com.cisco.nm.xms.xdi.pkgs.SharedInventoryRouter:ContainmentAGI_ENTITY_Mib_Non_Modular:populatingTheChassis:After method getSlotsConfiguredStatistics
[ Di Nov 16 15:54:29 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.util.logger.XDILogger,77,com.cisco.nm.xms.xdi.pkgs.SharedInventoryCatIOS.ContainmentAGI_ENTITY_Mib_Non_Modular,populatingTheChassis,245,com.cisco.nm.xms.xdi.pkgs.SharedInventoryRouter:ContainmentAGI_ENTITY_Mib_Non_Modular:populatingTheChassis:ContainmentAG attributes,population completed...
[ Di Nov 16 15:54:29 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.util.logger.XDILogger,77,com.cisco.nm.xms.xdi.pkgs.SharedInventoryCatIOS.ContainmentAGI_ENTITY_Mib_Non_Modular,g$eval,105,com.cisco.nm.xms.xdi.pkgs.SharedInventoryRouter:ContainmentAGI_ENTITY_Mib_Non_Modular:g$eval:populating ContainmentAG attributes, ends...
[ Di Nov 16 15:54:43 CET 2010 ],INFO ,[Thread-14],com.cisco.nm.rmeng.inventory.ics.core.CollectionController,477,DP time is 15 seconds for 9.152.255.101
[ Di Nov 16 15:54:44 CET 2010 ],ERROR,[Thread-14],com.cisco.nm.rmeng.util.logger.RMELogger,770,com.cisco.nm.rmeng.inventory.ics.invchange.AddInvChange,effect,33,Unexpected error :com.sybase.jdbc2.jdbc.SybSQLException: ASA Fehler -193: Primärschlüssel für Tabelle 'PhysicalElement' ist nicht eindeutig
at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2834)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:2156)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:220)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:203)
at com.sybase.jdbc2.jdbc.SybStatement.executeLoop(SybStatement.java:1766)
at com.sybase.jdbc2.jdbc.SybStatement.execute(SybStatement.java:1758)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.execute(SybPreparedStatement.java:619)
at com.cisco.nm.rmeng.inventory.ics.dbrep.DBRecord.insert(DBRecord.java:50)
at com.cisco.nm.rmeng.inventory.ics.util.ICSDatabaseConnection.insert(ICSDatabaseConnection.java:91)
at com.cisco.nm.rmeng.inventory.ics.invchange.AddInvChange.effect(AddInvChange.java:29)
at com.cisco.nm.rmeng.inventory.ics.server.InvDataProcessor.processInvData(InvDataProcessor.java:394)
at com.cisco.nm.rmeng.inventory.ics.core.CollectionController.run(CollectionController.java:849)
at java.lang.Thread.run(Thread.java:534)
[ Di Nov 16 15:54:44 CET 2010 ],ERROR,[Thread-14],com.cisco.nm.rmeng.inventory.ics.server.InvDataProcessor,448,ASA Fehler -193: Primärschlüssel für Tabelle 'PhysicalElement' ist nicht eindeutig
com.sybase.jdbc2.jdbc.SybSQLException: ASA Fehler -193: Primärschlüssel für Tabelle 'PhysicalElement' ist nicht eindeutig
at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2834)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:2156)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:220)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:203)
at com.sybase.jdbc2.jdbc.SybStatement.executeLoop(SybStatement.java:1766)
at com.sybase.jdbc2.jdbc.SybStatement.execute(SybStatement.java:1758)
at com.sybase.jdbc2.jdbc.SybPreparedStatement.execute(SybPreparedStatement.java:619)
at com.cisco.nm.rmeng.inventory.ics.dbrep.DBRecord.insert(DBRecord.java:50)
at com.cisco.nm.rmeng.inventory.ics.util.ICSDatabaseConnection.insert(ICSDatabaseConnection.java:91)
at com.cisco.nm.rmeng.inventory.ics.invchange.AddInvChange.effect(AddInvChange.java:29)
at com.cisco.nm.rmeng.inventory.ics.server.InvDataProcessor.processInvData(InvDataProcessor.java:394)
at com.cisco.nm.rmeng.inventory.ics.core.CollectionController.run(CollectionController.java:849)
at java.lang.Thread.run(Thread.java:534)
[ Di Nov 16 15:54:44 CET 2010 ],ERROR,[Thread-14],com.cisco.nm.rmeng.inventory.ics.core.CollectionController,861, Exception occured in process method while processing: 9.152.255.101 ASA Fehler -193: Primärschlüssel für Tabelle 'PhysicalElement' ist nicht eindeutig
ICSException :: ASA Fehler -193: Primärschlüssel für Tabelle 'PhysicalElement' ist nicht eindeutig
at com.cisco.nm.rmeng.inventory.ics.server.InvDataProcessor.processInvData(InvDataProcessor.java:463)
at com.cisco.nm.rmeng.inventory.ics.core.CollectionController.run(CollectionController.java:849)
at java.lang.Thread.run(Thread.java:534)
I don't know where the German error message comes from. The whole system is English. Translation is: "ASA error -192: primary key for table 'PhysicalElement' isn't distinct'
Thanks for your help!
AlexWell known issue in LMS 2.6. Most likely you are hitting CSCsm97530. As a temporary solution you could remove and re-add problematic device from CS. To get a permanent fix you need a patch (provided by TAC).
-
Question on using CAST, MULTISET and TABLE
Hi,
I am trying to do something that is utterly meaningless, but I am studying the use of CAST with MULTISET and TABLE.
I have created a type: a Nested Table of Number values:
create type numTable as table of number;
Now I perform the following query:
select d.dname
, ( select avg(column_value)
from table
( cast( d.salaries as numTable)
) Department_Avg_Salary
from ( select cast
( multiset
( select e.sal
from emp e
where e.deptno = d1.deptno
) as numTable
) salaries
, d1.dname
from dept d1
) d
I had expected to see each department name and the average salary within that department. Instead, I see the same Department_Avg_Salary value for each row - the average of the first department:
DNAME DEPARTMENT_AVG_SALARY
ACCOUNTING 1875
RESEARCH 1875
SALES 1875
OPERATIONS 1875
However, when I change the query to the following:
select d.dname
, d.salaries
from ( select cast
( multiset
( select e.sal
from emp e
where e.deptno = d1.deptno
) as numTable
) salaries
, d1.dname
from dept d1
) d
I get the following result - note that each department shows the correct list of salaries, not the list of the 1st department's salaries over and over.
DNAME
SALARIES
---------------------------------------------------------ACCOUNTING
NUMTABLE(2450, 1300)
RESEARCH
NUMTABLE(800, 2975, 3000, 5000, 1100, 3000)
SALES
NUMTABLE(1600, 1250, 1250, 2850, 1500, 950)
OPERATIONS
NUMTABLE()
Can someone explain why the
, ( select avg(column_value)
from table
( cast( d.salaries as numTable)
) Department_Avg_Salary
does not give an average per department but instead only the first department's average?
thanks for your help!
regards
Lucas Jellemascott@ORA92> select d.dname,
2 (select avg(column_value)
3 from table (cast (d.salaries as numTable))
4 where d.dname = dname) Department_Avg_Salary
5 from (select cast (multiset (select e.sal
6 from emp e
7 where e.deptno = d1.deptno) as numTable) salaries,
8 d1.dname
9 from dept d1) d
10 /
DNAME DEPARTMENT_AVG_SALARY
ACCOUNTING 2916.66667
RESEARCH 2175
SALES 1566.66667
OPERATIONS -
Error in output determination via collective billing VF06
Hi,
We are facing error in output determination when collective billing is done. Multiple Orders numbers are entered in VF06 and processed to generate billing documents. VF06, which is used for batch billing, creates a batch job which internally calls VF04 to do this. For some of the invoices generated from the documents, we do not have anything in the Output, i.e. when we open the invoices in VF03 and go to Goto->Header ->Output, nothing appears.
Say out of the 5 documents, 2 should have output determined and 3 do not. Then we see that it appears for either of the 2 or does not appear at all.
This does not happens when the documents are processed one by one in VF04. We have to do collective billing and generate one invoice for each document. The condition records are also maintained correctly.
Regards,
TarunGo to some of the invoices on which no output has appeared in change mode and do a output determination analysis in Go to Header-Output and then Ouptut Determinatino analysis.
Please do this analysis for atleast 10 problamatic invoices. This will give yousome insight into the problem -
hi I have the following error message : iTunes could not collect to the iPodan error orccurered (0xE8000084) I
iPhone, iPad, iPod touch: Unknown error containing '0xE' when connecting
-
Hi
LMS 4.2.4 inventory collection fails with Error RICS0001:Internal Error,unable to process the collected data from the device for few devices.
Can anyone help me out.
Regards
LaxmiThey are definately supported. However such issues are usually due to device packages, if unavailable or not installed.
Please do following :
1. Check Admin > software centre > device updates and check any devices packages available in Cisco.com and install it and recheck.
2. Please do a snmpwalk on problematic device on sysObjectID and share result. Following is the way to do snmpwalk :
GUI - Open the device in Device Centre (Inventory > Tools > Device Center) and open the device with IP and from tools select snmpwalk and do it for sysObjectID (1.3.6.1.2.1.1.2)
CLI : CD to NMSROOT/objects/jt/bin from command prompt. run command as per following syntax:
snmpwalk -v2c -c <snmp_community_string> 1.3.6.1.2.1.1.2
Example :
community string = test123
IP = 10.1.1.1
snmpwalk -v2c -c test123 10.1.1.1 1.3.6.1.2.1.1.2
3. Please check your device package, by clicking on the number of packages in front of Inventory, conifg and image management from :
Admin > System > Software Center > Device Update
Also, check device identity under edit identity option from :
Inventory > Device Administration > Add / Import / Manage Devices
Check my screenshots for details :
Please check and share results.
-Thanks
Vinod
**Rating Encourages contributors, and its really free. ** -
Hello,
I have a problem with inventory collection from several devices getting
"RICS0001:Internal Error,unable to process the collected data from the device."
ERROR,[Thread-20],com.cisco.nm.rmeng.inventory.ics.server.InvDataProcessor,918,Device does not exist in RME, Please check if device is already deletedDid you schedule an inventory collection job?
Delete schedule and recreate it using device group.
Cheers,
Michel -
Error: unable to download document : "collection/default"
Got the following error message when launched the Update Manager Client GUI:
Error: Unable to download document : "collection/default" Cannot connect to retrieve collection/default: Internal Server Error.
I have just installed Sun Update Manager Proxy server and Sun Update Manager Client software in two sun servers. I configured the client to get update from the Update Manager Proxy server. I haven't register the Proxy server yet.
I have verified that Update Manager Proxy server is up and running by browsing the url of the Update Manager Proxy server.
I wonder if the error is because the Proxy server has no updates yet or it is because it is not registered yet.Furthermore: I also tried the following on the client:
# smpatch analyze
and got the following error message
Failure: Cannot connect to retrieve detectors: Internal Server Error.
A look in the /var/adm/messages shows the following:
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://solaris0.sd.ny.frb.org:3816/solaris
Jun 27 14:10:46 b1osdtsun05 root: [ID 702911 user.crit] => com.sun.patchpro.cli.PatchServices@fb56b1 <=null at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1133)
Jun 27 14:10:46 b1osdtsun05 at com.sun.patchpro.util.Downloader.connectToURL(Downloader.java:358)
Jun 27 14:10:46 b1osdtsun05 ... 15 more
Maybe you are looking for
-
Hello! In the PPOME you can create an appendix for the position objtyp=S. Where is this appendix saved? How can I access the document? I want to write a report where I read the appendix from position out. Can anybody please help me?
-
Charging for first time: Will Itunes auto sync ?
I'm about to charge a new 4 gHz Nano for the first time , using a Windows XP PC. I will charge it for a few hours in advance of giving it to my son for his birthday tomrrow. One quick question... We currently have Itunes 7.0 on the PC with two differ
-
MSOL Created AD Account and Group -
I've recently installed Forefront Identity Manager 2010 R2 and we are in the process of creating a tenant connection to Office 365 and setting up Exchange Federation. I have installed FIM 2010 R2 and have setup DIRSYNC, and we've noticed an account a
-
Hi All, I am facing a strange issue. I have forecast in D1 and D2 in Demantra DM. This published to ASCP. ASCP runs with D1,D2 and M1 organization where M1 is central purchasing. All the demand from D1 and D2 is fulfilled in M1. Dependent demand from
-
I just got my zen micro so i took it home and got all excited, so i plugged the micro straight into the pc, then i looked at the instructions and it said WARNING:do not insert the zen micro before installing software! so i just installed the software