Converting a result of query into XML format
Hi,
I am going to use DBXML,DBBOM and DBXSL
ie PLSXML utilities to convert the records returned after querying the data into XML format.Is it possible to do this using these packages?
Should i use Oracle SQL XML Utility?
Which would be better?
I've used both utilities and I personally like the concept of SQL Utility. I'm still
having some problem with encoding issues
but it seems a better tool to use with Java.
If I'm just going to be using PL/SQL, I'll
use PLSXML utilities. Note that PLSXML does
not support SAX nor will XSQL servlet work
with it.
null
Similar Messages
-
Convert gzip files into XML format
We have a requirement where we receive gzip files. These files are zipped file containing base64 binary format csv files. We would have to convert these files into XML format. Please let me know any of the following.
1. Is there any Xpath query or XSL function (somthing similar like doTranslateFromNative() ) to convert from gzip files to XML format.
2. If we need to unzip the zipfile outside fusion, then java code piece to unzip the gzip file. I guess after that we can use the usual doTranslateFromNative() function to translate to XML format, since after unzipping the gzip file, they are base64 binary formats.
Thanks in advance,
TomsThere is an option to do pre-processing and post processing of Files when using File adapter. You need to create a valve which will first do pre processing and send the output to FileAdapter.
You can get more information here:
http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm#CACDHGGG
under section: 4.2.14 Pre-Processing and Post-Processing of Files
Essentially you will use Java to unzip the file first and then the unzipped content will be passed to the adapter. -
Which are function modules used to convert into XML format in SAP 4.6c Ver
which are function modules used to convert into XML format in SAP 4.6c Ver
Hi,
check this program , I think this will help you
TYPE-POOLS: ixml.
TYPES: BEGIN OF xml_line,
data(256) TYPE x,
END OF xml_line.
data : itab like catsdb occurs 100 with header line.
data : file_location type STRING.
data : file_name like sy-datum.
data : file_create type STRING.
file_name = sy-datum .
file_location = 'C:\xml\'.
concatenate file_location file_name into file_create.
concatenate file_create '.XML' into file_create.
DATA: l_xml_table TYPE TABLE OF xml_line,
l_xml_size TYPE i,
l_rc TYPE i.
select * from catsdb into table itab.
append itab .
CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
EXPORTING
I_FIELD_SEPERATOR =
I_LINE_HEADER =
I_FILENAME =
I_APPL_KEEP = ' '
I_XML_DOC_NAME =
IMPORTING
PE_BIN_FILESIZE = l_xml_size
TABLES
i_tab_sap_data = itab
CHANGING
I_TAB_CONVERTED_DATA = l_xml_table
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 24
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = l_xml_size
filename = file_create
filetype = 'BIN'
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 24.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
write : 'INTERNAL TABLE DATA IS SUCCESSFULLY DOWNLOADED TO LOCATION', file_create .
Thanks. -
Idoc be converted into XML format
Hi,
Can idoc be converted into XML format? If yes guide me the path , how to do?
Thanks
Avi<b>Hi,
we can .
Follow the link
http://www.erpgenie.com/sap/sapedi/Conversion%20of%20IDOCs%20to%20XML%20format.pdf</b>
Thanks
Manju
<u><b>Don't repeat the Questions</b></u> -
Hi all,
Can anyone tell how to convert the data in R3 to XML format.
thanx,
krishsame thread.
Re: function module to covert internal table to xml format
for more reference.
ABAP to XML with several internal tables
Re: Convert to XML format -
Can we generate the output of SQL Query in XML format ..
Hi Team,
Can we generate an XML doc for an SQL Query.
I've seen in SQL Server 2000.It is generating the output of an SQL Query in xml format.
select * from emp for xml auto
The output looks like
<emp EMPNO="7369" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="20"/><emp EMPNO="7370" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="10"/>Just a little bit of short hand.
Get the XML out of your database, via HTTP
Of course the easiest method is just to return an XMLType from a stored procedure and let the calling routine figure out what to do with it. Instead
of that way though, I'll show you how to do it via HTTP. It's all completely built into 10g and is super easy to use.
CREATE OR REPLACE VIEW emps_and_depts AS
SELECT e.employee_id AS "EmployeeId",
e.last_name AS "Name",
e.job_id AS "Job",
e.manager_id AS "Manager",
e.hire_date AS "HireDate",
e.salary AS "Salary",
e.commission_pct AS "Commission",
XMLFOREST (
d.department_id AS "DeptNo",
d.department_name AS "DeptName",
d.location_id AS "Location"
) AS "Dept"
FROM employees e, departments d
WHERE e.department_id = d.department_id
Some people hear web and immediately start salivating about security issues. Let me address that quickly. Just because you have the HTTP and/or
FTP servers running in the database, that does not mean you have a security problem. For one, I would hope your databases are behind a firewall.
Second, with the correct architecture (DMZ, app servers, etc) you can make this data available outside the firewall fairly transparently and third,
just because it's on the web does not mean the data MUST be available on the internet. This is a good way to make your data available on your
intranet. If you are worried about people INSIDE your firewall, that still doesn't preclude web based access. Follow Oracle security guidelines.
Before I show you how to get to your data, let's talk about URLs and URIs. A URL is a Uniform Resource Locater and URI is a Uniform Resource
Identifier. A URL is the way you would identify a document on the net, i.e. http://www.oracle.com is a URL. A URI is a more generic form of a URL.
Oracle supports three types of URI: HTTPURIType - basically a URL (which would be like the URL above), XDURIType - a pointer to an XDB resource
(usually an XML document but can be other objects), and DBURIType - a pointer to database objects.
It's the DBURIType that we're going to concentrate on here. The DBURIType let's us reference database objects using a file/folder paradigm. The
format for a DBURI is /oradb/<schema>/<table>. Oradb is shorthand for the database; it is not the database name or SID. My database is named XE
but I still use oradb in the DBURI. For example, the view we created above is in my XE database, is owned by HR (at least in my case) and is called
EMPS_AND_DEPTS. This can be referenced as /oradb/HR/EMPS_AND_DEPTS.
If the view had many rows and you wanted only one of them, you can restrict it by including a predicate. The documentation for XDB has a great
write up on Using DBURIs.In our case, we are going to write out the entire document. Now that you understand that the DBURI is a pointer to
objects in our instance, we can use that to access the data as a URL.
The format for the URL call is http://<machinename>:<port>/<DBURI>
In my case, my XE database is running on a machine called mach1 and is listening on port 8080. So to see the view we created above, I open my
browser and navigate to: http//mach1:8080/oradb/HR/EMPS_AND_DEPTS
The created URL will be as http//mach1:8080/oradb/PUBLIC/EMPS_AND_DEPTS
If your database is set up correctly and listening on port 8080 (the default), your browser should ask you to login. Login as the user who created the
view (in my case HR). You should now get an XML document displayed in your browser.
And that's it. It doesn't get much simpler than that. If you get rid of the descriptive text above, it basically comes down to:
Create a table or view
Open your web browser
Enter a URL
Enter a user ID and password
View your XML
If you notice, Oracle formatted the data as XML for us. Our view returns scalar columns and an XML fragment called Dept. Oracle formatted the
return results into an XML format.
And as a side note, if you look closely, you'll see that my URL has PUBLIC where I said to put HR. PUBLIC is a synonym for all objects that your
logged in user can see. That way, if your user has been granted select access on many schemas, you can use PUBLIC and see any of them. -
How could I export FCE project into XML format?
Hello,
I recently decided to upgrade from Final Cut Express to Final Cut Pro X. But I don't seem to be able to export my FCE unfinish projects. That is because FCE does not export into XML format !!!
Does anyone knows how to have FCE to generate a XML file? Or to have the FCP file format converted into a XML file format?
ThanksIf you are editing in FCE4, then you can open your FCE Project in FCP6 or FCP7 and do the .xml export there. Once you have that .xml file, you need to use the software 7toX to convert the file to FCP-X.
http://assistedediting.intelligentassistance.com/7toX/
It should be noted that the conversion of a sequence file to .xml and then .xml to FCP-X may not pass 100% of the information.
There is information about what is and is not translated here:
http://assistedediting.intelligentassistance.com/7toX/about.html
MtD -
Business system into xml format
Hi all,
Can u please explain hoe to convert business system into xml format.
Thanks in advance
NaveenHey
you dont convert business system name in XML format,
do you want to use ur business system name in message mapping?if yes,then use the following UDF code to get BS name in message mapping
String Sender = "";
String key = "SenderService";
// get runtime constant map
map = container.getTransformationParameters();
// get value of header field by using variable key
Sender = (String) map.get(key);
return Sender;
Note: the above code is from the following thread
Fetching the business system name during graphical mapping
Thanx
Ahmad
Message was edited by:
Ahmad -
How do I convert staruml data model diagram into XML DB datamodel
I'm trying to find out if i could convert starUML data model diagram into XML DB datamodel. I'm planning to use Jdev for the same. Let me if it is possible
satrUML does support XMI export. I tried that and tried importing it in JDev and results in error as follows :
"Mandatory type property of type property has not been set"
file:/D:/LCM/LCM-SDF-DataModel.xml failed to import
Any pointers ? Thx -
Conveting a BO report into XML format
Post Author: Gunjan
CA Forum: Integrated Solutions
Hi,
We have a requirement to convert BO Report into XML format.
Could you please help if there is any tool available to directly convert BO report into an XML based on a predefind XSD.
Thanks
GunjanPost Author: Gunjan
CA Forum: Integrated Solutions
Hi,
We have a requirement to convert BO Report into XML format.
Could you please help if there is any tool available to directly convert BO report into an XML based on a predefind XSD.
Thanks
Gunjan -
Tool or mechanism to put the Oracle metadata into XML format
Hi,
Is there any tool or mechanism provided by Oracle to put the Oracle metadata into XML format?I mean metadata here represents Database objects like Tables, Columns, Schemas, stored procedures, Table spaces etc.
Regards,
DayakarFrom 9i and onwards, the dbms_metadata package will do this.
Either use the documentation or Morgan's library [http://www.psoug.org/reference] for further info
Sybrand Bakker
Senior Oracle DBA -
Converting Javabeans into XML format
HI,
I have wrote program that will read input from users then stored them in javabeans. I used the serialize function to create xml file from the javabeans.
public static void CreateXML(LocationRequest location)
try
// Serialize object into XML
XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(
new FileOutputStream("test.xml")));
encoder.writeObject(location);
encoder.close();
} catch (FileNotFoundException e) {
The output file is as follows :
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.4.1_05" class="java.beans.XMLDecoder">
<object >
<void property="address">
<string>21212122</string>
</void>
<void property="originatorId">
<string>Anu</string>
</void>
</object>
</java>
Could anyone has idea on how i can change the above xml file into another new xml format like below:-
<address> 21212122</address>
<originatorId> "Anu "</originatorId>
Cheers,
BambliThe quickest way would be to use XSLT. Write a stylesheet that converts your 1st format to your 2nd format.
Here's an example stylesheet. (I'm a little rusty on my XSL so you'll want to test this.)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<!-- simply copy the message to the result tree -->
<xsl:template match="/java/object/void/@property">
<xsl:element name="local-name()">
<xsl:value-of select="text()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet> Feed this to a transformer as follows:
javax.xml.transform.TranformFacotry factory = javax.xml.transform.TransformerFactory.newInstance();
javax.xml.transform.stream.StreamSource source = new javax.xml.transform.stream.StreamSource(new java.io.File("yourstylesheet.xsl"));
javax.xml.transform.Transformer xformer =factory.newTransformer(source);
xformer.transform(new javax.xml.transform.stream.StreamSource(new java.io.File("yourbean.xml")),new javax.xml.transform.stream.StreamResult(new java.io.File("yourconverted.xml")));Its that simple.
Cliff -
How to convert ALV output into XML format.
Hi all,
I just want to know how to convert an ALV output into a XML format, this is really urgent.
regards,
Ruchika sainiThis program exports an internal table to an XML file. *----
Report ZPRUEBA_MML_13 *
Export an internal table to XML document *
NO BORRAR ESTE CODIGO *
REPORT ZPRUEBA_MML_13.
PANTALLA SELECCION *
PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
PANTALLA SELECCION *
TYPE TURNOS *
TYPES: BEGIN OF TURNOS,
LU LIKE T552A-TPR01,
MA LIKE T552A-TPR01,
MI LIKE T552A-TPR01,
JU LIKE T552A-TPR01,
VI LIKE T552A-TPR01,
SA LIKE T552A-TPR01,
DO LIKE T552A-TPR01,
END OF TURNOS.
TYPE TURNOS *
TYPE SOCIO *
TYPES: BEGIN OF SOCIO,
NUMERO LIKE PERNR-PERNR,
REPOSICION LIKE PA0050-ZAUVE,
NOMBRE LIKE PA0002-VORNA,
TURNOS TYPE TURNOS,
END OF SOCIO.
TYPE SOCIO *
ESTRUCTURA ACCESOS *
DATA: BEGIN OF ACCESOS OCCURS 0,
SOCIO TYPE SOCIO,
END OF ACCESOS.
ESTRUCTURA ACCESOS *
START OF SELECTION *
START-OF-SELECTION.
PERFORM LLENA_ACCESOS.
PERFORM DESCARGA_XML.
END-OF-SELECTION.
END OF SELECTION *
FORM LLENA_ACCESOS *
FORM LLENA_ACCESOS.
REFRESH ACCESOS.
CLEAR ACCESOS.
MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
'0' TO ACCESOS-SOCIO-REPOSICION,
'T1' TO ACCESOS-SOCIO-TURNOS-LU,
'T2' TO ACCESOS-SOCIO-TURNOS-MA,
'T3' TO ACCESOS-SOCIO-TURNOS-MI,
'T4' TO ACCESOS-SOCIO-TURNOS-JU,
'T5' TO ACCESOS-SOCIO-TURNOS-VI,
'T6' TO ACCESOS-SOCIO-TURNOS-SA,
'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
CLEAR ACCESOS.
MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
'0' TO ACCESOS-SOCIO-REPOSICION,
'T1' TO ACCESOS-SOCIO-TURNOS-LU,
'T2' TO ACCESOS-SOCIO-TURNOS-MA,
'T3' TO ACCESOS-SOCIO-TURNOS-MI,
'T4' TO ACCESOS-SOCIO-TURNOS-JU,
'T5' TO ACCESOS-SOCIO-TURNOS-VI,
'T6' TO ACCESOS-SOCIO-TURNOS-SA,
'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
ENDFORM.
FORM LLENA_ACCESOS *
FORM DESCARGA_XML *
FORM DESCARGA_XML.
DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
G_IXML TYPE REF TO IF_IXML,
W_STRING TYPE XSTRING,
W_SIZE TYPE I,
W_RESULT TYPE I,
W_LINE TYPE STRING,
IT_XML TYPE DCXMLLINES,
S_XML LIKE LINE OF IT_XML,
W_RC LIKE SY-SUBRC.
DATA: XML TYPE DCXMLLINES.
DATA: RC TYPE SY-SUBRC,
BEGIN OF XML_TAB OCCURS 0,
D LIKE LINE OF XML,
END OF XML_TAB.
CLASS CL_IXML DEFINITION LOAD.
G_IXML = CL_IXML=>CREATE( ).
CHECK NOT G_IXML IS INITIAL.
M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
CHECK NOT M_DOCUMENT IS INITIAL.
WRITE: / 'Converting DATA TO DOM 1:'.
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
EXPORTING
NAME = 'ACCESOS'
DATAOBJECT = ACCESOS[]
IMPORTING
DATA_AS_DOM = L_DOM
CHANGING
DOCUMENT = M_DOCUMENT
EXCEPTIONS
ILLEGAL_NAME = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
SY-SUBRC.
ENDIF.
CHECK NOT L_DOM IS INITIAL.
W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
IF W_RC IS INITIAL.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
W_RC.
ENDIF.
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
DOCUMENT = M_DOCUMENT
IMPORTING
XML_AS_STRING = W_STRING
SIZE = W_SIZE
TABLES
XML_AS_TABLE = IT_XML
EXCEPTIONS
NO_DOCUMENT = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
SY-SUBRC.
ENDIF.
LOOP AT IT_XML INTO XML_TAB-D.
APPEND XML_TAB.
ENDLOOP.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_SIZE
FILENAME = GK_RUTA
FILETYPE = 'BIN'
TABLES
DATA_TAB = XML_TAB
EXCEPTIONS
OTHERS = 10.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
Message was edited by:
Hymavathi Oruganti -
Convert binary data (TIFF image) into XML - how ?
Hi,
I have the following requirement:
1. A document is scanned and a TIFF image is saved in a directory
2. The File adapter picks up the image file and sends into XI
3. The binary data is converted into XML so a Web Service can be called (this web service will store the image in a database application)
<b>The part I am struggling with is the convert of the incoming binary data into a XML format document which will allow the Web Service to be called.</b>
Graphical mapping cannot be used therefore I am left with 3 options:
1. XSLT mapping
2. Java mapping
3. ABAP mapping
Can anyone suggest the best option to use in these circumstances and provide some sample snippet of code on how to do it.
I am alright at XSLT mapping but this is beyond me and Java mapping is completely new to me as I have very limited Java knowledge.
Thanks for your help
Colin.Hi Colin
Look for the below link
https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b
<b>***Reward point if helpfull</b>
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee56c0b</a> -
How to convert the alv list data into pdf format
Hi Expersts,
Is it possible to convert the alv list output data into PDF format? if yes, then please help me with this issue.
thanks in advance,
Regards,
Samadhii samad,
you can go through these link.i hope it ll solve your purpose
How to convert list output to PDF
Display ALV list output in PDF format
regards,
Shweta
Maybe you are looking for
-
How to connect an early 2009 MacBook Pro to a TV via HDMI
I have the cables and adapter but am only getting one image when all is hooked up.......what else need I do? I've seen youtube instructions but I seem to lack the "arrangement menu under the "displays" preference....... Is this MacBook unable to run
-
MacBook Air crashes/powers down each time it's turned on.
I replaced OS 10.6.8 on my MacBook Air with Lion 10.7 when Lion became available last week. Last night I noticed some odd behavior -- extremely slow "genii" minimization of screens, duplications of key strokes, and other anomalies. Then today, each t
-
Perl API: growing memory problem in loops over large sets of data
Hi, When going through all XmlResults like this: while ($results->next($val)) { print $val->asString, "\n"; The process size keeps growing. It does not when I comment $val->asString method out, but then I have no way of getting the results. This beco
-
Re: Problems with pulling data from database
OK, I figured it out I believe. In the second recordset called rsEligibility, I dimmed it, then set rsEligibility_svuserid= "0". and then put in an if statement. In IIS 5 it worked, but not in IIS6. What I had to do was take out the part that set rsE
-
Add 17 minutes from the systen date
Update the entry_date by getting the system data + 17 minutes. Anyone, can provide solution for this? SELECT TO_CHAR(sysdate, 'fmDD-MON-YYYY fmHH24:MI:SS') FROM DUAL;