About

I’ve worked in the IT industry since 1987 — out of these 3 years in Italy and 3 years in London. I have more than 14 years of experience with Oracle and I primarily work with the following technologies: Oracle SQL, PL/SQL and object-oriented PL/SQL, Java, HTML, JavaScript, CSS and XML.

Since 2006, I’ve been applying Agile methodologies in my projects and have been focusing my attention on enhancing both automated testing and Agile development in the Oracle world.

I am an Oracle Advanced PL/SQL Developer Certified Professional (OCP Advanced PL/SQL) and Sun Certified Programmer for Java 5 (SCJP).

Oracle Advanced PL/SQL Developer Certified Professional (OCP Advanced PL/SQL)Sun Certified Programmer for Java 5 (SCJP)

Read more about me on

11 Responses to About

  1. Raj Naraparaju. says:

    Hi Finn,

    I read your earlier posts on XML. I have a question. I was wondering if you could resolve it for me. My question is below:

    QUESTION:
    I need to generate an XML file from table data. I am new to XML and need some help. I was able to do it through a block using dbms_xmlgen. Now I need to add header information instead of the default <?xml version="1.0"?. I would like to add below header information and generate an XML file as below. I am working on Oracle Daabase 11g.

    Any help is greatly appreciated!

    Thank you!
    Raj Naraparaju.

    EMPLR-Footnote
    10/16/2013 11:35:42 AM
    10/16/2013 11:35:42 AM
    5

    101
    Neena
    Kochhar
    NKOCHHAR
    515.123.4568
    21-SEP-05
    AD_VP
    17000
    100
    90

  2. Raj Naraparaju. says:

    The site took out my XML code. I am reposting it again. I need help with the Header part.

    Thanks,
    Raj Naraparaju.

    #
    # EMPLR-Footnote
    #10/16/2013 11:35:42 AM
    #10/16/2013 11:35:42 AM
    #5
    #

    #
    #
    #101
    #Neena
    #Kochhar
    #NKOCHHAR
    #515.123.4568
    #21-SEP-05
    #AD_VP
    #17000
    #100
    #90
    #
    #/EmployeeDetails>

  3. ellebaek says:

    Hi Raj

    It’s not clear to me what you’re after because it’s difficult to interpret the XML without the tags.

    In order to avoid the offending XML tag characters that are removed by WordPress when you write them in the comment, try replacing the “less than” character with { and the “greater than” character with }.

    Hope this helps. I wish it was easier to include tags in WordPress comments but I realize they are removed for security reasons.

    Best regards

    Finn

    • Raj Naraparaju. says:

      Hi Finn,

      Thank you for the quick response. I am reposting the complete info. I need to generate an XML file from table data. I am new to XML and need some help. I was able to do it through a block using dbms_xmlgen. Now I need to add header information instead of the default {?xml version=”1.0″?. I would like to add header information and generate an XML file as below. I am working on Oracle Daabase 11g.

      Any help is greatly appreciated!

      Thank you!
      Raj Naraparaju.

      {HeaderInformation}
      {DataSource}EMPLR-Footnote{/DataSource}
      {DateCreated}10/16/2013 11:35:42 AM{/DateCreated}
      {DateLastUpdated}10/16/2013 11:35:42 AM{/DateLastUpdated}
      {FootNoteCount}5{/FootNoteCount}
      {/HeaderInformation}

      {EmployeeDetails}
      {EMPLOYEE}
      {EMPLOYEE_ID}101{/EMPLOYEE_ID}
      {FIRST_NAME}Neena{/FIRST_NAME}
      {LAST_NAME}Kochhar{/LAST_NAME}
      {EMAIL}NKOCHHAR{/EMAIL}
      {PHONE_NUMBER}515.123.4568{/PHONE_NUMBER}
      {HIRE_DATE}21-SEP-05{/HIRE_DATE}
      {JOB_ID}AD_VP{/JOB_ID}
      {SALARY}17000{/SALARY}
      {MANAGER_ID}100{/MANAGER_ID}
      {DEPARTMENT_ID}90{/DEPARTMENT_ID}
      {/EMPLOYEE}
      {/EmployeeDetails}

  4. ellebaek says:

    Hi Raj

    That’s actually not legal XML as XML requires that there’s one root element only. You would need to wrap up the XML above in eg {Employee}, such that you have:

    {Employee}
    {HeaderInformation}
    {DataSource}EMPLR-Footnote{/DataSource}
    {DateCreated}10/16/2013 11:35:42 AM{/DateCreated}
    {DateLastUpdated}10/16/2013 11:35:42 AM{/DateLastUpdated}
    {FootNoteCount}5{/FootNoteCount}
    {/HeaderInformation}
    {EmployeeDetails}
    {EMPLOYEE}
    {EMPLOYEE_ID}101{/EMPLOYEE_ID}
    {FIRST_NAME}Neena{/FIRST_NAME}
    {LAST_NAME}Kochhar{/LAST_NAME}
    {EMAIL}NKOCHHAR{/EMAIL}
    {PHONE_NUMBER}515.123.4568{/PHONE_NUMBER}
    {HIRE_DATE}21-SEP-05{/HIRE_DATE}
    {JOB_ID}AD_VP{/JOB_ID}
    {SALARY}17000{/SALARY}
    {MANAGER_ID}100{/MANAGER_ID}
    {DEPARTMENT_ID}90{/DEPARTMENT_ID}
    {/EMPLOYEE}
    {/EmployeeDetails}
    {/Employee}

    Would that work?

    Cheers

    • Raj Naraparaju says:

      Thanks Finn! I have to try and test it. What change, if any, would you suggest to my code that I posted? Since I am new to this, please guide me through it.

      Thank you!

      • ellebaek says:

        Hi Raj

        Well you’ve only shown your XML data, not the code that generates the XML so not sure what you mean. Do you mean your XML? If so, I would suggest you conform to standard XML date/time formats in order to make it possible to any XML parser to correctly interpret the timestamps in the XML.

        Please have a look at the section “XML Schema Compliance” in Converting Between Oracle Data and XML.

        Apart from that I can’t comment on the XML – I suppose you produce it in a way that it conforms to a specification that’s out of your hands anyway.

        Cheers

        Finn

  5. ellebaek says:

    Hi again

    Please have a look at my examples in the “XMLELEMENT, XMLFOREST, XMLAGG etc” section in

    Converting Between Oracle Data and XML

    I believe this is what you’re after. You can control the tag names generated by DBMS_XMLGEN through the SETROWSETTAG and SETROWTAG procedures, but you cannot specify which level you want to control so I suggest you use the XML* functions mentioned above instead.

    Hope this helps.

    Cheers

    Finn

    • Raj Naraparaju says:

      Hi Finn,

      I think I went through it once. I will go through it again. Thank you!

      Raj Naraparaju.

  6. Raj Naraparaju. says:

    I got it working. I got help from someone else though. I used a combination of xmlserialize, xmlelement,xmlforest and xmlagg to get the desired output. Thought of updating you as well.

    Thank you for all the responses!
    Raj Naraparaju.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: