Dynamically Using  XML Element name as column names

Advertisement

I have a requirement where I need to show data for 31 days or days of the month based on the data in the xml result.
Based on the month you are running the report, some may have 28 elements and some may have 31 elements in the data for days.
How do I dynamically show 28 columns or 31 columns etc - the trick here is I have to use the name of the XML element and not the value for column names.
My requirement is like this.
Deal --------01 -------- 02 -------- 03 -------- 04 05 .upto ... 31days
Deal 1 : 22218 : 32218 : 11918
Deal 2 : Qty1 : Qty2 : Qty3
I need to be able to use the XML Element names , Day01, Day02 etc as the column names in the report.
How can I use the XML Element name - in this case I need to remove the "Day" and use just the number part for the column name.
I can't have xml element names as numbers, thats why "Day" string is prefixed.
<Row state="">
<DEAL>Deal 1</DEAL>
<PORTFOLIO>AM ST Prod PDP</PORTFOLIO>
<CPTY>DTEGO</CPTY>
<FACILITY>MICHCON</FACILITY>
<POINT>100013 : Chestonia 17-Rec</POINT>
<TYPE>Purchase</TYPE>
<Day01>22218</Day01>
<Day02>32218</Day02>
<Day03>11918</Day03>
<Day04>11918</Day04>
<Day05>11918</Day05>
<Day06>11918</Day06>
<Day07>11918</Day07>
<Day08>11918</Day08>
<Day09>11918</Day09>
<Day10>11918</Day10>
<Day11>11918</Day11>
<Day12>23238</Day12>
<Day13>11918</Day13>
<Day14>11918</Day14>
<Day15>11918</Day15>
<Day16>32328</Day16>
<Day17>11918</Day17>
<Day18>11918</Day18>
<Day19>11918</Day19>
<Day20>11918</Day20>
<Day21>11918</Day21>
<Day22>11918</Day22>
<Day23>11918</Day23>
<Day24>11918</Day24>
<Day25>11918</Day25>
<Day26>11918</Day26>
<Day27>13511</Day27>
<Day28>13550</Day28>
<Day29>13550</Day29>
<Day30>13550</Day30>
</Row>

Advertisement

I have a requirement where I need to show data for 31 days or days of the month based on the data in the xml result.
Based on the month you are running the report, some may have 28 elements and some may have 31 elements in the data for days.
How do I dynamically show 28 columns or 31 columns etc - the trick here is I have to use the name of the XML element and not the value for column names.
My requirement is like this.
Deal --------01 -------- 02 -------- 03 -------- 04 05 .upto ... 31days
Deal 1 : 22218 : 32218 : 11918
Deal 2 : Qty1 : Qty2 : Qty3
I need to be able to use the XML Element names , Day01, Day02 etc as the column names in the report.
How can I use the XML Element name - in this case I need to remove the "Day" and use just the number part for the column name.
I can't have xml element names as numbers, thats why "Day" string is prefixed.
<Row state="">
<DEAL>Deal 1</DEAL>
<PORTFOLIO>AM ST Prod PDP</PORTFOLIO>
<CPTY>DTEGO</CPTY>
<FACILITY>MICHCON</FACILITY>
<POINT>100013 : Chestonia 17-Rec</POINT>
<TYPE>Purchase</TYPE>
<Day01>22218</Day01>
<Day02>32218</Day02>
<Day03>11918</Day03>
<Day04>11918</Day04>
<Day05>11918</Day05>
<Day06>11918</Day06>
<Day07>11918</Day07>
<Day08>11918</Day08>
<Day09>11918</Day09>
<Day10>11918</Day10>
<Day11>11918</Day11>
<Day12>23238</Day12>
<Day13>11918</Day13>
<Day14>11918</Day14>
<Day15>11918</Day15>
<Day16>32328</Day16>
<Day17>11918</Day17>
<Day18>11918</Day18>
<Day19>11918</Day19>
<Day20>11918</Day20>
<Day21>11918</Day21>
<Day22>11918</Day22>
<Day23>11918</Day23>
<Day24>11918</Day24>
<Day25>11918</Day25>
<Day26>11918</Day26>
<Day27>13511</Day27>
<Day28>13550</Day28>
<Day29>13550</Day29>
<Day30>13550</Day30>
</Row>

October 11, 2015

Dynamically Using  XML Element name as column names

I have a requirement where I need to show data for 31 days or days of the month based on the data in the xml result. Based on the month you are running the report, some may have 28 elements and some may have 31 elements in the data for days. How do I

Dict View name and column names

