XML File from SQL Query

I have created XML File from Query using below function:-
select dbms_xmlgen.getxml('
select * from tblreports where rownum<=1') from dual;
"(CLOB) <?xml version="1.0"?>
<ROWSET>
<ROW>
<REPORTID>preRES0011</REPORTID>
<ALIAS>Date wise Summary of pins Report</ALIAS>
<ACTIVE>Y</ACTIVE>
<TITLE>Date wise Summary of pins Report</TITLE>
<QUERY>select tsb.month1,
count(SIDNUMBER)GENERATED,
sum(case WHEN SERIALSTATUSID=&apos;SRS01&apos; THEN 1 ELSE 0 END)NotAllocated,
SUM(CASE WHEN SERIALSTATUSID=&apos;SRS02&apos; or SERIALSTATUSID=&apos;SRS03&apos; or SERIALSTATUSID=&apos;SRS05&apos; THEN 1 ELSE 0 END)ALLOCATED,
SUM(CASE WHEN SERIALSTATUSID=&apos;SRS02&apos; or SERIALSTATUSID=&apos;SRS01&apos; THEN 1 ELSE 0 END)NOTASSIGNEDTORESELLER,
SUM(CASE WHEN SERIALSTATUSID=&apos;SRS03&apos; THEN 1 ELSE 0 END)READYTOACTIVATE,
sum(CASE WHEN SERIALSTATUSID=&apos;SRS05&apos; THEN 1 ELSE 0 END)ACTIVATED,
sum(CASE WHEN SERIALSTATUSID=&apos;SRS06&apos; THEN 1 ELSE 0 END)Terminated,
sum(CASE WHEN SCRAPSTATUSID=&apos;CST01&apos; THEN 1 ELSE 0 END)scraped,
sum(CASE WHEN LOCKSTATUSID=&apos;CST01&apos; THEN 1 ELSE 0 END)locked,
NULL,
     NULL,
     NULL,
     NULL,
     NULL,
NULL,
NULL     
from (SELECT TO_CHAR(CREATEDATE,&apos;DD-MON-YYYY&apos;)MONTH1 ,PINUSAGEMODEID,SERIALBATCHID,SERIALIDCOUNT,CREATEDATE FROM TBLMSERIALBATCH )TSB,
tblmserial ts
where TSB.SERIALBATCHID=ts.SERIALBATCHID
and to_char(TSB.CREATEDATE,&apos;MON-YYYY&apos;)=&apos;$1&apos;
GROUP BY TSB.MONTH1
order by TO_DATE(MONTH1,&apos;dd-mon-yyyy&apos;) DESC</QUERY>
<CONNECTIVITYID>C0001</CONNECTIVITYID>
<INPUTREQUIRED>Y</INPUTREQUIRED>
<INPUTNAME>Month</INPUTNAME>
<CREATEDATE>30-JAN-10</CREATEDATE>
<LASTMODIFIEDDATE>22-FEB-10</LASTMODIFIEDDATE>
<CREATEDBY>reportadmin</CREATEDBY>
<LASTMODIFIEDBY>reportadmin</LASTMODIFIEDBY>
<TITLEPARAM>Y</TITLEPARAM>
<SUBTITLE>Date wise Summary of pins Report For &amp;1</SUBTITLE>
<ELEMENTTYPEID>AET002</ELEMENTTYPEID>
<REPORTTYPEID>RTP01</REPORTTYPEID>
<SORTFIELD>Disable</SORTFIELD>
</ROW>
</ROWSET>
But in that it is taking '&apos;' for ' ' instead of '$1' it is taking &apos;$1&apos;
how to keep ' ' in XML file instead of &apos?

You can use bcp with query out option
use your above query as the source query and use queryout option after specifying destination as your required local file path (specify extension as .xml)
see
http://visakhm.blogspot.com/2013/10/bcp-out-custom-format-data-to-flat-file.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • How to make an XML file from SQL query on local disc (c:\temp)?

    This query shows me XML results, but can I somehow make an XML file to local disc?
    Thanks.
    DECLARE @IMO NUMERIC(8,0)
    DECLARE @Counter INT
    SELECT @Counter = 1
    WHILE ( @Counter <15 )
    BEGIN
    SET @IMO = (SELECT ImoNo from Vessel where ID=@Counter)
    SELECT top 1
    @IMO as ImoNumber,
    VesselName,
    Time,
    lat as CurrentLatitude,
    lon as CurrentLongitude,
    sog as SpeedOverGround,
    cog as CourseOverGround,
    hdg as HeadingInDegrees,
    GoingToCountry = (SELECT TOP 1 CountryName
    FROM ShipSchedule
    WHERE ImoNo = @IMO and DestPosArrived = 'false'
    ORDER BY DestPosETA ),
    GoingToHarbour = (SELECT TOP 1 Harbour
    FROM ShipSchedule
    WHERE ImoNo = @IMO and DestPosArrived = 'false'
    ORDER BY DestPosETA ),
    DestinationLatitude = (SELECT TOP 1 DestPosLAT
    FROM ShipSchedule
    WHERE ImoNo = @IMO and DestPosArrived = 'false'
    ORDER BY DestPosETA ) ,
    DestinationLongitude = (SELECT TOP 1 DestPosLON
    FROM ShipSchedule
    WHERE ImoNo = @IMO and DestPosArrived = 'false'
    ORDER BY DestPosETA ),
    ArrivalTime = (SELECT TOP 1 DestPosETA
    FROM ShipSchedule
    WHERE ImoNo = @IMO and DestPosArrived = 'false'
    ORDER BY DestPosETA ),
    GoingFromCountry = (SELECT TOP 1 CountryName
    FROM ShipSchedule
    WHERE ImoNo = @IMO and DestPosArrived = 'true'
    ORDER BY DestPosETA desc),
    GoingFromHarbour = (SELECT TOP 1 Harbour
    FROM ShipSchedule
    WHERE ImoNo = @IMO and DestPosArrived = 'true'
    ORDER BY DestPosETA desc),
    DepartureTime = (SELECT TOP 1 DestPosETD
    FROM ShipSchedule
    WHERE ImoNo = @IMO and DestPosArrived = 'true'
    ORDER BY DestPosETA desc)
    FROM Position
    WHERE ImoNo = @IMO
    order by time desc
    for Xml AUTO,elements,root('SplosnaPlovba')
    SELECT @Counter = @Counter + 1
    END

    You can use bcp with query out option
    use your above query as the source query and use queryout option after specifying destination as your required local file path (specify extension as .xml)
    see
    http://visakhm.blogspot.com/2013/10/bcp-out-custom-format-data-to-flat-file.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to generate XML file from SQL file !

    I am new to XML publisher. I known one way to generate XML file is register one report file in concurrent manager.
    But I want to generate XML file from sql file.
    Could someone show me how to code in sql file, how to register is in concurrent manager.
    Thanks !

    Hi
    Phew ... not sure we have the space here. So I can point you in the right direction:
    1. XML data generation - there are two packages in the db you can use with a plsql procedure, XMLGEN and SQL XML. You can also use java APIs too. Try checking the db documentation and search for the above methods.
    2. Registering the report - the system administrators guide will provide this info. Hooking the program up with XMLP is covered here - http://www.oracle.com/technology/products/applications/publishing/resource/CM%20Whitepaper5.0.pdf
    Regards, Tim

  • Generate an xml file from Database query results

    Hi, can anyone help me out with this problem I'm having. What are the steps in creating an xml file directly from the results of a database query. I currently have a very simply process that queries a database via a partner link. The query returns the data but it's from this point that I am stuck. I need to create an xml file with the data along with the xml tags. I've looked at dozens of tutorials with no luck.
    I would greatly appreciate help with this.
    bpel rookie

    Should be quite simple.
    Create another partnerlink, configure it to use the file adapter, and write to an XML file. In this case you need to create an XML Schema (.xsd) of the file you want to create.
    Before you write to the file, either add assign steps to copy individual attributes or use a transform activity to convert from the database format to the file (xml) format.

  • Create XML file from SQL trigger

    I have to create a XML file of a record when a certain column of table Absences is updated. I have the following bcp command in the (after update) trigger :
        bcp "select absences.HID, absences.Amount,absences.Itemcode,absences.Itemcount, absences.[Description],absences.PRocessnumber, Cicmpy.ID from absences inner join cicmpy on cicmpy.cmp_wwn = absences.HID where absences.Type = 110  for
    XML RAW (''Order''), ROOT (''Orders''), ELEMENTS XSINIL" QUERYOUT "c:\filename.xml" -T -SJR8512\sql2008 -c -d100'
    When the trigger is fired, the table get's a lock, so the file isn't created. What am I missing?

    As Russ says: Service Broker is exactly what you want. The trigger would put a message on the Service Broker queue. (And the message would be the XML document created from the inserted/deleted tables.) In the other application you would have an activation
    procedure that processes the message.
    If you have never worked with Service Broker, this book is an excellent start:
    http://www.amazon.com/Rational-Server-Service-Broker-Guides/dp/1932577270/ref=sr_1_1?ie=UTF8&qid=1399411944&sr=8-1&keywords=wolter+service+broker
    Also, bookmark Remus Rusanu's blog:
    http://rusanu.com/blog/
    Lot's of tips there.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Generate PDF file from sql query

    I have a table having some now i want to perform some calculation on tht data and then want to export it into a 
    pdf file.
    All this thing thing i want to write in a sql query so tht i can put it in a stored procedure .
    Kindly suggest.

    timberwoods,
    One way is to use SSRS. You may embed a query and it generates the report which you can always download as pdf, excel etc. Look up on the net for this - that shud probably solve your requirement!!
    If not, found this at codeproject - allows you to generate pdfs - again using SSRS !
    http://www.codeproject.com/Articles/19236/Create-data-driven-PDF-on-the-fly-by-using-SQL-ser
    http://www.sqlservercentral.com/articles/Miscellaneous/creatingapdffromastoredprocedure/1104/
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Question about creating multiple XML files from same query

    I have a query like this:
    select * from emp;
    ename empno deptno
    Scott 10001 10
    Tiger 10002 10
    Hanson 10003 20
    Jason 10004 30
    I need to create multiple output files in xml format for each dept
    example:
    emp_dept_10.xml
    emp_dept_20.xml
    emp_dept_30.xml
    each file will have the information for employees in different departmemts.
    We are using DBMS_XMLGEN package to generate XML.
    The reason I need to do this is to avoid executing the same query 200 times for generating the same output for different departments. Please let me know if it is practically possible to do this.
    Any input is greatly appreciated.
    Thanks a lot!!

    one solution i can think of is to use SQLX operator instead of dbms_xmlgen.
    here is a sample example.
    declare
      l_xmltype xmltype;
      l_deptno  emp.deptno%type;
    begin
      for i in (select * from emp order by deptno)
      loop
        select xmlconcat(
                    xmlelement("ename", i.ename)
                   ,xmlelement("sal", i.sal)
                   ,xmlelement("detpno", i.deptno))
          into l_xmltype from dual;
        dbms_output.put_line(l_xmltype.GetClobVal());
      end loop;
    end;
    /Now here you can open the query once, keep writing to the file till the deptno
    is same, when the deptno changes, close the file and open a new file with new
    deptno and start writing.
    Note : in this way you will have to add the xmlprolog manually to each of the file which should not be an issue. after opening the file add the prolog string manually.
    Hope this helps.

  • How to get Hierarchical XML File from a Database Join Query !

    Hi,
    How can i get a Hierarchical XML File from a Database Join Query ?
    Any join query returns repeated values as below:
    BD17:SQL>select d.dname, e.ename, e.sal
    2 from dept d
    3 natural join
    4 emp e
    5 /
    DNAME ENAME SAL
    ACCOUNTING CLARK 2450
    ACCOUNTING KING 5000
    ACCOUNTING MILLER 1300
    RESEARCH SMITH 800
    RESEARCH ADAMS 1100
    RESEARCH FORD 3000
    RESEARCH SCOTT 3000
    RESEARCH JONES 2975
    SALES ALLEN 1600
    SALES BLAKE 2850
    SALES MARTIN 1250
    SALES JAMES 950
    SALES TURNER 1500
    SALES WARD 1250
    14 rows selected.
    We tried use DBMS_XMLQUERY to generate a xml file, but it was unable to get xml in Hierarchical format.
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    - <ROWSET>
    - <ROW num="1">
    <DNAME>ACCOUNTING</DNAME>
    <ENAME>CLARK</ENAME>
    <SAL>2450</SAL>
    </ROW>
    - <ROW num="2">
    <DNAME>ACCOUNTING</DNAME>
    <ENAME>KING</ENAME>
    <SAL>5000</SAL>
    </ROW>
    - <ROW num="3">
    <DNAME>ACCOUNTING</DNAME>
    <ENAME>MILLER</ENAME>
    <SAL>1300</SAL>
    </ROW>
    - <ROW num="4">
    <DNAME>RESEARCH</DNAME>
    <ENAME>SMITH</ENAME>
    <SAL>800</SAL>
    </ROW>
    - <ROW num="5">
    <DNAME>RESEARCH</DNAME>
    <ENAME>ADAMS</ENAME>
    <SAL>1100</SAL>
    </ROW>
    - <ROW num="6">
    <DNAME>RESEARCH</DNAME>
    <ENAME>FORD</ENAME>
    <SAL>3000</SAL>
    </ROW>
    - <ROW num="7">
    <DNAME>RESEARCH</DNAME>
    <ENAME>SCOTT</ENAME>
    <SAL>3000</SAL>
    </ROW>
    - <ROW num="8">
    <DNAME>RESEARCH</DNAME>
    <ENAME>JONES</ENAME>
    <SAL>2975</SAL>
    </ROW>
    - <ROW num="9">
    <DNAME>SALES</DNAME>
    <ENAME>ALLEN</ENAME>
    <SAL>1600</SAL>
    </ROW>
    - <ROW num="10">
    <DNAME>SALES</DNAME>
    <ENAME>BLAKE</ENAME>
    <SAL>2850</SAL>
    </ROW>
    - <ROW num="11">
    <DNAME>SALES</DNAME>
    <ENAME>MARTIN</ENAME>
    <SAL>1250</SAL>
    </ROW>
    - <ROW num="12">
    <DNAME>SALES</DNAME>
    <ENAME>JAMES</ENAME>
    <SAL>950</SAL>
    </ROW>
    - <ROW num="13">
    <DNAME>SALES</DNAME>
    <ENAME>TURNER</ENAME>
    <SAL>1500</SAL>
    </ROW>
    - <ROW num="14">
    <DNAME>SALES</DNAME>
    <ENAME>WARD</ENAME>
    <SAL>1250</SAL>
    </ROW>
    </ROWSET>
    Thank you for some help.
    Nelson Alberti

    Hi,
    I wrote a general ABAP program which can be configured to grab contrent from an URL and post that content as a new PI message into the integration adapter .... from that point on normal PI configuration can be used to route it to anywhere ...
    It can be easily scheduled as a background job to grab content on a daily basis etc ...
    Regards,
    Steven

  • How to read a XML file from BLOB column and insert in a table - PL/SQL Only

    Hi,
    To make data load more simple to end user instead placing file on the server and use SQL-LOADER, I came up with new idea that using oracle ebusiness suite attachment functionality. that loads a XML file from local PC to a database column(table is fnd_attachments, default data type is BLOB over here).
    I tried with DBMS_LOB and didnt get around.
    Please can anyone tell me how to read the BLOB column using PL/SQL and store the data in a oracle table. Here's the sample XML file and table structure FYI.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Corporate_alloc.xsd" generated="2009-07-07T14:17:49">
    <Corporate_alloc>
    <PKG_CODE>BKCORP</PKG_CODE>
    <PKG_NAME>Corporate Edition - Books</PKG_NAME>
    <DET_CODE>B9780080543758</DET_CODE>
    <DET_NAME>Waves, Tides and Shallow-Water Processes</DET_NAME>
    <ALLOCATION_RATIO>0.000041</ALLOCATION_RATIO>
    </Corporate_alloc>
    <Corporate_alloc>
    <PKG_CODE>BKCORP</PKG_CODE>
    <PKG_NAME>Corporate Edition - Books</PKG_NAME>
    <DET_CODE>B9780080534343</DET_CODE>
    <DET_NAME>Hydrostatically Loaded Structures</DET_NAME>
    <ALLOCATION_RATIO>0.000127</ALLOCATION_RATIO>
    </Corporate_alloc>
    </dataroot>
    CREATE TABLE TEST_XML
    ( PKG_CODE VARCHAR2(50),
    PKG_NAME VARCHAR2(100),
    DET_CODE VARCHAR2(20),
    DET_NAME VARCHAR2(500),
    ALLOCATION_RATIO NUMBER )
    Thanks
    EBV

    In regards to #3, use the COLUMNS functionality of XMLTable instead of using Extract. Two simple examples are
    Re: XML Data - Caliculate fields
    Re: Extractvalue function not recognised

  • Creating an XML file from multiple sql tables

    I have very little xml experience, but need to generate an xml file from multiple table. I know what the output needs to look like, but do not know how to setup the code. Any help would be appreciated.
    - <Practice SourceID="EPIC" ExternalPracticeID="PPAWB">
    - <Provider ExternalProviderID="TB2" FirstName="THOMAS G" LastName="BREWSTER">
    - <Patient ExternalPatientID="99999" OldExternalPatID="" FirstName="test" MiddleName="J" LastName="test" Gender="M" DateOfBirth="2005-08-12" SocSecNumber="000-00-0000" LanguageID="22" AddressOne="test" AddressTwo="" City="test" StateID="20" ZipCode="99999" DayPhone="" EveningPhone="207-999-9999" StatusID="">
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="32" MeasureValue="3" MeasureDate="2008-10-24 13:51:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2009-02-09 10:09:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 14:23:00" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:51:00" MeasureDate="2008-10-24 13:51:00" />
    </Patient>
    </Provider>
    </Practice>

    You are interested in XMLElement and probably XMLAgg. Since you didn't list a version, I can't provide links to the corresponding documentation. I cringe at all the attributes on the Patient element as that info should really be elements.
    To create the Measure node, your overall SQL statement may look something like (not tested)
    SELECT XMLElement....
              XMLAgg(SELECT XMLElement
                       FROM measures_table
                      WHERE join condition to parent)
      FROM patient,
           provider,
           practice
    WHERE join conditionsFor additional help, please include your version (4 digits), some sample data, and what you have tried.

  • How to generate XML file from oracle database query result

    Hi dudes,
    as stated on the subject, can anyone suggests me how can i achieve the task stated above??
    Here is a brief description of my problem:
    I need to create a XML file once i query from the oracle database, and the query result returned from the database will be stored in XML file.
    I'd searched around the JAXB, DOM, SAXP and the like basic concepts, but i still don't know how to start??
    Any suggestions ???

    Read this:
    http://www.cafeconleche.org/books/xmljava/chapters/ch08s05.html
    You might have to read more of the book to understand that chapter.

  • SSMS 2012: Import XML File to SQL Table - 'value' is not a recognized built-in function name!!??

    Hi all,
    I have the following xml file (books1.xml):
    <bookstore>
    <book>
    <BookID>1</BookID>
    <title>Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>
    <book>
    <BookID>2<BookID>
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
    </book>
    <book>
    <BookID>3<BookID>
    <title>XQuery Kick Start</title>
    <author>James McGovern</author>
    <year>2003</year>
    <price>49.99</price>
    </book>
    <book>
    <BookID>4<BookID>
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
    </book>
    </bookstore>
    In my Microsoft SQL Server 2012 Management Studio, I executed the following SQL Query code:
    --XQuery w3schools example using books1.xml in C:\Temp folder
    ---SQL Query W3books Title
    ---9 March 2015
    USE XML_XQUERY
    GO
    CREATE TABLE W3Books(
    BookID INt Primary Key,
    Title VARCHAR(30));
    INSERT INTO W3Books (BookID, Title)
    SELECT x.book.query('BookID'), value('.', 'INT'),
    x.book.query('title'), value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'C:\Temp\books1.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('W3Books/book') AS x(book);
    SELECT BookID, Title
    FROM W3Books;
    I got the following error messages:
    Msg 195, Level 15, State 10, Line 7
    'value' is not a recognized built-in function name.
    Msg 156, Level 15, State 1, Line 16
    Incorrect syntax near the keyword 'AS'.
    I don't know why I got the error of 'value' is not a recognized built-in function name. Please kindly help and tell me what is wrong in my code and how to correct the error.
    Thanks, Scott Chang
    P. S.
    (1) I mimicked the xml file and SQL Qeury code of Import XML File to SQL Table in
    http://pratchev.blogspot.com/2008/11/import-xml-file-to-sql-table.html. The xml file and the code of this sample worked in my SSMS 2012 program.
    (2) I am learning the "CAST" and "CROSS APPLY" in the Create Instances of XML Data of Microsoft MSDN - it is very abstract to me.

    Hi Stan210, Thanks for your nice response.
    I corrected my xml file as you pointed out.
    I made some changes in some code statements of my SQLQueryW3BookTitle.sql as you instructed:
    --XQuery w3schools example using books1.xml in C:\Temp folder
    ---SQL Query W3books Title
    ---10 March 2015
    USE XML_XQUERY
    GO
    CREATE TABLE W3Books(
    BookID INt Primary Key,
    Title VARCHAR(30));
    INSERT INTO W3Books (BookID, Title)
    SELECT x.book.value('/BookID[1]', 'INT'),
    x.book.value('/title[1]', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'C:\Temp\books1.xml',SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('bookstore/book') AS x(book);
    SELECT BookID, Title
    FROM W3Books;
    I executed my revised sql and I got the following Message and Results:
    Msg 515, Level 16, State 2, Line 6
    Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls. INSERT fails.
    The statement has been terminated.
    (0 row(s) affected)
    Results:
    BookID    Title
    I don't know why I just got the names of columns in Results and the "Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls, insert fails." in Messages.  Please kindly help, advise me
    how to correct the errors and respond again.
    Many Thanks again,
    Scott Chang

  • How to generate an XML file from SSIS (based on an XSD)?

    I have an XSD that describes an XML format. I also have a sample XML file as well from the XSD. I am trying to understand SSIS's capability to generate the XML file in an ETL process. I would need to create the XML file based on the XSD that
    I have. It is safe to assume that all the data elements are in the DB that I am incorporating in the ETL and it is also safe to assume that the data in the XML may be from multiple different tables (so massaging is probably necessary). 
    Would this be a job for C#/VB or can I do this through an SSIS process/task? Please help me understand my options. Thanks.

    Dear All,
    Indeed the post by RamJaddu did not answer the question. I am having the same issue: I have been provided an .xsd file which contains a data schema, and I have all of the necessary
    data in a .mdf file in order to create the required .xml file. Having queried SQL Server and received my data in "myDataSet" I can use C# to create the .xml ignoring the schema using
    string strSchemaFile = @"F:\Documents\UserCost\VictorianDataCollection\VCDCSchema_v2.xsd";
    string strXmlFile = "testXmlExport.xml";
    myDataSet.WriteXmlSchema(strSchemaFile);
    myDataSet.WriteXml(strXmlFile, XmlWriteMode.IgnoreSchema);
    but how do I export the .xml file so that is conforms with the .xsd format?
    If any of you have worked this out the answer would be most appreciated.
    All the best,
    Nick
    "Everything should be made as simple as possible, but not simpler" - Einstein

  • How to generate an xml file from a soapbody

    i'm trying to use SOAPMESSAGE from a webservice as a Datasource for my JasperReport, I'm thinking of doing it as getting the SOAPBody and saving it as xml file and setting that xml file as datasource to my JasperReport. My problem is how will a get the SOAPBody and save it as an xml file? or is there other way to make SOAP from webservice as a datasource for my Jasperreport?
    Thanks in advance for your help.

    Dear All,
    Indeed the post by RamJaddu did not answer the question. I am having the same issue: I have been provided an .xsd file which contains a data schema, and I have all of the necessary
    data in a .mdf file in order to create the required .xml file. Having queried SQL Server and received my data in "myDataSet" I can use C# to create the .xml ignoring the schema using
    string strSchemaFile = @"F:\Documents\UserCost\VictorianDataCollection\VCDCSchema_v2.xsd";
    string strXmlFile = "testXmlExport.xml";
    myDataSet.WriteXmlSchema(strSchemaFile);
    myDataSet.WriteXml(strXmlFile, XmlWriteMode.IgnoreSchema);
    but how do I export the .xml file so that is conforms with the .xsd format?
    If any of you have worked this out the answer would be most appreciated.
    All the best,
    Nick
    "Everything should be made as simple as possible, but not simpler" - Einstein

  • Receive XML file from CIDX adapter and Post to SAP as IDoc using XI

    I have scenario where we will receive the xml file from CIDX adapter. I need to take the xml from CIDX, do the Database Lookup and post it to SAP as IDoc.
    Any technical documentaion or step-by-step process documents can be very helpfull to me, since I am new to XI
    Thanks
    SP

    Lookup in XI is used to call the target data storage system and get data from there to your mapping programme.
    In XI you can do Lookup in Message Mapping, Java Mapping and in XSLT Mapping. Previously Lookup in XI was system dependent. But now what ever the system are i.e. SAP system or non-sap system(Oracle,MS SQL etc) lookup API are same.
    Overview of Lookup
    - Lookups are used to identify/request the data from mapping program.
    - It interrupt the process and looking for data which was stored in target system.
    - It get that data and comeback to process and continue with that data.
    Types of Lookups in XI
    - JDBC Lookup: JDBC lookup is used for accessing data from database (non SAP).
    - RFC Lookup: RFC lookup is used for accessing the SAP Data.
    - SOAP Lookup: SOAP lookup is used for accessing data from Webservice
    Steps to perform Lookup in Mapping
    Import package com.sap.aii.mapping.lookup.*;
    Create connection to the target Database system.
    // Determine communication channel created in ID
    Channel channel = null;
    channel = LookupService.getChannel("DB-SYSTEM-NAME","DB-CHANNEL-NAME");
    // Get system accessor for the channel.
    DataBaseAccessor accessor = null;
    accessor = LookupService.getDataBaseAccessor(channel);
    Build the Query String.
    Getting Result
    // Execute Query and get the values.
    DataBaseResult resultSet = null;
    resultSet = accessor.execute(Query);

Maybe you are looking for

  • Out of memory? i have deleted programs and recordings and no changes are recognized in memory

    I cannot take pictures because the "out of memory" comes up on the built in app. I can however take pics with hiptsamatic. What is going on with this memory. I deleted several apps with 100 megs and the memory numbers do not change or adjust downward

  • Bapi in a badi, error call_function_conflict_leng

    Hi, i'm using the bapi BAPI_REL_CREATERELATION in the badi IF_EX_ECM_UPDATE~CHANGE_IN_UPDATE. But there is an rutime error that doesnt continue, that is call_function_conflict_leng. Did anyone have this error. plz help me, regards, Diego

  • Completion Insight for Sybase

    I'm using Sql Developer version 2.1 to connect to a sybase database using the jTDS driver. The user interface is really nice and slick and way better than what sybase central provides. The one issue that is bugging me a lot though is the completion i

  • Solution manager maxdb 7.6 connection problem

    Hi, after SSm installation, the ssm instance is up and I can work in solution manager system, but if i try to do transport or if I try to connect with Maxdbclinet to db I receive the following connection error: ERROR => Connect to database failed, rc

  • ECP and OWA === HTTP 404 not found

    hello plz i need your help, i want to access to my ecp interface but when i do i have the following error: i uninstall and reinstall IIS but still the same probleme and all my services are running! B.R