HOWTO: use table column value as tag name in XMLElement (9iR2)
Hi,
maybe what I'm trying to do simply does not work, but here is my sample:
select XMLElement(DUMMY, DUMMY).getClobVal( ) as SAMPLE
from DUAL;
returns the following XML
<DUMMY>X</DUMMY>
But what I want to get is
<X>X</X>
because "X" is the value of column "DUMMY" for table DUAL
Is there a way to do this in PL/SQL XML-DB in Oracle 9i-R2?
TIA,
Stefan
Do you mean something like this?
1* select xmlelement(EVALNAME last_name, last_name) from employees
SQL> /
XMLELEMENT(EVALNAMELAST_NAME,LAST_NAME)
<Abel>Abel</Abel>
<Ande>Ande</Ande>
<Atkinson>Atkinson</Atkinson>
<Austin>Austin</Austin>
<Baer>Baer</Baer>
<Baida>Baida</Baida>
<Banda>Banda</Banda>
<Bates>Bates</Bates>
<Bell>Bell</Bell>
<Bernstein>Bernstein</Bernstein>
<Bissot>Bissot</Bissot>
<Bloom>Bloom</Bloom>
<Bull>Bull</Bull>
<Cabrio>Cabrio</Cabrio>
<Cambrault>Cambrault</Cambrault>
<Cambrault>Cambrault</Cambrault>
<Chen>Chen</Chen>
<Chung>Chung</Chung>
<Colmenares>Colmenares</Colmenares>
<Davies>Davies</Davies>
.If you do then you're gonna have to upgrade to 10.2.0.2.
In 10.2.0.1 you'll get...
SQL> select xmlelement(EVALNAME last_name, last_name) from employees
2 /
ERROR:
ORA-19039: Keyword EVALNAME reserved for future use
no rows selected
SQL>And earlier versions.... well, you probably won't even get that.
Similar Messages
-
Popup is not getting launched click on command link in table column value
Hi
We have a scenario where we bring the pop-up clicking on command link in the table column value. It was working fine before but from last few labels this is not working.
Here is the code snippet that we are using,
<af:table>
<af:column>
<af:commandLink>
<af:outputText value=”product name” />
<af:showPopupBehavior TriggerType=”click” PopupId=”::p1”/>
<af:commandLink>
</af:column>
</table>
<af:popup id=”p1”>
<af:dialog>
</af:dialog>
</af:popup>
Thanks,
NageshIt is important to set partialSubmit="true" in the <af:commandLink> tag. A full submit will be made otherwise and the popup will not show. Use also tryggerType="action" instead of triggerType="click" and use the proper chararcter case of the tag attribute names. Try with this:
<af:commandLink text="product name" partialSubmit="true">
<af:showPopupBehavior popupId="::p1" triggerType="action"/>
</af:commandLink>Dimitar -
I am not able to read the xslt table column value.
Hi,
I have the scenario like this.
I have two irpt pages first.irpt and second.irpt and saperate xslt tables for each page and common js file for two pages.
when I click on first.irpt page xslt table row that opens the second.irpt as a popup window then I click on the column in second.irpt xslt row after that column value should be inserted in to first.irpt xslt table column.
In above I have done everything except I am not able to update the first.irpt xslt table column as Even I am not able to read that value.
For your reference:
/* This function will be called when we select the row in first.irpt xslt table here SelectBatch_b.irpt means second.irpt
function getBatch(row)
var id=row;
var material=document.getElementById('Material_'+row).value;
var location=document.getElementById('StoreLoc_'+row).value;
var plant=1000;
var strUrl = "SelectBatch_b.irpt";
strUrl = "?plant="plant"&""location="location"&""material="material;
window.open (strUrl,"mywindow");
/*This function will be called when we select the row in second.irpt (SelectBatch_b.irpt)
function getBatchID(row)
var Batch=document.getElementById('Batch_'+row).value; // reading second.irpt xslt table column value
document.getElementById('Batchc1').value=Batch; // reading first.irpt xslt table column value and inserting.
window.close(); // here I am getting error like object expected.
Please help me in this .
Edited by: rajkumar12345 on Feb 29, 2012 1:45 PMHi Rajkumar,
Please find below the method to pass the variable back and forth in .irpt page.
First Page:
var Toaccessinchildpage = "value";
function getBatch(row)
var id=row;
var material=document.getElementById('Material_'+row).value;
var location=document.getElementById('StoreLoc_'+row).value;
var plant=1000;
var strUrl = "SelectBatch_b.irpt";
strUrl += "?plant="plant"&"+"location="location"&"+"material="+material;
window.open (strUrl,"mywindow");
function populate(strBatch)
document.getElementById('Batchc1').value=strBatch;
Second Page:
function getBatchID(row)
var Batch=document.getElementById('Batch_'+row).value;
window.opener.populate(Batch);
window.close();
You have to call parent page function from child page.
No need to use common js.
If you want to access variable from parent page use
window.opener.<variable name>.
Example
window.opener.Toaccessinchildpage
You have to declare that variable as global variable in Parent page js file.
Refer First page code.
Regards,
Selva -
How i pass table column value to string variable or return to java applete
Hi Master,
How do I pass a table column value into string variable. See my code below:
import java.sql.*;
public class Waheed {
public Waheed() {
public static void main (String args [])
String s = "9 23 45.4 56.7";
System.out.println ("going for connection");
// DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@fahim:1521:aamir","muhammad","mfa786");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select accid from accbal");
System.out.println ("going for connection");
while (rset.next())
s= rset.getString("accid"); this line give me error
System.out.println (rset.getString("accid"));
System.out.println (s);
catch(Exception e){
e.printStackTrace();
This line give me an error:
s= rset.getString("accid");
s is string variable
Plese give me an idea how I can pass accid in s variable.
Thanks.
AamirSee the code sample in the following thread (try using upeercase).
JDBC connection
Kuassi -
Concatenation error - when i use text column value in where condition.
Hi,
i am creating Materialized view using few columns from two tables and as per requirement i need to prepare select statement with where condition in another column.(new column)
i tried like below....
create materialized view MAIN
refresh force on demand
as
select
a.table_name,
a.column_name,
b.trial_name,
'select * from '||a.table_name||' where '||a.column_name|| ' = '|| b.trial_name||';' "QUERY"
from
exp_csv_tB a,
exp_csv_tr b;
a.table name value is : monitoring_table
a.column_name value is : study
b.trial_name = fty777
Materialized view created with extra column but it is not added '' (codes) to text value in where condition.
output which i got is :
select * from monitoring_table where study = fty777;
but
i need output like
select * from monitoring_table where study = 'fty777';
fty777 value should be in codes like 'fty777'. i read some articles but didnt get this example.
please help.Try this:
CREATE MATERIALIZED VIEW main
REFRESH FORCE ON DEMAND
AS
SELECT
a.table_name,
a.column_name,
b.trial_name,
'select * from '||a.table_name||' where '||a.column_name|| ' = '''|| b.trial_name||'';'' "QUERY"
FROM
exp_csv_tb a,
exp_csv_tr b;
You have to give double single codes for semi-colons ..
Regards.. -
How to format table column values to currency?
All,
I have bound a context attribute (type - string) to a table column (TextView) which is used to display currency.
It displays the value as 123456789.00
How do I format the value as 123,456,789.00?
Is there any FM available to format?
I don't want to change the above context attribute type to CURR.
Thanks
Thruna>I don't want to change the above context attribute type to CURR.
Why not? That is the correct thing to do. That way you get formatting, sorting, even the correct decimal position and notation for different currencies and user settings.
If you must go with string for the context attribute then I still assume your source data is type CURR. When you 'move' this content into the string of the context attribute use the WRITE statement. This will format the currency variable for output. -
How to save and retrive table column values added via view enhancement
Hi,
I want to enhance standard webdynpro component FITE_VC_REVIEW.
I want to add new column to Fight Info Table and also to Hotel Info table.I can do UI changes via view enhancement .
First Approach: I add new fields to Flight Info and Hotel Info structure.
Create an additional Coolum in Flight Info and Hotel Info Table and Bind it to newly created field in structures.
Question :
What all changes I have to make to save and retrieve values from database table.
Kindly guide with Steps
Second Approach: I create a new table/structure for my requirement and bind table column to these fields.
Question:
What all changes I have to make to save and retrieve values from database table.
Kindly guide with Steps
And which approach will be good.
Regards,
Madhvikano ans yet
-
How to save and retrieve table column values added via view enhancement
Hi,
I want to enhance standard webdynpro component FITE_VC_REVIEW.
I want to add new column to Fight Info Table and also to Hotel Info table.
First Approach: I add new fields to Flight Info and Hotel Info structure.
Create an additional Coolum in Flight Info and Hotel Info Table and Bind it to newly created field in structures.
Question
What all changes I have to make to save and retrieve values from database table.
Kindly guide with Steps
Second Approach: I create a new table/structure for my requirement and bind table column to these fields.
Question:
What all changes I have to make to save and retrieve values from database table.
Kindly guide with Steps
And which approach will be good.
Regards,
Madhvika
Moderator message: please have a look in the dedicated "Web Dynpro ABAP" forum.
Edited by: Thomas Zloch on Feb 16, 2011 3:02 PMno ans yet
-
Sql Loader INFILE name value in table column Value
Hi,
Here is my Sql Loader Script
LOAD DATA
infile '%1'
APPEND INTO TABLE XX_SUPPLIER_UPD
FIELDS TERMINATED BY ";" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
ACTION Char
,ADDRESS_TYPE Char
,REGION Char "LTRIM(RTRIM(:REGION))"
,PO_BOX Char
,,WWW_ADDRESS Char
,status Char "NVL(:status,'X')"
,filename Char "replace(:infile,'\"','')"
I am getting the infile name as the parameter and i want to insert that parameter value in the column name fillename. Can any one guide me to how to do.
Cheers!
Jayaraj.SIf you were to use external tables instead of SQL*Loader, you can dynamically change the location of the external table (i.e. the filename) using a simple ALTER TABLE statement.
External tables also mean that all the control is inside the database rather than relying on external utilities and external scripts.
;) -
How can I do the multiplication on table column values?
I have a table t1 having c1 column
T1
1
2
3
4
Need the result 1*2* 3* 4 =24
Need to write sql query please help, not io pl/sql block
Thanks in advance .
BalaHi,
Starting in Oracle 11.2 (always post your version) you can also use a recursive WITH clause:
ITH got_prd (id, c1, prd) AS
SELECT id, c1
, c1 AS prd
FROM t1
WHERE id = 1
UNION ALL
SELECT c.id, c.c1
, c.c1 * p.prd AS prd
FROM t1 c
JOIN got_prd p ON c.id = p.id + 1
SELECT MAX (prd) KEEP (DENSE_RANK LAST ORDER BY id) AS product
FROM got_prd
;This assumes that the rows are numbered 1, 2, 3, ... You can always use the analytic ROW_NUMBER function if the rows are not already numbered.
You'd probably want to treat NULLs as 1. If so, replace c1 with NVL (c1, 1) when calculating prd.
Karthick: you're right that the results returned by the results of string aggregation are not even close the results of multiplication. Seth is just saying that the syntax of creating a user-defined aggregate fucntion to do string aggregation is very much like the syntax for creating a user-defined aggregate fucntion to do multiplication. If you can see how to do one, it's easy to figure out how to do the other; just change some names and the bodies of some of the procedures. -
How get table column value in textfield on mouse click in table column
hi master
sir i have one table that have three field
sno
name
fname
and three textfield in my page
how i get sno,name,fname in textfield form table when i click any reow or any record
when i cliek any record that record value sno,name and fname transfer to textfiled1,textfield2 and textfield3
please give me idea and code
thank's
aamirHi Gorge,
Are you sure the column you are accessing is of type EditText ?
Please step through your code and do check the type of the column first.
While Rows <= index
Dim o = omatrix.Columns.Item("2000002049").Type 'Check the type here first.
edit1 = oMatrix.Columns.Item("2000002049").Cells.Item(index).Specific
index = index + 1
Regards
Edy -
How to use table field values as dynamic parameters on selection screen
Hi,
I need help on dynamic selection parameters.
I need to display no. of parameters from the fields of a database table.
Basically i want to pass field values of a table to selection screen and we can use those values as parameter on selection screen.
If there are 10 entries in a table field( say field is field_name and entries are bukrs,kunnr etc.)
I need to display as many parameters on screen as many values are there in field_name( In this case it is 10)
SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
PARAMETERS:
p_bukrs(5) ,
p_kunnr(5) ,
SELECTION-SCREEN END OF BLOCK b2.
ThanxHi,
You can create it using Dynamic Program.Check this link below.
[Creating Dynamic Programs|http://help.sap.com/saphelp_46c/helpdata/en/9f/db996135c111d1829f0000e829fbfe/content.htm]
Hope this might help you.
Thanks,
Prashanth -
Using a variables value as the name of another variable
Hi, i'm new to java and i've been trying to write a little program. I was wondering whether it is possible to use the value of a variable as the name of another variable.
This is what i have so far: When i run my java program numerous Animal objects are created with names like ani01, ani02, ani03. These objects have functions like getName() etc. When i type in one of these codes into the command line it gets stored in a variable called 'input'. Everything's fine up to here.
But i need a way to access the correct Animal from my input. instead of doing countless switch statements on the input.
If i type "ani02" i want it to return the animals name by calling ani02.getName()...
how do i do this? i'd appreciate any help. thanks.If you were doing this based on user input, then you
wouldn't have to do a lot of typing. Mmm?I'm sorry i don't get your meaning... ? I am doing this based on user input am i not?
All i want to do is access the correct Animal object depending on the user's input... so if they type in ani01 it would return 'Elephant' (or whatever) using ani01.getName().
Maybe i'm going about this the wrong way or something?.. I have about 30 animals. they each have a name, continent, quantity. I have an Animal class that has functions like getName(), setName() etc. When the program starts, 30 objects are created
Animal ani01 = new Animal("Elephant",3000,"India");
Animal ani02 = new Animal("Panda",200,"China");etc...
I want to be able to get information about any one of these animals by typing something at the command line...
so i type in something (i just thought the name of the object would be the best thing to type in) and i get the info about elephants (or whatever) from the relevant object.
how would you do this? -
Use XML Node Value as Node name and as attribute name
im quite new to XML and XLST. I got an Open Office XML file that I transformed with XLST.
<?xml version="1.0" encoding="UTF-8"?>
<ooo_calc_export scriptVersion="2.2.0" scriptUpdate="2010-12-19" scriptURL="http://www.digitalimprint.com/misc/oooexport/" scriptAuthor="vjl">
<ooo_sheet num="1" name="Blatt1">
<ooo_row><Artikelnummer>C12-34567</Artikelnummer><ArttikelnummerAlt/><Details>AAA AAA AAA AAA</Details><Abmessungen/><Bildpfad>file:///cmyk/C12-34567.PSD</Bildpfad><EK>1234,-</EK><VK>3456,-</VK>
</ooo_row>
<ooo_row><Artikelnummer>C23-45678</Artikelnummer><ArttikelnummerAlt/><Details>BaB BaB BBB BBB</Details><Abmessungen/><Bildpfad>file:///cmyk/cmyk/C23-45678.PSD</Bildpfad><EK>2345,-</EK><VK>4567,-</VK>
</ooo_row>
<ooo_row><Artikelnummer>C34-56789</Artikelnummer><ArttikelnummerAlt/><Details>CaC CaC CaC CaC uli</Details><Abmessungen/><Bildpfad>file:///cmyk/cmyk/C34-56789.PSD</Bildpfad><EK>3456,-</EK><VK>5678,-</VK>
</ooo_row>
</ooo_sheet>
</ooo_calc_export>
I transformed the XML with the following XLST:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method = "xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="ooo_sheet">
<xsl:element name="Import">
<xsl:for-each select="ooo_row">
<xsl:element name="Artikel">
<xsl:element name="Text">
<xsl:copy-of select="Artikelnummer"/>
<xsl:copy-of select="Details"/>
<xsl:copy-of select="Abmessungen"/>
<xsl:copy-of select="EK"/>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
The result is:
<?xml version="1.0" encoding="UTF-8"?>
<Import>
<Artikel>
<Text>
<Artikelnummer>C12-34567</Artikelnummer>
<Details>AAA AAA AAA AAA</Details>
<Abmessungen/>
<EK>1234,-</EK>
</Text>
</Artikel>
<Artikel>
<Text>
<Artikelnummer>C23-45678</Artikelnummer>
<Details>BaB BaB BBB BBB</Details>
<Abmessungen/>
<EK>2345,-</EK>
</Text>
</Artikel>
<Artikel>
<Text>
<Artikelnummer>C34-56789</Artikelnummer>
<Details>CaC CaC CaC CaC uli</Details>
<Abmessungen/>
<EK>3456,-</EK>
</Text>
</Artikel>
</Import>
I need another child within the node "Artikel" named "Bild". It should have an "href" attribute. The value of the attribute should be the value in the node "Bildpfad".
The result of this transformation should be
<Artikel>
<Text>
<Artikelnummer>C34-56789</Artikelnummer>
<Details>CaC CaC CaC CaC uli</Details>
<Abmessungen/>
<EK>3456,-</EK>
</Text>
<Bild href="file:///cmyk/C12-34567.PSD"></Bild>
</Artikel>
I want to import this XML into Indesign. It seems that the images path needs to be in a href attribute so Indesign accepts the node as an image object.
Another problem is that Indesign won't import the original xml with selection of the listed xsl to tranform the xml. So I used another xml editor instead to perform the transformation.
Thank you all for your help!Hi Dorian_fs,
I think we're still missing details here on what exactly it
is you're trying to do? Are you loading this XML via a data set? In
which case, Don's samples would apply? Or are you trying to load
XML independent of data sets and regions, in which case, you are
looking for something that simplifies the access of data from the
resulting XML document? If the latter than perhaps you want to use
XMLDocToObject:
http://labs.adobe.com/technologies/spry/samples/utils/XMLDocToObject.html
--== Kin ==-- -
Howto use formula columns in matrix reports
Hello
How can i use a formula column in matrix report whose function would be
Formula_Column_Result=A-B where A=Cell A
B =Cell B
Regards
FahadHii guys
I solved my problem on my own.
i wrote
SELECT * FROM EMP WHERE EMP.DEPTNO=P_DEPT_NO
and it worked.
Thanks guys..i luv this forum
Regards
Fahad Hameed
Maybe you are looking for
-
How can I set a name for a unknown place without moving it?
I imported some photos with GPS information into iPhoto. I can see these photos on the map with one pin per photo, but every pin is tagged with "unknown place". All the photographs were taken on the same island, so I want to add the name of this Isla
-
Passing columns with UTF8 code on fx formula
Hi! I'm using obiee 11.1.1.5.0 I have an analysis that contains HTML Code, some code is passed to a URL, so I need to convert diferent symbols like ó to %C3%B3 etc. I have a lot of symbols...so I can't use REPLACE function in my formula column of my
-
After upgrade conky does not display right on first boot
After i upgraded my arch conky will display on top of all windows when i first boot the machine, until i kill it and restart it then it works perfectly. I am using openbox with no compositing.
-
Forgot the "Password Recovery Question"
Hi Support, I am using a blackberryid on phone, but I have forgot the password and the "Password Recovery Question". So I cannot login vai the phone / webpage. May I know how can I reset the "Password Recovery Question" / BlackberryID? Many Thanks. S
-
Plz help .....no sound from my iPod touch 4
Plz help...I have no sound from my iPod touch 4th gen........I asked google and it said maybe my headphone jack is stuck.....huh