Hi, Oracle 11.2.0.1 Windows XP I wish to get the output of all the dictionary views with their name and column names something like this : VIEW NAME Name                                      Null?    Type VIEW NAME Name                               

Insert a trademark symblol to my swf dynamicly using XML

hello there, i am trying to insert a trademark symblol to my swf dynamicly using XML, i tried every thing i could "caved the xml in every format known to man kind, wrote some AS script to replace thin join, i tried to hard code the symble" but n

Row name as column name

I want to display the patameters entered by the user as column names in interactive / classic report. For example i enter the parameters as date, 10-03-2011, 11-03-2011 and 12-03-2011. How i can display these dates as column names in report ? SanjayI

Table Name and Column name for Product Family Field under the Product Famil

Hi, Please help me finding the table name and the column name for the 'Product Family' field and the 'Item' field under the Product families form. The navigation to this form is as follows: Material Planner Responsibility -> Setup -> Product Family

Help needed in making table name and column name dynamic

please check the below query? in the below message Message was edited by: 460425 Message was edited by: 460425thanks Dmytro, below is the script i was looking for it got it..any way thanks. just need to replace dbms_output.put_line with utl_file.put_

Column Name Length of Tables In ODI

Hello Everyone, I am facing with an unique issue in ODI. We are using ODI AIA for Integration, which has default XML exports of some JD Edwards tables. These tables are automatically reversed and models are created using AIA, one such file is named B

Lookup Column name

Hi All I am new to OIM. Can anyone tell me what is the difference between Lookup Column Name and Column Name property of a lookup field while writing lookup query?Hi, Lets take an example here in the post given below. Re: Conditional forms Column Cap

How to find the column name and table name with a value

Hi All How to find the column name and table name with "Value". For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name Any

Using XML based output of rq*Eval() for generating graphical views

I've been trying the standard example used in training manuals of generating RandomRedDots. (Scripts that donot involve images are working fine) While using rqTableEval() the output format 1. using select clause (select cast(value as longvarchar(3200

How to access XML elements by name in Extendscript??

I'm almost done the script that I've been working on, but something has been nagging me since I started. When I did start, I looked at the JS Tools Guide CS5 that comes with the extendscript ide to check how to access XML elements, children, attribut

JMS Queue XML: Elements with same name

Hi I notice that ODI does not do a good job of reverse-engineering JMS queue models where an element name is referenced in different parts of the schema. For example: root ..body ...consignment ....load .....event ....unload .....event etc In the abo

How can i replace column name using reciever JDBC adapter on runtime.

Hi Experts, I have a problem with reciever JDBC synario. Target Oracle table has columns named 2 bytes Japanese character like "日本". Datatype cannot accept 2bytes character as element name. So, I would like to how to replace column name on runti

Dynamic Column Names from one table and its corresponding values from another table

I have 2 tables. First tables gives the specification if a column is required or not. we have the 2nd table with the same column name where we provide the actual values. I want to select all the required columns from the 1st table and retrieve the va

Dynamic Column Names in Flat File Destination

Hello, Inside a Data Flow Task, I have an ADO.Net data source which executes a stored procedure that provides results in 5 columns. The requirement is to have it connect to a flat file destination, such that the column names is dependent on what data

Invalid column name in query string - using Format function

In my post just before this one the problem was solved for writing a query string using a date range. The rest of the query string includes the same date field (Call_Date) but formatted as 'MMM-YY'. I get an invalid column name error when I add this

Dynamic column name in OBIEE

Hi all, In my report i need to show one chart view. I'm having one prompt. There the user is asked to select a no. for eg. say 10. and a date eg. 10-JAN-09. So my report should show the data from 10-JAN-09 and go backwards to 10 days. if he selects 5

Using Column Name returned by function in SELECT statement

Hi Output from my function (RETURN data type is VARCHAR2) is column name. I want to use it directly in my SELECT statement. Below is simplified example of this: --- Function CREATE OR REPLACE FUNCTION simple RETURN varchar2 IS BEGIN RETURN 'my_column

Need to know the column names in my dynamic select clause

Dear All, Please go through the following code. While executing the following code i am getting an error saying that dbms_sql.describe_columns overflow, col_name_len=35. Use describe_columns2. Please guide me how to proceed further. Or please help me

Need to return dynamic column names for a function returning nested table

I am having a pl/sql function which is returning a nested table. For this i have defined an object which is having 4 attributes- 1 number type, 3 varchar2 type -p1,p2,p3. My function is taking input parameter v1,v2,v3 all of varchar2 type.Inside the