How to manipulate nested varrays?
This is my Schema. "Botany" table has this attribute called content_ip which is of type IP_TY. IP_ty is described below.
DESC botany
Name Null Type
LANG VARCHAR2(15)
AUTHOR VARCHAR2(15)
CHAPTER_NO NUMBER
TITLE VARCHAR2(15)
CONTENT VARCHAR2(15)
CONTENT_IP IP_TY()
DATE_PUBLISHED DATE
LAST_UPDATE DATE
DESC ip_ty
user type definition
TYPE ip_ty
AS OBJECT
aip aip_ty, cip cip_ty, pip pip_ty
DESC aip_ty
user type definition
TYPE aip_ty AS VARRAY(3) OF VARCHAR(15)
DESC cip_ty
user type definition
TYPE cip_ty AS VARRAY(3) OF VARCHAR(15)
DESC pip_ty
user type definition
TYPE pip_ty AS VARRAY(3) OF VARCHAR(15)
SELECT bot.content_ip.aip, bot.content_ip.cip, bot.content_ip.pip
FROM botany bot
here is the output for the above queries.
CONTENT_IP.AIP CONTENT_IP.CIP CONTENT_IP.PIP JOEY.AIP_TY('administration','write') JOEY.CIP_TY('marketing') JOEY.PIP_TY('guest')
the problem is how do i get the output without the leading JOEY.AIP_TY or JOEY.CIP_TY.
is the above schema too much screwed :( ?
will casting ip_ty to a table do the trick? i have tried. but vain. maybe it failed due to my ignorance. shed some light if "casting" will remove those leading text.
Edited by: joe7 on Feb 19, 2010 10:48 PM
will casting ip_ty to a table do the trick?not sure what you are after, but maybe you mean sth like
SQL> create or replace type ip_ty as object
(aip sys.odcivarchar2list,
cip sys.odcivarchar2list,
pip sys.odcivarchar2list
Type created.
SQL> with botany
as (select ip_ty (sys.odcivarchar2list ('some aip'),
sys.odcivarchar2list ('some cip'),
sys.odcivarchar2list ('some pip1', 'some pip2')
) content_ip
from dual
select aip.column_value aip, cip.column_value cip, pip.column_value pip
from botany t,
table (t.content_ip.aip) aip,
table (t.content_ip.cip) cip,
table (t.content_ip.pip) pip
AIP CIP PIP
some aip some cip some pip1
some aip some cip some pip2
2 rows selected.
Similar Messages
-
How to put Nested List in HTMLDocument in JTextPane(JEditorPane)
How to put Nested List in HTMLDocument in JTextPane(JEditorPane). I was trying to put nested Bullets and Numbering but found that not enough support is provided for it. The HTMLEditorKit behaves abnormally.
There are two ways to do that:
1) just extract the whole text by getText, but the problem is you don't have the postion where the cursor was when the event was triggered so u can't add ur text to it , even if u extracted the text at cursor there can be multiple copies, so no way...also if u change it and reinsert the whole text the atributeset for whole text is lost.
2) So the only way is work with jugglery of Elements, which is full of bugs. I find it very difficult to move backward in it and insert a tag around a tag. Such a simple thing and almost no way. If anybody has any ideas please mail me.
Thanx in AdvanceSettings > Mail, Contacts, Calendars > Contacts > Sort Order/Display Order 'First, Last'
-
Hi guys
I have this XML returned to my app:
<menu>
<categoria nome="cat1">
<item>item 1</item>
<item>item 2</item>
<item>item 3</item>
</categoria>
<categoria nome="cat2">
<item>item 1b</item>
<item>item 2b</item>
<item>item 3b</item>
</categoria>
<categoria nome="cat3">
<item>item 1c</item>
<item>item 2c</item>
<item>item 3c</item>
</categoria>
</menu>
this is retrieved by an HTTPService
<mx:HTTPService id="xmlMenu" url="data/menu.xml"
method="POST" useProxy="false" result="handler()"
resultFormat="e4x" />
How to manipulate the XML data in then result handler using
action script?
- show nodes length
- get the atribute of node categoria
- get to the values of node item
i've tried
xmlMenu.lastResult.menu.length.toString()
xmlMenu.lastResult.menu.categoria[0].length.toString()
xmlMenu.lastResult.menu.categoria[0].@nome
xmlMenu.lastResult.menu.categoria[0].item[0]
nothing happensA better way to get the result is:
<mx:HTTPService ..result="handler(event)"
and in the handler:
private function handler(oEvent:ResultEvent):void //might
need to import ResultEvent
var xmlMenu:XML = oEvent.result;
trace(xmlMenu.toXMLString())
Now you can use the e4x expressions;
trace(xmlMenu.categoria[0].item[0]); //ashould trace "item 1"
Tracy -
How to send nested object collection to PL/SQL Procedure as an Input param
How to send nested object collection to PL/SQL Procedure as an Input parameter.
The scenario is there is a parent mapping object containing a collection(java.sql.Array) of child objects.
I need to send the parent object collection to PL/SQL procedure as a input parameter.
public class parent{
String attr1;
String attr2;
Child[] attr3;
public class Child{
String attr1;
SubChild[] attr2;
public class SubChild{
String attr1;
Urgent!!!
Edited by: javiost on Apr 30, 2008 2:09 AMjaviost wrote:
How to send nested object collection to PL/SQL Procedure as an Input parameter.There are a few ways to do this, all of which likely depend on the particular database you're using.
Urgent!!!Not to me... -
How to use nested tag in Struts
Hi..
Can any one guide me how to use nested tag in Struts. So far i already tried bean tag with no error but when i try to use nested tag i got error like
javax.servlet.ServletException: Cannot find bean: "" in any scope
Below are my class:
action class
session.setAttribute ("MyDetailList", detailList);
JSP page
<logic:iterate id="list" name="MyDetailList">
Company ID : <bean:write name="list" property="companyID" />
</logic:iterate>
For bean tag, i got no error at all and below are my code for nested tag
action class
session.setAttribute ("MyDetailList", detailList);
JSP Page
<nested:nest property="MyDetailList">
Make : <nested:text property="make"/>
Car ID : <nested:text property="carID"/>
</nested:nest>
When i run the code, i got error message
javax.servlet.ServletException: Cannot find bean: "" in any scope
Any body can help me?
zulwhat am I doing wrong?You will notice above that I mentioned
YOU CAN'T USE CUSTOM TAGS AS ATTRIBUTES TO OTHER CUSTOM TAGS
(was that loud enough for you to notice this time)?
Try
<html:text styleId="instruction" styleClass="text" size="50" name="instruction" property="value"/>
//or
<html:text styleId="instruction" styleClass="text" size="50" property="instruction" value="<%= instruction.getValue() %>"/>
better alternative: populate your formbean with your action and just have:
<html:text styleId="instruction" styleClass="text" size="50" property="instruction"/>
If you set the "instruction" property of your formBean in the action, the value will be automagically reflected here.
Cheers,
evnafets -
How can I nest Tabbed Panels 2
I am trying to learn HTML and need help using Tabbed Panels 2.
I have three defualt tabs which are very simple to do but how can i nest four tabs with content inside one of the defualt tabs?
Link to Documentation.Haven’t begun to try it yet. Looking at some tutorials.
But I appreciate the heads up.
Bill Liedlich
TerraGroup Corporation
Tactical Water Purification Systems
Po Box 8839
Allentown, PA 18105 USA
p 610-821-7003
f 610-821-7025
[email protected]
[email protected]<mailto:[email protected]>
www.tacticalwater.com<http://www.tacticalwater.com/>
CONFIDENTIALITY NOTICE: This electronic mail transmission, its contents and any attachments to it, are privileged and confidential, and/or may contain legally privileged and confidential information and is intended only for the review of the party or parties to whom it is addressed. Any dissemination, distribution, copying or forwarding of this message, its contents or attachments to other than the intended recipient(s) is strictly prohibited. If you are not one of the intended recipients, or have received this transmission and its contents in error, please immediately return it to the sender. Unintended transmission shall not constitute a waiver of any "Confidentiality Notice" privilege. -
How to create nested CASE statements in PL/SQL
Can anyone please tell how to create Nested CASE statements in PL/SQL with proper syntax?
It would be better if you can help with an example.
Thank you!Something like this:
SQL> set serveroutput on
SQL> declare
2 v1 number := 2;
3 v2 varchar2(1) := 'C';
4 begin
5 case v1
6 when 1 then dbms_output.put_line('First');
7 when 2 then begin
8 case v2
9 when 'A' then dbms_output.put_line('Found A');
10 when 'B' then dbms_output.put_line('Found B');
11 when 'C' then dbms_output.put_line('Found C');
12 else dbms_output.put_line('NONE');
13 end case;
14 end;
15 else dbms_output.put_line('Else');
16 end case;
17 end;
18 /
Found C
PL/SQL procedure successfully completed
SQL> If you have further doubts regarding syntax you can read the docs on the Case statement here:
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10472/case_statement.htm -
Hi.
Does anyone know how to make nested table.
Just like in MS access, if one row of data in a table has the same key as another set of data in other table you can expand the row so that it show an other table of data inside it. the popup table also has the Table header of its own. I have looked at TreeTable tutorial but i don't know how to extend that to nested table.hi, define a tablecellrenderer for your table(me be one type per row) and let him bring back your popup table in that cells(rows) you want.
-
How to get nested table meta data
how to get nested table column name, column type and column size
by using java. i need code for this.
please help me.The Follopwing program does display the the details of table. Hope you get the solution
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
public class Main {
public static void main(String[] args) throws Exception {
Connection conn = getOracleConnection();
System.out.println("Got Connection.");
Statement st = conn.createStatement();
st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM SCHEDULE_SET");
ResultSetMetaData rsMetaData = rs.getMetaData();
int numberOfColumns = rsMetaData.getColumnCount();
System.out.println("resultSet MetaData column Count=" + numberOfColumns);
for (int i = 1; i <= numberOfColumns; i++) {
System.out.println("column MetaData ");
System.out.println("column number " + i);
// indicates the designated column's normal maximum width in
// characters
System.out.println(rsMetaData.getColumnDisplaySize(i));
// gets the designated column's suggested title
// for use in printouts and displays.
System.out.println(rsMetaData.getColumnLabel(i));
// get the designated column's name.
System.out.println(rsMetaData.getColumnName(i));
// get the designated column's SQL type.
System.out.println(rsMetaData.getColumnType(i));
// get the designated column's SQL type name.
System.out.println(rsMetaData.getColumnTypeName(i));
// get the designated column's class name.
System.out.println(rsMetaData.getColumnClassName(i));
// get the designated column's table name.
System.out.println(rsMetaData.getTableName(i));
// get the designated column's number of decimal digits.
System.out.println(rsMetaData.getPrecision(i));
// gets the designated column's number of
// digits to right of the decimal point.
System.out.println(rsMetaData.getScale(i));
// indicates whether the designated column is
// automatically numbered, thus read-only.
System.out.println(rsMetaData.isAutoIncrement(i));
// indicates whether the designated column is a cash value.
System.out.println(rsMetaData.isCurrency(i));
// indicates whether a write on the designated
// column will succeed.
System.out.println(rsMetaData.isWritable(i));
// indicates whether a write on the designated
// column will definitely succeed.
System.out.println(rsMetaData.isDefinitelyWritable(i));
// indicates the nullability of values
// in the designated column.
System.out.println(rsMetaData.isNullable(i));
// Indicates whether the designated column
// is definitely not writable.
System.out.println(rsMetaData.isReadOnly(i));
// Indicates whether a column's case matters
// in the designated column.
System.out.println(rsMetaData.isCaseSensitive(i));
// Indicates whether a column's case matters
// in the designated column.
System.out.println(rsMetaData.isSearchable(i));
// indicates whether values in the designated
// column are signed numbers.
System.out.println(rsMetaData.isSigned(i));
// Gets the designated column's table's catalog name.
System.out.println(rsMetaData.getCatalogName(i));
// Gets the designated column's table's schema name.
System.out.println(rsMetaData.getSchemaName(i));
st.close();
conn.close();
public static Connection getOracleConnection() throws Exception {
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@son15644:1521:CXPqa1";
String username = "ess4qa2";
String password = "ess4qa2pw";
Class.forName(driver); // load Oracle driver
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
} -
Help! - How to create nested comps with AEGP suites
I want to be able to create a nested composition....I know that when you create, let's say, comp 1 and then a separate comp 2 and then drag comp2 into comp1, comp2 becomes one layer in comp1. Comp2 would be called a "precomposition"
So I want to be able to do this in my program, using AEGP calls...I tried just adding a composition as a layer to another (parent) composition, like footage is added as a layer to the current comp.
There was another post that talked about using the Collection suite, but I'm not sure how to actually use it to implement a nested comp.
I tried getting a collection from the comp I want to be nested, setting the current (parent) comp's selection to be the nested comp's collection, and tried the DoCommand(2071) to precompose the collection, but obviously this didn't work because it doesn't really make sense to do that, haha.
Intuitively I wanted to call AddLayer from the current comp, passing in a child comp to be added as a layer. Adobe told me item cannot be added as source to layer so the way to do this must be more subtle than I thought.
If I have to use collections, do I make a collection out of the current comp and add subsequent comps to the collection? That doesn't make sense either. How is a nested comp added as a layer to another comp?
Can anyone help me? Email me if you have any suggestions: [email protected]
Thanks!!Hi Sara,
I responded to your email, but just to follow up on the forum:
Say you've created two comps using AEGP_CreateComp. That gives you two AEGP_CompHs. To nest one comp in another, you'll first need to get the AEGP_ItemH for the nested comp, so use AEGP_GetItemFromComp. You can now add the AEGP_ItemH of the nested comp as a layer using AEGP_AddLayer. That should do the trick. And AEGP_ReorderLayer if needed.
Cheers,
Zac -
How to parse nested xml file using dom
i want to parse nested xml file
please tell me how to parse nested xml
for eg.
<xml>
<row>
<name>Rahul<name>
<row><newXml>
<newXML>
<Row>
<code>12</code>
</Row>
<newXML>
<XML>
please tell how to parse this fileNormally if you have no idea about X, the first thing you should do is google "X tutorial". You will find plenty of them out there. And the advantage is, they are better written than whatever we spend two minutes throwing together here. Not to mention that it saves us the two minutes.
But if you have specific questions with your SAX parser when you get it going, then ask them here. Actually, ask them in the XML forum here, not this one. -
How to create nested Handling units at VL01n Outbound delivery
Hi
Please assist me
How to create Nested Handling units at the time of Outbound delivery VL01nHi,
go to Edit-Pack,
In First tab will be "Pack Material", give Packing Materials & enter. You will get a HU Number generated. select this line & the line in Material to be packed. Click on Pack button. The material is packed into a HU.
Now go to Second tab "Pack HUs". Here also give Packing Materials & enter. You will get a HU Number generated. select this line & the line in All Handling Units that can be packed. Click on Pack button. The HU is packed into another HU.
Nagesh -
How to use nested table values in IN expression?
Hi!
Can someone please give me a hint to the correct syntax for this:
declare
TYPE numtable is table of number;
tt numtable;
begin
select myId bulk collect into tt from some_table;
update some_other_table set name = 'kakadu' where xId in (select * from tt); -- this line is wrong as it is
end;What I am doing is fixing a stored procedure that was like this before:
update table_a set name = 'kakadu' where column_X in (select one.A from table_1 one join table_a on x y z WHERE a b c);
update table_b set name = 'nimfa' where column_Y in (select one.B from table_1 one join table_a on x y z WHERE a b c);The problem is, the first UPDATE changes the result of the SELECT, so I want to "remember" it.
A and B are columns in table_1, A is the primary key. So the fixed code would be like:
-- store the list of selected IDs from table_1
select A bulk collect into tt from table_1 one join table_a on x y z WHERE a b c ; -- same conditions as in old code
-- do the updates
update table_a set name = 'kakadu' where column_X in (select * from tt);
update table_b set name = 'nimfa' where column_Y in (select one.B from table_1 one where one.A in tt);(it can be a varray instead of nested table, as far as I am concerned)
Thanks,
DavidYes, it needs to be a SQL type
Re: How to pass an array to a function from a SELECT statement
Or you can use a built in SQL type (version dependent)
Re: Collection in where not working -
How to use nested tables object in oracle form
Hello forum
How all r u ..
i need ur help guys, pls help me out...
i m using an object oriented approach to design my database by using nested tables and
varrays. it is quite done successfully.
but the problem is when i m trying to use that object of nested table into the datablock of the form it is not been added to item list of that block.
so what is the proper way to use these type of objects to the form.
all ideas are welcomed and vry much required.
pls give example if possible so easy to understand or have any demo form related to above case then pls post me to my id i.e [email protected]
thank u all and expecting some expert solutionsHello Francois Degrelle...
How r u doing ... i have searched the forum abt the above mentioned topic then i found that u have some demo form which will help out to explain the functionality of the nested table in forms ..
will u pls me that form to my i.e [email protected] pls mail all the detail u have regarding using nested tables to forms and reports
lots of thanks to u n advance. -
How to manipulate multiple records in side the cursor
DECLARE
CURSOR C1 IS
SELECT ITEM_CODE,AVERAGE_COST,STORE_CODE
FROM IM_GOODS_RECIEVE_DETAILS
WHERE DOC_CODE = :IM_GOODS_RECIEVE_DETAILS.DOC_CODE;
LOC_DOC_CODE VARCHAR2(10);
LOC_ITEM_CODE VARCHAR2(30);
LOC_ITEM_QUANTITY NUMBER(12,3);
LOC_TOTAL_COST NUMBER(12,3);
LOC_AVERAGE_COST NUMBER(12,3);
BEGIN
FOR R IN C1
LOOP
-- THIS FOR ISSUED ITEMS QUANTITY
SELECT B.ITEM_CODE,NVL(ITEM_QUANTITY,0),A.DOC_CODE,AVERAGE_COST,TOTAL_COST
INTO LOC_ITEM_CODE,LOC_ITEM_QUANTITY,LOC_DOC_CODE,LOC_AVERAGE_COST,LOC_TOTAL_COST
FROM IM_TRANS_ISSUE_HEADER A,IM_TRANS_ISSUE_DETAILS B
WHERE A.DOC_CODE = B.DOC_CODE
AND B.DEL_STORE = R.STORE_CODE
AND ITEM_CODE = R.ITEM_CODE
AND DOC_DATE BETWEEN :IM_GOODS_RECIEVE_HEADER.DOC_DATE AND :EXPENSES_TAB.EXP_DATE
ORDER BY
B.ITEM_CODE;
SHOW_MESSAGE('LOC_DOC_CODE'||' '||LOC_DOC_CODE);
SHOW_MESSAGE('ITEM_CODE ->' ||' '||LOC_ITEM_CODE);
SHOW_MESSAGE('LOC_ITEM_QUANTITY'||' '||LOC_ITEM_QUANTITY);
SHOW_MESSAGE('LOC_AVERAGE_COST'||' '||LOC_AVERAGE_COST);
SHOW_MESSAGE('LOC_TOTAL_COST '||' '||LOC_TOTAL_COST );
UPDATE IM_TRANS_ISSUE_DETAILS
SET AVERAGE_COST = :NEW_AVERAGE_COST,TOTAL_COST = :NEW_AVERAGE_COST * LOC_ITEM_QUANTITY
WHERE DOC_CODE = LOC_DOC_CODE
AND ITEM_CODE = LOC_ITEM_CODE ;
END LOOP;
COMMIT;
SHOW_MESSAGE('The New Cost Price updated !!!');
END;
This script it will work if the select statment inside the loop return one record , but if it return more than one record it will give error
how can i hanlde the above select statment
waiting for your valuable answer with example please .
my email : [email protected]
Best regards
Jamil Alshaibaniit has been answered as the following :
DECLARE
CURSOR C1 IS
SELECT ITEM_CODE,AVERAGE_COST,STORE_CODE
FROM IM_GOODS_RECIEVE_DETAILS
WHERE DOC_CODE = :IM_GOODS_RECIEVE_DETAILS.DOC_CODE;
LOC_DOC_CODE VARCHAR2(10);
LOC_ITEM_CODE VARCHAR2(30);
LOC_ITEM_QUANTITY NUMBER(12,3);
LOC_TOTAL_COST NUMBER(12,3);
LOC_AVERAGE_COST NUMBER(12,3);
BEGIN
FOR R IN C1
LOOP
-- THIS FOR ISSUED ITEMS QUANTITY, it will work if there is only one record,
-- but if the select statment below return more than one record it will give
-- error how can I manipulate all the records in the IM_TRANS_ISSUE_DETAILS table
FOR R2 IN (
SELECT B.ITEM_CODE as LOC_ITEM_CODE, NVL(ITEM_QUANTITY,0) as LOC_ITEM_QUANTITY,
A.DOC_CODE as LOC_DOC_CODE, AVERAGE_COST as LOC_AVERAGE_COST,
TOTAL_COST as LOC_TOTAL_COST
-- INTO LOC_ITEM_CODE,LOC_ITEM_QUANTITY,LOC_DOC_CODE,LOC_AVERAGE_COST,LOC_TOTAL_COST
FROM IM_TRANS_ISSUE_HEADER A,IM_TRANS_ISSUE_DETAILS B
WHERE A.DOC_CODE = B.DOC_CODE
AND B.DEL_STORE = R.STORE_CODE
AND ITEM_CODE = R.ITEM_CODE
AND DOC_DATE BETWEEN :IM_GOODS_RECIEVE_HEADER.DOC_DATE
AND :EXPENSES_TAB.EXP_DATE
ORDER BY B.ITEM_CODE )
LOOP
SHOW_MESSAGE('LOC_DOC_CODE' ||' '||R2. LOC_DOC_CODE);
SHOW_MESSAGE('ITEM_CODE ->' ||' '||R2. LOC_ITEM_CODE);
SHOW_MESSAGE('LOC_ITEM_QUANTITY'||' '||R2. LOC_ITEM_QUANTITY);
SHOW_MESSAGE('LOC_AVERAGE_COST' ||' '||R2. LOC_AVERAGE_COST);
SHOW_MESSAGE('LOC_TOTAL_COST ' ||' '||R2. LOC_TOTAL_COST );
UPDATE IM_TRANS_ISSUE_DETAILS
SET AVERAGE_COST = :AVERAGE_COST,
TOTAL_COST = :AVERAGE_COST * R2. LOC_ITEM_QUANTITY
WHERE DOC_CODE = R2. LOC_DOC_CODE
AND ITEM_CODE = R2. LOC_ITEM_CODE ;
END LOOP;
END LOOP;
COMMIT;
SHOW_MESSAGE('The New Cost Price updated !!!');
END;
Maybe you are looking for
-
Help! Can some one check it?
I keep getting the following run-time message when I run it in Win2K command prompt: C:\Data\xdss\Solutions>javac CSVtoXML.java C:\Data\xdss\Solutions>java CSVtoXML order_data.csv order_data.xml Exception in thread "main" java.lang.NoClassDefFoundErr
-
My ct's requirement is to create AR Invoice for Purchase Returns. I don't think this integration is provided out of the box. Has anyone else faced this requirement before and what solution did you implement? If you had to customize, how hard was it t
-
I have a page http://ebogott.com/index08more.php that is the prototype new home page for my site. The "last updated..." line appers to the right of the XML table ONLY in OPERA. Everywhere else, it aligns correctly. I can find no code problems. The
-
Hi How do I maintain a session in the scenario below: (1) Servlet A creates a session (2) Servlet A dispatch JSP A (3) JSP A capture some user inputs and post to Servlet B So far both (1) and (2) are working fine, but to get on to (3) the session is
-
i'm going to be getting a thermaltake purepower 420W in the next couple of days and i'm just double checking to see whether anyone has had any experiences and/or problems with this and their kt4s or k7n2s (delta will be my next mobo). i've read many