Insert the hyphen or a number to designate the child node
I have a query that returns the parent node and the children of this one up to certain level. Like this:sort_order nodes
00001 NOde1 - parent1
0000100001 Node2 - child1of parent1
000010000100001 Node3 - child1 Node2
and so on.
I want to format it like this :
- Node1 - parent1
-Node2 - child1 of parent1
-Node3 - child of Node2
-BNode1 -another parent
-BNode2 - child of Bnode1
-BNode3 - child of Bnode1
-Bnode4 - child of Bnode3
How can I do thisThnx
Hello
OAF - dev wrote:
Frank
You spotted correctly.
LENGTH (sort_order) = 7 for parent,
LENGTH (sort_order) = 14 to a lower level,
LENGTH (sort_order) = 21 for the lower level 2,
LENGTH (sort_order) = 28 for the 3rd level,
I did this:
, LPAD (' ', (LENGTH (temp.sort_order) * 4 / 7)-4) | '-' || MSI. Segment1 AS indented_segment1He gets the hyphen at the front, but don't be indented?
Thnx
It works for me, in SQL * more. What are front-end do you use? Could it be stripping spaces? Just for the moment, try the padding with anything other than spaces (periods may) by the way of an argument 3rd to LPAD.
I guess temp.sort_order is a VARCHAR2: is it? Display of its length.
In other words, your select clause must have something like
, LPAD ( ' '
, ( LENGTH(temp.sort_order) * 4 / 7) - 4
, '.' -- For debugging
) || '-' || msi.segment1 AS indented_segment1
, LENGTH (temp_sort_order) AS len_sort_order -- For debugging
What is the result of these columns?
It is always good to post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and the results that you want from this data.
Tags: Database
Similar Questions
-
Click the step of node in the child node has no
Hello
I customized a series of nodes personalized like "chassisRackVSphere-ui.
In the picture1 below, "10.240.198.192", "Shopping cart", "Châssis" all three are custom node. When I double click on the column in the table, it must enter the purpose of the grid and remain in the child node as photo 2.
But it will show the Note2 for a second, then jump to the pic1. This jump is abnormal. An idea for this problem?
Set a breakpoint in your data adapter to see what happens when you select the custom in the 1st case object. The error of the user interface must be the result of bad data.
-
Hi all
I am very new to the designer of the ADEP. Please help me with this problem.
Let's say that the Subform.datanode.saveXML () returns a XML as below.
< test >
< Paper1 > English < / Document1 >
Science < paper2 > < / paper2 >
History of < paper3 > < / papier3 >
< test >
In the script:
var XMLDoc = subform.datanode.saveXML ("pretty");
for (nodeCount = 0; nodeCount < XMLDoc.nodes.length; nodeCount ++)
Returns an error "error: null is not an object. But I was able to access the values by specifying directly "XMLDoc.paper1 [0] m:System.NET.SocketAddress.ToString ();"
Can someone please suggest a way to know the number of child nodes in this context?
Hello
You can count the knots by:
subform.datanode.nodes.item(0).nodes.length;
-
XML E4X nodes select based on the attribute of the child node.
Hey,.
I'm making a selection on the following XML code.
I want to retrieve the list of the variable node when its child nodes metadata attribute 'name' is not equal to "transitional". I have read the documentation, but have not been able to solve this problem, and it should be pretty simple. So far, I tried with something like.
variable var: XMLList = classInfo.variable. (the metadata. (@name! = "transitoire")) ;
variable var: XMLList = classInfo.variable. (metadata.@name! = "transitional");
But he returns all the nodes variable.
"< name =" type com.sca.dataModel::PresentationDataEntity"base =" com.sca.dataModel::BaseEntity "isDynamic ="false"isFinal ="false"isStatic ="false">
< extendsClass type="com.sca.dataModel::BaseEntity"/ >
< extendsClass type = 'Object' / >
< variable name = "subtitle" type = "string" >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
< arg key = "pos" value = "128" / >
< / metadata >
< / variable >
< variable name = "id" type = "Number" >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
< arg key = "pos" value = "153" / >
< / metadata >
< / variable >
< variable name = "tableName" type = "String" >
< name of metadata = "transitional" / >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
< arg key = 'pos' value = '118' / >
< / metadata >
< / variable >
< variable name = "db_SortAsc" type = "Boolean" >
< name of metadata = "transitional" / >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
< arg key = "pos" value = "281" / >
< / metadata >
< / variable >
< variable name = "title" type = "String" >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
< arg key = "pos" value = "100" / >
< / metadata >
< / variable >
< method name = "setData" declaredBy = "com.sca.dataModel::BaseEntity" returnType ="*" > "
< parameter index = '1' type = 'Object' optional = "false" / >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/BaseEntity.as"/ >
< arg key = "pos" value = "330" / >
< / metadata >
< / method >
< name of metadata = "__go_to_ctor_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
< arg key = "pos" value = "167" / >
< / metadata >
< name of metadata = "__go_to_definition_help" >
< arg key = 'file' value="/Users/jonas/projects/SCA-CMS/src/com/sca/dataModel/PresentationDataEntity.as"/ >
< arg key = "pos" value = "42" / >
< / metadata >
< / type >Try classInfo.variable. ([email protected] (.indexOf("transient')) is
(- 1).
-
Hello
We use BI Publisher incorporated in Oracle EBS 12.1.3
The XML produced by definition DATA has following structure (mocked up for simplicity)
<DOC_DATA> <DOC_FLOW> <DOC_ID>1456</DOC_ID> <DOC_RECIPIENT>[email protected]</DOC_RECIPIENT> <DOC_DETAIL> <DOC_NAME>ALERT</DOC_NAME> <DOC_DATE>14-Jan-2013</DOC_DATE> <DOC_DESC>test data 1</DOC_DESC> <DOC_DETAIL> </DOC_FLOW> <DOC_FLOW> <DOC_ID>1456</DOC_ID> <DOC_RECIPIENT>[email protected]</DOC_RECIPIENT> <DOC_DETAIL> <DOC_NAME>EOL</DOC_NAME> <DOC_DATE>10-Jan-2013</DOC_DATE> <DOC_DESC>test data 2</DOC_DESC> <DOC_DETAIL> </DOC_FLOW> <DOC_FLOW> <DOC_ID>1456</DOC_ID> <DOC_RECIPIENT>[email protected]</DOC_RECIPIENT> <DOC_DETAIL> <DOC_NAME>PACKAGING</DOC_NAME> <DOC_DATE>20-Jan-2013</DOC_DATE> <DOC_DESC>test data 3</DOC_DESC> <DOC_DETAIL> </DOC_FLOW> <DOC_FLOW> <DOC_ID>1798</DOC_ID> <DOC_RECIPIENT>[email protected]</DOC_RECIPIENT> <DOC_DETAIL> <DOC_NAME>ALERT</DOC_NAME> <DOC_DATE>11-Jan-2013</DOC_DATE> <DOC_DESC>test data 4</DOC_DESC> <DOC_DETAIL> </DOC_FLOW> </DOC_DATA>
Power required of the RTF template is:
DOC - ID: 1456
NAME of DOC DATE of the DOC DOC / / DESC DRAW THE ATTENTION OF January 14, 2013 test data 1 EOL January 10, 2013 test data 2 PACKAGING January 20, 2013 test data 3 DOC - ID: 1798
NAME of DOC DATE of the DOC DOC / / DESC DRAW THE ATTENTION OF January 11, 2013 test data 4 * End of the report
How should we write it for each logical grouping such as the child under the annual common parent element (1456, for example) can be printed together?
Thanks for your contributions!
XML is not well-formed
DRAW THE ATTENTION OF January 14, 2013 test data 1 must be
DRAW THE ATTENTION OF January 14, 2013 test data 1 / DOC_DETAIL >
for your output, you can use
Doc - id:
Name of doc
Date of the doc
Doc / / Desc
-
Adjust the position of the child node in a StackPane
Hello
I have a question on the setting the positions of child nodes in a StackPane.
I added 2 child nodes to a StackPane.
For the 1st child node, I need to be always as big as the parent StackPane.
For the 2nd child node, it should be as large as necessary to place a few small pictures and it must always be "anchored" to the upper right of the parent StackPane.
2 childs nodes will be overlapping always.
Is this doable with a StackPane or would it be better to use another class of component?
Thank you.Yes, you can do it in a StackPane.
The first node of a subclass of component and ensure that it has an unlimited width and max height and it will completely fill the available surface of the StackPane.
Use the static StackPane.setAlignment (node, Pos) method to position the knot 2.import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.layout.*; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; public class StackPanePositioning extends Application { public static void main(String[] args) throws Exception { launch(args); } @Override public void start(final Stage stage) throws Exception { Pane n1 = new Pane(); n1.setPrefSize(200, 120); n1.setStyle("-fx-background-color: green;"); Rectangle n2 = new Rectangle(50, 50, Color.RED); StackPane.setAlignment(n2, Pos.TOP_RIGHT); StackPane stack = new StackPane(); stack.getChildren().addAll(n1, n2); stage.setScene(new Scene(stack)); stage.show(); } }
-
How to write a hierarchical query so that only the child nodes are displayed?
Hi all
I have a hierarchical query that I use in an area of tree demand APEX and there are nodes that have no children and I am trying to find a way to not display these nodes. Essentially if the user does not have to develop a lot of knots to know that nothing exists at the most detailed level.
The data are based on the Oracle Fusion FND tables but for example purposes here is enough data to illustrate my question:
create table APPL_TAXONOMY_HIERARCHY (SOURCE_MODULE_ID varchar2(30), TARGET_MODULE_ID varchar2(30)); create table APPL_TAXONOMY_TL (module_id varchar2(30), description varchar2(100), user_module_name varchar2(30), language varchar2(5)); create table APPL_TAXONOMY (MODULE_ID varchar2(30), MODULE_NAME varchar2(30), MODULE_TYPE varchar2(10), MODULE_KEY varchar2(30)); create table TABLES (table_name varchar2(30), module_key varchar2(30));
insert into APPL_TAXONOMY_TL values ('1', null, 'Oracle Fusion', 'US' ); insert into APPL_TAXONOMY_TL values ('2', null, 'Financials', 'US' ); insert into APPL_TAXONOMY_TL values ('3', null, 'Human Resources', 'US' ); insert into APPL_TAXONOMY_TL values ('20', null, 'Accounts Payable', 'US' ); insert into APPL_TAXONOMY_TL values ('10', null, 'General Ledger', 'US' ); insert into APPL_TAXONOMY_HIERARCHY values ('1', 'DDDDDDDD'); insert into APPL_TAXONOMY_HIERARCHY values ('2', '1'); insert into APPL_TAXONOMY_HIERARCHY values ('3', '1'); insert into APPL_TAXONOMY_HIERARCHY values ('4', '1'); insert into APPL_TAXONOMY_HIERARCHY values ('10', '2'); insert into APPL_TAXONOMY_HIERARCHY values ('20', '2'); insert into APPL_TAXONOMY values ('1', 'Fusion', 'PROD', 'Fusion'); insert into APPL_TAXONOMY values ('2', 'Financials', 'FAMILY', 'FIN'); insert into APPL_TAXONOMY values ('10', 'GL', 'APP', 'GL'); insert into APPL_TAXONOMY values ('3', 'Human Resources', 'FAMILY', 'HR'); insert into APPL_TAXONOMY values ('20', 'AP', 'APP', 'AP'); insert into tables values ('GL_JE_SOURCES_TL','GL'); insert into tables values ('GL_JE_CATEGORIES','GL');
My hierarchical query is as follows:
with MODULES as ( SELECT h.source_module_id, b.user_module_name, h.target_module_id FROM APPL_TAXONOMY_HIERARCHY H, APPL_TAXONOMY_TL B, APPL_TAXONOMY VL where H.source_module_id = b.module_id and b.module_id = vl.module_id and vl.module_type not in ('PAGE', 'LBA') UNION ALL select distinct table_name, table_name, regexp_substr(table_name,'[^_]+',1,1) from TABLES --needed as a link between TABLES and APPL_TAXONOMY union all select module_key as source_module_id, module_name as user_module_name, module_id as target_module_id from appl_taxonomy VL where VL.module_type = 'APP') SELECT case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status, LEVEL, user_module_name as title, null as icon, ltrim(user_module_name, ' ') as value, null as tooltip, null as link FROM MODULES START WITH source_module_id = '1' CONNECT BY PRIOR source_module_id = target_module_id ORDER SIBLINGS BY user_module_name;
In Oracle APEX, this gives a tree with the appropriate data, you can see here:
https://Apex.Oracle.com/pls/Apex/f?p=32581:29 (username: guest, pw: app_1000);
The SQL of the query results are:
STATUS TITLE LEVEL VALUE ---------- ---------- ------------------------------ ------------------------------
1 1 oracle Fusion Oracle Fusion -1 2 financial tables Financials -1 3 accounts payable Accounts payable 0 4 AP AP -1 General Accounting 3 General Accounting -1 4 GL GL 0 5 GL_JE_CATEGORIES GL_JE_CATEGORIES 0 5 GL_JE_SOURCES_TL GL_JE_SOURCES_TL 0 2 human resources Human resources The lowest level is the name of the table to level 5. HR is not any level under level 2, in the same way, "AP" (level 4) has nothing below, i.e. no level 5 and that's why I don't want to show these nodes. Is this possible with the above query?
Thanks in advance for your suggestions!
John
Hello
The following query will include only the nodes of level = 5 and their ancestors (or descendants):
WITH modules LIKE
(
SELECT h.source_module_id
b.user_module_name AS the title
h.target_module_id
To appl_taxonomy_hierarchy:
appl_taxonomy_tl b
appl_taxonomy vl
WHERE h.source_module_id = b.module_id
AND b.module_id = vl.module_id
AND vl.module_type NOT IN ('PAGE', "LBA")
UNION ALL
SELECT DISTINCT
table-name
table_name
, REGEXP_SUBSTR (table_name, ' [^ _] +')
From the tables - required as a link between the TABLES and APPL_TAXONOMY
UNION ALL
SELECT module_key AS source_module_id
AS user_module_name module_name
module_id AS target_module_id
Of appl_taxonomy vl
WHERE vl.module_type = 'APP '.
)
connect_by_results AS
(
SELECT THE CHECK BOX
WHEN CONNECT_BY_ISLEAF = 1 THEN 0
WHEN LEVEL = 1 THEN 1
OF ANOTHER-1
The END as status
LEVEL AS lvl
title
-, NULL AS icon
, LTRIM (title, "") AS the value
-, NULL as ToolTip
-, Link AS NULL
source_module_id
SYS_CONNECT_BY_PATH (source_module_id - or something unique
, ' ~' - or anything else that may occur in the unique key
) || ' ~' AS the path
ROWNUM AS sort_key
Modules
START WITH source_module_id = '1'
CONNECT BY PRIOR Source_module_id = target_module_id
Brothers and SŒURS of ORDER BY title
)
SELECT the status, lvl, title, value
-, icon, tooltip, link
OF connect_by_results m
WHEN THERE IS)
SELECT 1
OF connect_by_results
WHERE the lvl = 5
AND the path AS ' % ~' | m.source_module_id
|| '~%'
)
ORDER BY sort_key
;
You may notice that subqueries modules and the connect_by_results are essentially what you've posted originally. What was the main request is now called connect_by_results, and it has a couple of additional columns that are necessary in the new main request or the EXISTS subquery.
However, I am suspicious of the 'magic number' 5. Could you have a situation where the sheets you are interested in can be a different levels (for example, some level = 5 and then some, into another branch of the tree, at the LEVEL = 6, or 7 or 4)? If so, post an example. You have need of a Query of Yo-Yo, where you do a bottom-up CONNECT BY query to get the universe of interest, and then make a descendant CONNECT BY query on this set of results.
-
Get children nodes and only the child nodes of a tree?
Hi all
Relatively simple table
The question is how can I issue a select using the "AAAAA/1 ' and get the result ' HHHHH/1 ' «»create table replaced_parts ( old_part_number varchar(7), replaced_part_number varchar(7), updated_date date ); insert into Replaced_parts values('AAAAA/1', 'BBBBB/1', '2012-Feb-16'); insert into Replaced_parts values('BBBBB/1', 'FFFFF/1', '2012-Feb-23'); insert into Replaced_parts values('YYYYY/3', 'ZZZZZ/3', '2012-Mar-17'); insert into Replaced_parts values('FFFFF/1', 'LLLLL/1', '2012-Mar-18'); insert into Replaced_parts values('LLLLL/1', 'HHHHH/1', '2012-Mar-19');
i.e. (A-> B, B-> F, F-> L, L-> H)
Select using the "YYYYY/3 ' get ' ZZZZZ/3 ' (y-> Z)?
It would be really nice if I could also get my original value, say, "CARTER/1". "If there is no entry
for "CARTER/1 ' in the replaced_parts table (perhaps NVL?).»
I googled and tried different combinations of CONNECT BY PRIOR, ISLEAF... & c but
beat me my head on a brick wall at the present time.
TIA,
Paul...Hello
Once again, thanks for posting the CREATE TABLE and INSERT statements.
Once again, please post instructions that work. You're still trying to put VARCHAR2s in a DATE column (replaced_parts.updated_dates). There is no CREATE TABLE Or REPLACE Oracle statement.
The query you posted reference order_parts.user_number, but does not include the sample data in this column.
Be sure to post the results desired from the given sample data.Assuming that there is no branching at replaced_parts (in other words, each parent has only 1 child), you could do something like this:
SELECT O.User_Number, Op.Order_Number, Op.Part_Number, P.description, P.price, Op.Quantity_Ordered, O.Order_Date , ( -- Begin added code SELECT replaced_part_number FROM replaced_parts WHERE CONNECT_BY_ISLEAF = 1 START WITH old_part_number = op.part_number CONNECT BY old_part_number = PRIOR replaced_part_number ) FROM Order_Table O, Order_Parts Op, Parts P WHERE O.User_Number = Op.User_Number AND O.Order_Number = Op.Order_Number AND Op.Part_Number = P.Part_Number -- <----- sub-select changing the part no. if necessary should go here ;
No matter that there is no branching, you can do something like this:
WITH old_parts AS ( SELECT O.User_Number, Op.Order_Number, Op.Part_Number, P.description, P.price, Op.Quantity_Ordered, O.Order_Date FROM Order_Table O, Order_Parts Op, Parts P WHERE O.User_Number = Op.User_Number AND O.Order_Number = Op.Order_Number AND Op.Part_Number = P.Part_Number ) , new_parts AS ( SELECT CONNECT_BY_ROOT old_part_number AS orig_part_number , replaced_part_number FROM replaced_parts WHERE CONNECT_BY_ISLEAF = 1 START WITH old_part_number IN ( SELECT part_number FROM old_parts ) CONNECT BY old_part_number = PRIOR replaced_part_number ) SELECT o.* , n.replaced_part_number FROM old_parts o LEFT OUTER JOIN new_parts n ON o.part_number = n.orig_part_number ;
-
Oracle BPEL 2.0 - add the child node
Hi guys,.
SOA 11.1.1.7, BPEL 2.0
I have a child screaming master BPEL BPEL flow flow in a ForEach loop.
I have part of the answer like this:
< caseResponses >
< caseResponse >... < / caseResponse >
< caseResponse >... < / caseResponse >
< / caseResponses >
CaseResponse items come from child BPEL flows.
I'm trying to add each of these elements in the element parent < caseResponses > but when running I get "The Exception is thrown because the in-specs on the 112 line are assessed to be empty," where the line 112 is the line append.
My code is:
< assign the name = "AppendToResponse" >
< extensionAssignOperation >
< bpelx: Add >
< bpelx: go > $InvokeHandleSingleCarglassCase_process_OutputVariable.payload / ns1:caseResponse < / bpelx: go >
< bpelx: to > $outputVariable.payload / client: caseResponses < / bpelx: to >
< / bpelx: Add >
< / extensionAssignOperation >
< / assign >
If I add a copy - just like a test rule-
< assign the name = "AppendToResponse" >
< copy >
< a > $InvokeHandleSingleCarglassCase_process_OutputVariable.payload / ns1:caseResponse < / from >
< to > $outputVariable.payload/client:caseResponses/client:caseResponse < /pour >
< / copy >
< extensionAssignOperation >
< bpelx: Add >
< bpelx: go > $InvokeHandleSingleCarglassCase_process_OutputVariable.payload / ns1:caseResponse < / bpelx: go >
< bpelx: to > $outputVariable.payload / client: caseResponses < / bpelx: to >
< / bpelx: Add >
< / extensionAssignOperation >
< / assign >
I works as expected: all caseResponse items are added and there is also one more copy activity.
What can I do so that I don't get the "The Exception is thrown because the in-specs on the 112 line are assessed to be empty" exception without copy assign?
Thank you!
By the way
Rather than add it, you can use the copy, but instead of the normal copy you must change the code a bit to something like:
$InvokeHandleSingleCarglassCase_process_OutputVariable.payload / ns1:caseResponse $outputVariable.payload / client: caseResponses[$ForEachCounter]/ client: caseResponse If you add the counter and checks that I wrote in the previous answer basically it will create a node at position x (x being the value of the counter) and the copy of your result
-
The child node listening event of the parent
Is this possible? and how?parent.addEventListener ("someEvent", functionInChildComponet);
parentDocument, parentApplication, or application or...
Tracy
-
Retrieve the value of the XML node in XMLTable
Hello, hope that it is something simple and I went beside her, but consider this example:
How the child node of the 'name' Type?with et as( SELECT xmlType('<Invoice> <InvoiceInformation> <Number>123456</Number> </InvoiceInformation> <InvoiceLines> <InvoiceLine> <Detail> <Amount>100</Amount> <Line>1</Line> </Detail> <Type> <CheesyPotato> <Instructions> <CookTime>120</CookTime> <CookTimeUnits>Minutes</CookTimeUnits> <CookTemperature>450</CookTemperature> </Instructions> </CheesyPotato> </Type> </InvoiceLine> <InvoiceLine> <Detail> <Amount>10000</Amount> <Line>2</Line> </Detail> <Type> <DeathStar> <Instructions> <CookTime>4</CookTime> <CookTimeUnits>5 "parsecs"</CookTimeUnits> <CookTemperature>1000000</CookTemperature> </Instructions> </DeathStar> </Type> </InvoiceLine> <InvoiceLine> <Detail> <Amount>250</Amount> <Line>3</Line> </Detail> <Type> <Quiche> <Instructions> <CookTime>75</CookTime> <CookTimeUnits>Minutes</CookTimeUnits> <CookTemperature>350</CookTemperature> </Instructions> </Quiche> </Type> </InvoiceLine> </InvoiceLines> </Invoice> ') xt from dual ) SELECT ext.* FROM et, XMLTABLE( 'for $Invoice in $INV/Invoice for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine return <row> { $Invoice ,$InvoiceItem } </row>' PASSING et.xt as INV COLUMNS INVOICENUMBER VARCHAR2 (6) PATH 'Invoice/InvoiceInformation/Number' ,InvoiceLineNumber VARCHAR2 (5) PATH 'InvoiceLine/Detail/Line' ,Amount VARCHAR2 (5) PATH 'InvoiceLine/Detail/Amount' ,CookTime VARCHAR2 (5) PATH 'InvoiceLine/Type//Instructions/CookTime' ,CookTimeUnits VARCHAR2 (15) PATH 'InvoiceLine/Type//Instructions/CookTimeUnits' ,CookTemperature VARCHAR2 (10) PATH 'InvoiceLine/Type//Instructions/CookTemperature' ) ext / INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS COOKTEMPERATURE ------------- ----------------- ------ -------- --------------- --------------- 123456 1 100 120 Minutes 450 123456 2 10000 4 5 "parsecs" 1000000 123456 3 250 75 Minutes 350
I have tried different methods; along the lines of ', $InvoiceItem, Type, child, name ' does not, any help would be appreciated, thanksTypeChild INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS COOKTEMPERATURE ------------------- ------------- ----------------- ------ -------- --------------- --------------- CheesyPotato 123456 1 100 120 Minutes 450 DeathStar 123456 2 10000 4 5 "parsecs" 1000000 Quiche 123456 3 250 75 Minutes 350
Hello
You can use the name() function in the COLUMNS clause:
SQL> WITH et AS( 2 SELECT XMLType('
3 ') xt 54 FROM dual 55 ) 56 SELECT ext.* 57 FROM et 58 , XMLTable( 59 'for $Invoice in $INV/Invoice 60 for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine 61 return4 6123456 57 538 229 12100 101 1113 2114 2015 19120 16Minutes 17450 1823 3724 2710000 252 2628 3629 3530 344 315 "parsecs" 321000000 3338 5239 42250 403 4143 5144 5045 4975 46Minutes 47350 4862 { 63 $Invoice/InvoiceInformation 64 , $InvoiceItem 65 } 66
' 67 PASSING et.xt as INV 68 COLUMNS 69 typechild VARCHAR2(30) PATH 'name(InvoiceLine/Type/*)' 70 , INVOICENUMBER VARCHAR2(6) PATH 'InvoiceInformation/Number' 71 , InvoiceLineNumber VARCHAR2(5) PATH 'InvoiceLine/Detail/Line' 72 , Amount VARCHAR2(5) PATH 'InvoiceLine/Detail/Amount' 73 , CookTime VARCHAR2(5) PATH 'InvoiceLine/Type/*/Instructions/CookTime' 74 , CookTimeUnits VARCHAR2(15) PATH 'InvoiceLine/Type/*/Instructions/CookTimeUnits' 75 , CookTemperature VARCHAR2(10) PATH 'InvoiceLine/Type/*/Instructions/CookTemperature' 76 ) ext 77 ; TYPECHILD INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS COOKTEMPERATURE ------------------------------ ------------- ----------------- ------ -------- --------------- --------------- CheesyPotato 123456 1 100 120 Minutes 450 DeathStar 123456 2 10000 4 5 "parsecs" 1000000 Quiche 123456 3 250 75 Minutes 350If this does not work for your version (pre 11g), you will need to push the expression in the main XQuery expression:
... , XMLTable( 'for $Invoice in $INV/Invoice for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine return
{ element TypeChild {name($InvoiceItem/Type/*)} , $Invoice/InvoiceInformation , $InvoiceItem }
' PASSING et.xt as INV COLUMNS typechild VARCHAR2(30) PATH 'TypeChild' , INVOICENUMBER VARCHAR2(6) PATH 'InvoiceInformation/Number' ... -
Update for the child entity Siebel.
Hello
Here is the answer of the OPA. Here the overall entity is Action. There is "Time Tracker" entity which is 'actiontime' in relation to the overall entity.
<? XML version = "1.0" encoding = "UTF-8"? >
-< SiebelMessage MessageId = "" IntObjectName = 'Strategy of automation Response' MessageType = 'Object' IntObjectFormat = "Hierarchical Siebel" > "
-< response >
-< name of the entity 'global' = >
-name of the entity instance = 'global' row 'global' = >
-< relationship name = "actionexpense" deducted = 'false' known = "false" >
< target name = "ExpenseTracker-8SIA-7Z0YG" / >
< target name = "ExpenseTracker-8SIA-7Z0YH" / >
< / relationship >
-< relationship name = "actionsr" deducted = 'false' known = "false" >
< target name = "SR-2SIA-12FN7" / >
< / relationship >
-< relationship name = "actionpart" deducted = 'false' known = "false" >
< target name = "PartTracker-8SIA-7Z0YJ" / >
< target name = "PartTracker-8SIA-7Z0YI" / >
< / relationship >
-< relationship name = "actiontime" deducted = 'false' known = "false" >
< target name = "TimeTracker-8SIA-7Z2VR" / >
< / relationship >
-< attribute status = 'value' name = "EntitledActivity" type = "boolean" >
< value > true < / value >
< / attribute >
-< attribute status = 'value' name = "Standard_Hours" type = "number" >
< value > 10.0 < / value >
< / attribute >
-< attribute status = 'value' name = "Overtime_Hours" type = "number" >
< value > 7.0 < / value >
< / attribute >
< / entity instance >
< / entity >
-< name of the entity 'Right' = >
-name of the entity instance = row 'right-2SIA-10W58"="10W58">
-< relationship name = "entitlementservicedetails" deducted = 'false' known = "false" >
< target name = "ServiceDetails-8SIA-7Z0NS" / >
< target name = "ServiceDetails-8SIA-7Z0NR" / >
< / relationship >
-< relationship name = "contract_contractentitlement_rev" deducted = 'false' known = "false" >
< target name = "Contract-2SIA-10W4N" / >
< / relationship >
-< attribute status = 'value' name = "EntId" type = "text" >
< value > 2SIA-10W58 < / value >
< / attribute >
< / entity instance >
-name of the entity instance = row 'right-2SIA-10W56"="10W56">
-< relationship name = "contract_contractentitlement_rev" deducted = 'false' known = "false" >
< target name = "Contract-2SIA-10W4N" / >
< / relationship >
-< attribute status = 'value' name = "EntId" type = "text" >
< value > 2SIA-10W56 < / value >
< / attribute >
< / entity instance >
-name of the entity instance = row 'right-2SIA-14NLC"="14NLC">
-< relationship name = "contract_contractentitlement_rev" deducted = 'false' known = "false" >
< target name = "Contract-2SIA-14NKX" / >
< / relationship >
-< attribute status = 'value' name = "EntId" type = "text" >
< value > 2SIA-14NLC < / value >
< / attribute >
< / entity instance >
< / entity >
-< name of entity "SR" = >
-name of the entity instance = row "SR-2SIA-12FN7" = "12FN7" >
-< relationship name = "global_actionsr_rev" deducted = 'false' known = "false" >
< name target = 'global' / >
< / relationship >
-< relationship name = "srcontract" deducted = 'false' known = "false" >
< target name = "Contract-2SIA-10W4N" / >
< target name = "Contract-2SIA-14NKX" / >
< / relationship >
-< attribute status = 'value' name = "SRStatus" type = "text" >
Open < value > < / value >
< / attribute >
-< attribute status = 'value' name = 'OpenDate' type = ' date' >
< value > 17/11/2003 < / value >
< / attribute >
< / entity instance >
< / entity >
-< name of entity 'ExpenseTracker' = >
-name of the entity instance = row "ExpenseTracker-8SIA-7Z0YG" = "7Z0YG" >
-< relationship name = "global_actionexpense_rev" deducted = 'false' known = "false" >
< name target = 'global' / >
< / relationship >
-< attribute status = 'value' name = "ExpenseType" type = "text" >
< value > airfare < / value >
< / attribute >
-< attribute status = 'value' name = 'Amount' type = "number" >
< value > 33.0 < / value >
< / attribute >
< / entity instance >
-name of the entity instance = row "ExpenseTracker-8SIA-7Z0YH" = "7Z0YH" >
-< relationship name = "global_actionexpense_rev" deducted = 'false' known = "false" >
< name target = 'global' / >
< / relationship >
-< attribute status = 'value' name = "ExpenseType" type = "text" >
car rental < value > < / value >
< / attribute >
-< attribute status = 'value' name = 'Amount' type = "number" >
< value > 123,0 < / value >
< / attribute >
< / entity instance >
< / entity >
-< entity name = "PartTracker" >
-name of the entity instance = row 'PartTracker-8SIA-7Z0YJ"="7Z0YJ">
-< relationship name = "global_actionpart_rev" deducted = 'false' known = "false" >
< name target = 'global' / >
< / relationship >
-< attribute status = 'value' name = "PartNumber" type = "text" >
2250 X < value > < / value >
< / attribute >
-< attribute status = 'value' name = "AssetNumber" type = "text" >
< value > AA2250-001 < / value >
< / attribute >
< / entity instance >
-name of the entity instance = row 'PartTracker-8SIA-7Z0YI"="7Z0YI">
-< relationship name = "global_actionpart_rev" deducted = 'false' known = "false" >
< name target = 'global' / >
< / relationship >
-< attribute status = 'value' name = "PartNumber" type = "text" >
2250 X < value > < / value >
< / attribute >
-< attribute status = 'value' name = "AssetNumber" type = "text" >
< value > AA2250-001 < / value >
< / attribute >
< / entity instance >
< / entity >
-< name of the entity 'Contract' = >
-name of the entity instance = row "Contract-2SIA-10W4N" = "10W4N" >
-< relationship name = "contractentitlement" deducted = 'false' known = "false" >
< target name = "Right-2SIA-10W58" / >
< target name = "Right-2SIA-10W56" / >
< / relationship >
-< relationship name = "sr_srcontract_rev" deducted = 'false' known = "false" >
< target name = "SR-2SIA-12FN7" / >
< / relationship >
-< attribute status = 'value' name = 'ContractId"type ="text">
< value > 2SIA-10W4N < / value >
< / attribute >
< / entity instance >
-name of the entity instance = row "Contract-2SIA-14NKX" = "14NKX" >
-< relationship name = "contractentitlement" deducted = 'false' known = "false" >
< target name = "Right-2SIA-14NLC" / >
< / relationship >
-< relationship name = "sr_srcontract_rev" deducted = 'false' known = "false" >
< target name = "SR-2SIA-12FN7" / >
< / relationship >
-< attribute status = 'value' name = 'ContractId"type ="text">
< value > 2SIA-14NKX < / value >
< / attribute >
< / entity instance >
< / entity >
-< name of the entity 'TimeTracker' = >
-name of the entity instance = row "TimeTracker-8SIA-7Z2VR" = "7Z2VR" >
-< relationship name = "global_actiontime_rev" deducted = 'false' known = "false" >
< name target = 'global' / >
< / relationship >
-< attribute status = 'value' name = "Time_Tracker_Cost" type = "currency" >
< value > 275,0 < / value >
< / attribute >
-< attribute status = 'value' name = "Total_Overtime_Hours" type = "number" >
< value > 7.0 < / value >
< / attribute >
-< attribute status = 'value' name = "BillingRateType" type = "text" >
< value > Normal < / value >
< / attribute >
-< attribute status = 'value' name = "Total_Standard_Hours" type = "number" >
< value > 10.0 < / value >
< / attribute >
-< attribute status = 'value' name = "Time_Tracker_Price" type = "currency" >
< value > 175,0 < / value >
< / attribute >
< / entity instance >
< / entity >
-< name of entity 'ServiceDetails' = >
-name of the entity instance = row "ServiceDetails-8SIA-7Z0NS" = "7Z0NS" >
-< relationship name = "entitlement_entitlementservicedetails_rev" deducted = 'false' known = "false" >
< target name = "Right-2SIA-10W58" / >
< / relationship >
< / entity instance >
-name of the entity instance = row "ServiceDetails-8SIA-7Z0NR" = "7Z0NR" >
-< relationship name = "entitlement_entitlementservicedetails_rev" deducted = 'false' known = "false" >
< target name = "Right-2SIA-10W58" / >
< / relationship >
< / entity instance >
< / entity >
< / answer >
< / SiebelMessage >
I need to update the Action and Time Tracker BC in the Siebel.
Action - (attributes: Standard_Hours, Overtime_Hours)
Time Tracker - (attributes: Time_Tracker_Cost Time_Tracker_Price)
I use the engine of Transformation of data EAI for transfform data. But the child node is not built.
Please help me.
Thank you
AmolUnfortunately we have not all people who are very experienced with Siebel on this forum. It seems to me that it should be possible using the Transformation engine. The other option is to transform the XML into a PropertySet, retrieves the values that you want to update, and then update in the appropriate component of the company.
-
Read the column of XMLTYPE with Parent and several child nodes
Hello
I have an xmltype column which stores the data in the format below. There is possible that some of the parent node will have several child nodes. I'm not able to extract children nodes. Get the error as a value of type multiset... required singleton...
I tried the sub query, but it returns only the records from parent with children nodes.
< CrntRgstns >
< CrntRgstn empStDt = '2000-08-21' Auth = 'ABCD' regCat = 'BM' u4FlngDt = '2011-05-12' stDt = '2011-11-08' st 'EMPTY' = actvReg = "N" updateTS = "2011-11 - 08T 00: 37:42" >
< CrntDfcnys / >
< / CrntRgstn >
< CrntRgstn empStDt = '2000-08-21' Auth = 'ABCD' regCat = 'BM' u4FlngDt = '2012-01-13' stDt = '2012-01-13' st = 'DÉFICIENT' actvReg = 'Y' updateTS = "2012-01 - 13 T 18: 02:19" >
< CrntDfcnys >
< CrntDfcny dfcnyCd = "TEST" exmCd = "M10" createDt = "2012-01-13" / >
< CrntDfcny dfcnyCd = "TEST" exmCd = "X 40" createDt = "2012-01-13" / >
< / CrntDfcnys >
< / CrntRgstn >
< CrntRgstn empStDt = "2000-08-21" Auth = "XYZ" regCat = "SU" u4FlngDt = '2012-01-13' stDt = '2012-01-13' st = 'DÉFICIENT' actvReg = 'Y' updateTS = "2012-01 - 13 T 18: 02:19" >
< CrntDfcnys >
< CrntDfcny dfcnyCd = "TEST" exmCd = "M10" createDt = "2012-01-13" / >
< CrntDfcny dfcnyCd = "TEST" exmCd = "X 40" createDt = "2012-01-13" / >
< / CrntDfcnys >
< / CrntRgstn >
< / CrntRgstns >
I tried to use 2 xmltable querys and using the child node of the xmltable 1 as input to xmltable 2. But it returns only the records that has child nodes. But I wanted all the records of CrntRgstn and if no child node CrntDfcnys so that also displays.
Thank you
Vinod KI tried to use 2 xmltable querys and using the child node of the xmltable 1 as input to xmltable 2. But it returns only the records that has child nodes.
You're almost there, you just have to do an outer join:
SQL> select x1.empStDt 2 , x1.Auth 3 , x1.regCat 4 , x2.* 5 from documents t 6 , xmltable( 7 '/CrntRgstns/CrntRgstn' 8 passing t.xmldoc 9 columns empStDt date path '@empStDt' 10 , Auth varchar2(30) path '@Auth' 11 , regCat varchar2(2) path '@regCat' 12 , CrntDfcnys xmltype path 'CrntDfcnys' 13 ) (+) x1 14 , xmltable( 15 '/CrntDfcnys/CrntDfcny' 16 passing x1.CrntDfcnys 17 columns dfcnyCd varchar2(30) path '@dfcnyCd' 18 , exmCd varchar2(3) path '@exmCd' 19 , createDt date path '@createDt' 20 ) (+) x2 21 ; EMPSTDT AUTH REGCAT DFCNYCD EXMCD CREATEDT ----------- ------------------------------ ------ ------------------------------ ----- ----------- 21/08/2000 ABCD BM 21/08/2000 ABCD BM EXAM M10 13/01/2012 21/08/2000 ABCD BM EXAM X40 13/01/2012 21/08/2000 XYZ SU EXAM M10 13/01/2012 21/08/2000 XYZ SU EXAM X40 13/01/2012
Note: I have tested the above on 11.2.0.2 and it seems that there is a bug, if we add an outer join on the first XMLTable operator too.
Normally, the first outer join is not necessary, in order to also test on your version without it. -
Hello
I have a created a structure tree
-one
-aa
-aaa
-aaa
b
-bb
-bbb
-cc
-ccc
I followed the steps given in the message
make the tree nodes that are engaged in "BOLD"
(a)
Now if I expand the root node, then all of the child nodes automatically become "BOLD", that is if I select 'a '.
all nodes below becomes "BOLD".
-a
-aa *.
-aaa
-aaa
b
-bb
-bbb
-cc
-ccc
How can I avoid this problem what I want is the selection if 'a' only 'a' should be bold not her children
now when I select 'aa' or 'bb' only her parents must be "BOLD" not his children.
(b)
My second problem is that while the page loads for the first time his having the whole tree is in bold how prevent this from happening.If the node selected for that tree is P100_SELECTED_NODE_ITEM
Add the following code to the onload code ("run when the page loads" article on page or dynamic action shot page load)
selected_node= $('#'+$v('P100_SELECTED_NODE_ITEM')).children('a:first'); selected_node.parents('li').each( function(){ $(this).children('a:first').css('font-weight','bold'); });
-
How to get the child elements of the ArrayCollection collection?
Hi all
I want to analyze collection ArrayCollection and want the child node element.
How to parse the arraycollection collection?
for (var i: int = 0; i<>
{if (arrayCollectionObject.getItemAt (i). Item is "requireditem")}
your code
break;
}
}
Let me know if it helps
Maybe you are looking for
-
I saw this question already asked in the forums to update the latest version of Firefox, but I don't need to update the version, I try to download the latest version of Firefox for Windows through Chrome.I click on the download button on the Mozilla
-
Question about the music library to iCloud (music Apple) and iTunes on mac
Download I m just of my iTunes in the music library of iCloud library. Since I was afraid that my library of 40000 + titles could get corrupted or metadata could be changed by apple, I downloaded the files from a 'second' machine (macbook) - just to
-
I understand that HP provides a free upgrade to Windows 7 with computers purchased at the end June. While I realize that mine does not qualify for it (I bought in January), there is an option there to buy the upgrade? I looked, but I see nothing th
-
HP Officejet 6500 E709n ink printing - black not printing
I have a printer HP Officejet 6500 E709n and for some reason the black ink is not printing. Color cartridges work fine. I have even changed the black, cleaned cartridge and print head alignment, uninstalled and reinstalled the printer, but nothing
-
What should I do to get windows vista on the new hard drive on the old, because I would like to upgrade to windows 7 since vista when I transferred transversely to the new.