How to generate XML from database data using a procedure?

Hello

I want to generate output as xml to database tables using a procedure. Can anyone suggest me on how to do this?

Thanks for your time.

Reel for the XML script

Tags: Database

Similar Questions

  • How the XML element used in RTF PUBLIC/PRIVATE? I know how to hide columns in RTF, but do not know how to generate xml below way. Help, please.

    Hello

    I'm following link below to show/hide my columns dynamically. See "formatting of column.

    http://docs.Oracle.com/CD/E12844_01/doc/BIP.1013/e12187.PDF

    According to the doc element can be made in private/public.

    <items type="PUBLIC">
     <item>
      <name>Plasma TV</name>
      <quantity>10</quantity>
      <price>4000</price>
     </item>
     <item>
    

    And even can be used to hide the column with the help of State

    <?if@column:/items/@type="PUBLIC"?>
    

    MY QUESTION IS HOW TO DO THIS IN MY XML BELOW?

    Here's the part of my XML code that I use in the definition of the data to RTF.

    <group name="GH3" source="QH3">
    <element name="COLUMN_HEAD3" value="COLUMN_NAME" /> 
    </group>
    <group name="GH4" source="QH4">
    <element name="COLUMN_HEAD4" value="COLUMN_NAME" /> 
    </group>
    

    I'm out like that.

    <LIST_GH3>
    <GH3>
    <COLUMN_HEAD3>REBILL_TO_OTHER_BUSINESS_UNIT</COLUMN_HEAD3>
    </GH3>
    </LIST_GH3>
    <LIST_GH4>
    <GH4>
    <COLUMN_HEAD4>XYZ</COLUMN_HEAD4>
    </GH4>
    </LIST_GH4>
    

    In order to use the logic according to the oracle document I want output like this.

    <LIST_GH3 type="PUBLIC">
    <GH3>
    <COLUMN_HEAD3>REBILL_TO_OTHER_BUSINESS_UNIT</COLUMN_HEAD3>
    </GH3>
    </LIST_GH3>
    <LIST_GH4 type="PRIVATE">
    <GH4>
    <COLUMN_HEAD4>BLANK</COLUMN_HEAD4>
    </GH4>
    </LIST_GH4>
    

    Should what changes I make in my XML to get the result of the execution as above? Help, please. Where should I make changes in the XML above? Name of the Group? Name of the element?

    I intend to use it under condition in RTF model to hide the column, but do not know how to set the column as PRIVATE/PUBLIC type in the XML output that is used to populate the data in the RTF while running.

    <?if@column:/BTSPIEXP/LIST_GH3/@type=”PUBLIC”?>COLUMN_HEAD3<?end if?>
    

    Kind regards

    Patricia K.

    Hello

    Problem has been resolved. I used the value of the item to determine whether to show it.

    Kind regards

    Patricia K.

  • generate xml with levels data

    Hello

    I have a tlable like that

    Desription level value
    1 dept
    2 name of the King
    3 salary 3000
    3 something information

    So I want to generate xml according to the levels output, the output schould be
    < Dept >-> level 1
    < name > King-> level 2
    < > 3000 salary < / salary >-> Level3
    < Info > something < / info >-> Level3
    < / name >
    < / dept >

    I tried to use the XMLELEMENT function... without success, I realize that with Oracle xml functions?

    MDK.

    Please always provide your version of the database. It is easier for us to provide an appropriate response.

    Here are some ways that work on 10.2.0.4 (and probably high too):

    (1) implement a recursive function in XQuery
    (2) using the DBMS_XMLGEN.newContextFromHierarchy function

    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as marc
    
    SQL>
    SQL> create table emp (
      2   lvl number,
      3   descr varchar2(30),
      4   val   varchar2(100)
      5  );
    
    Table created
    
    SQL> insert into emp values(1, 'dept', null);
    
    1 row inserted
    
    SQL> insert into emp values(2, 'name', 'King');
    
    1 row inserted
    
    SQL> insert into emp values(3, 'salary', '3000');
    
    1 row inserted
    
    SQL> insert into emp values(3, 'info', 'something');
    
    1 row inserted
    
    SQL> set long 500
    SQL>
    SQL> select xmlquery(
      2  'declare function local:getHierarchy($start-with as xs:integer)
      3   {
      4     for $i in ora:view("EMP")/ROW[LVL=xs:string($start-with)]
      5     return element {$i/DESCR}
      6     {
      7       $i/VAL/text(),
      8       local:getHierarchy(xs:integer($i/LVL)+1)
      9     }
     10   }; (: :)
     11   local:getHierarchy(1)'
     12   returning content
     13  ) as result
     14  from dual;
    
    RESULT
    --------------------------------------------------------------------------------
    
       King3000something
    
    
    
    SQL> select dbms_xmlgen.getXML(
      2    dbms_xmlgen.newContextFromHierarchy(
      3     'select level, xmlelement(evalname(descr), val) from emp
      4     connect by prior lvl = lvl-1 start with lvl = 1'
      5    )
      6  ) as result
      7  from dual;
    
    RESULT
    --------------------------------------------------------------------------------
    
    
      King
        3000
        something
      
    
     
    

    Published by: odie_63 on Dec 27. 2010 18:27

  • How can insert quary in database by using the collection.

    Hi friends,


    My friend advice me to insert several point with collection for the use of multiple lines. But I don't know how to use the collection. How do I create the form to insert data using the collection.
    Please send me any link or example .au insert data into database by using the collection.



    My problem is:-

    I have a bill with several point for example. Grapes (25) with amount here and now I want to add these question with quantity in my database, Badam (145), banana (49), Apple (12)
    When I finally click on submit button.

    Actully I was used as a table but I am facing a problem when using tabular, tabular, I enter first item for example. Apple and there quantity for example. 12 in the textfield and after clicking on Add line enter Buttom went to the database. but I want that entry should not go the database. But only the new line should add when I click on the button Add a line.

    I want all these point 4 should enter into the database when I click on Submit Final.


    Maury

    Published by: Ed on September 6, 2009 02:22

    Hello

    I would do something like the code:

    BEGIN
     DECLARE
      vDATE DATE;
     BEGIN
      vDATE := TO_DATE(:P1_DATE1,'DD.MM.YYYY');
      WHILE vDATE <= TO_DATE(:P1_DATE2,'DD.MM.YYYY')
      LOOP
        INSERT INTO ABC (DTE, LEAVE)
        VALUES (vDATE, :P1_C);
        vDATE := vDATE + 1;
      END LOOP;
     END;
    END;
    

    You must ensure that the datepicker points both use the ' JJ. MM YYYY ' date format.

    Andy

  • HOW TO DELETE MUSIC FROM A CD USING MY WINDOWS 7 HOME PREMIUM EDITION COMPUTER?

    HOW DO I WOULD ERASE MUSIC FROM A CD USING MY WINDOWS 7 HOME PREMIUM EDITION COMPUTER?

    George, Hi -.

    First of all. There must be a CD/RW - there is no way to clear any other type of disc. If it is a rewritable disc, you should see the option when you right-click on the optical drive with the disc. -R.

  • How to generate XML nested using PL/SQL data?

    I have an XML that looks like this file...

    <? XML version = "1.0"? >
    < TDefs >
    < ListItem >
    < TDef >
    < DisplayName > AFP < / DisplayName >
    < enabled > True < / enabled >
    < LISName > AFP < / LISName >
    < LOINC / >
    < PrintName > AFP < / PrintName >
    < CompatibilityCode > 1 < / CompatibilityCode >
    < details >
    < PatientReplicates > 1 < / PatientReplicates >
    < AutoReDilute > false < / AutoReDilute >
    < / details >
    < DilutionList >
    < TDefDilution >
    < dilution > 1 < / Dilution >
    < CalculationFactor > 1 < / CalculationFactor >
    < / TDefDilution >
    < / DilutionList >
    < TDefRange >
    < RangeList >
    < RangeInfo >
    < ID >
    < int > 6509 < / int >
    < /ID >
    < name >
    < string > check Range2 < / string >
    < / name >
    < Name_MessageID >
    < int >-1 < / int >
    < / Name_MessageID >
    < IsNull RepeatedlyReactiveData = "true" / >
    < IsNull RepeatedlyReactiveComments = "true" / >
    < CreatedByIM >
    < Boolean > true < / Boolean >
    < / CreatedByIM >
    < / RangeInfo >

    This is data that are from different tables. It is a multilevel nested nodes each other.
    How do I achieve using PL/SQL? What is the best way?

    I've only used to date dbms_xmlgen to generate data from a single table.
    Can anyone help?

    How do I achieve using PL/SQL? What is the best way?

    SQL/XML functions.

    For example: {message identifier: = 9670705}

    After a few data structures and table (DDL) samples if you need specific help on the query.

  • How to generate xml with CDATA from a query

    I have the following query
    with data_tab as ( select 'Geetha' "code" ,'Book' "category" from dual union            
    select 'Nokia' "code" ,'mobile' "category" from dual )
    select Xmltype(cursor(select * from data_tab)) from dual
    and the output is
    <?xml version="1.0"?>
    <ROWSET>
     <ROW>
      <code>Geetha</code>
      <category>Book</category>
     </ROW>
     <ROW>
      <code>Nokia</code>
      <category>mobile</category>
     </ROW>
    </ROWSET>
    but I want to insert ot XML CDATA.
    Is that I need this xml file in the following format.
    <?xml version="1.0"?>
    <ROWSET>
     <ROW>
      <code>![CDATA[Geetha]]</code>
      <category>![CDATA[Book]]</category>
     </ROW>
     <ROW>
      <code>![CDATA[Nokia]]</code>
      <category>![CDATA[mobile]]</category>
     </ROW>
    </ROWSET>
    Please help me on this. In my original query, I am selecting from a record type, and it is nested. So I can not change the query select * from data_tab

    Manjusha Muraleedas wrote:
    Is there another solution.

    Well, Yes and no...

    No, because a CDATA section is supposed to be built directly on the data source, so that the content is preserved as is, with no escaped character.
    Yes, you can transform the XML to add CDATA sections thereafter, but what would be the point? The XMLType constructor already still escaped characters that are not valid.

    Out of curiosity, why do you require CDATA instead of escape sequences?

  • How to bind xml or other data to a mobile list in Dreamweaver?

    I'm trying to understand what should be a simple thing in Dreamweaver.

    It is in the use of jquery mobile, how do I join a xml file for items in list of attributes?

    If this is not possible, someone would be able to tell me or direct me to a way to manage data in Dreamweaver for mobile applications. I'm on top, trying to understand all the technology. It seems that HTML5, xml, sqlite, json and all the possibilities. I have a simple database of items maybe 300: a picture and a description. The data will reside and be read on the mobile application client-side.

    I want to read items in a list. Then call to the top of the individual items on a new 'page' based on the selection of the user of the list item. It's so easy to Dashcode Mac. Surely, I must be missing something in Dreamweaver 5.5.

    TIA to anyone who is trying to point me in the right direction.

    Have a look here http://books.google.com.au/books?id=kJ5ZWFZtWFgC&pg=PA113&lpg=PA113&dq=spry+datasets+and+j query + mobile & source = bl & to ots = l8vMEvoRZn & to sig = rZYgQGSdsxX64jCQPnFFqJdMwFg & hl = en & to her = X & ei = xpwPT8 GRIumiiAeztrQK & to sqi = 2 & ved = 0CF4Q6AEwBw #v = onepage & to q = % 20datasets % 20and % 20jquery % 20mobile spry & f = false (apologies for the length of the URL) and here http://foundationphp.com/dwmobile/

    GRAMPS

  • How to read the Serial Arduino data using labview VISA?

    Hi =). Im a beginner work reading data series from an arduino but im facing... Lets do it step by step

    I built a voltage divider circuit which gives from output
    from 0 to 5V. The output of this circuit is sent to a 0 analog input pin
    of a Committee of Arduino Duemilanove.

    (1) Firstly, I connected the cable to connect to my laptop USB the Arduino.

    (2) I went to start-> control
    Control Panel-> system-> hardware-> Device Manager. Check the Ports (COM
    & LPT). In my laptop I can see USB Serial Port (COM4). Now I know only in
    LabVIEW that I must read the data series COM 4.

    (3) to the side of the arduino, here's the code to read changes in voltage
    entered to analog pin 0. The last line of 'delay' determines the sampling
    Rate of how we want to taste the output of the voltage divider:

    int potPin = 0;    Select the input pin for the output of the voltage divider
    int val = 0;       variable to store the value from the probe

    void setup()
    {
    Serial.begin(9600) (9600);    Opens the serial port, establishes the rate of 9600 bps data
    }

    void loop() {}
    Val = analogRead (potPin); read the value of the voltage divider
    Serial.println (Val);
    Delay (10);
    }

    I slightly modified the basis series reading writing VI... I have
    attached the block schema used with comments. Basically, I tried to read
    data series, divide by 1023 and multiply by 5 to graphic voltage
    variations of the voltage divider circuit.  But Im not getting
    the correct voltage output values. The value of the tension just keeps go
    0 and coming again, as shown in the photo.

    Could you guys please guide me on what went wrong?

    Thank you!

    -you read the data, even if there is no data on the port. If 0 bytes are read => «»

    -in the case of false, you resources VISA wired for the output of channel tunnel?

    -There is no close VISA at the end of the VI resources

    -you're not a loop this VI reading bytes

    I added an addaption of your VI that you should give a try maybe

  • How to remove duplicates from a Table using PL/SQL

    I created the following tables with data:

    * Table 1: *.



    Department of CREATE TABLE

    (DEPARTMENT_ID 4 NUMBER PRIMARY KEY,

    DEPARTMENT_NAME VARCHAR2 (20).

    ADDRESS VARCHAR2 (20));







    INSERT INTO Department VALUES (10, 'ACCOUNTING', 'NEW YORK');

    INSERT INTO Department VALUES (20, "SEARCH", "DALLAS");

    INSERT INTO Department VALUES (30, 'SALES', 'CHICAGO');

    INSERT INTO Department VALUES (40, 'OPERATIONS', 'BOSTON');

    COMMIT;



    * 2nd table: *.

    CREATE TABLE employee

    (EMPLOYEE_ID NUMBER 4 PRIMARY KEY,

    EMPLOYEE_NAME VARCHAR2 (20).

    USE VARCHAR2 (20).

    MANAGER_ID NUMBER 4,

    HIRE_DATE DATE,

    NUMBER OF SALARY (9, 2)

    COMMISSION (9, 2) NUMBER,

    Department_id number 4 REFERENCES department (DEPARTMENT_ID));






    INSERT INTO employee

    VALUES (7839, 'KING', 'PRESIDENT', NULL, NOVEMBER 17, 81 ', 5000, NULL, 10);

    INSERT INTO employee

    VALUES (7698, "BLAKE", "MANAGER", 7839, MAY 1, 81 ', 2850, NULL, 30);

    INSERT INTO employee

    VALUES (7782, "CLARK", "MANAGER", 7839, JUNE 9, 81 ', 2450, NULL, 10);

    INSERT INTO employee

    VALUES (7566, "JONES", "MANAGER", 7839, APRIL 2, 81 ', 2975, NULL, 20);

    INSERT INTO employee

    VALUES (7654, 'MARTIN', 'SELLER', 7698, 28-SEP-81', 1250, 1400, 30);

    INSERT INTO employee

    VALUES (7499, 'ALLEN', 'SELLER', 7698, FEBRUARY 20, 81 ', 1600, 300, 30);

    INSERT INTO employee

    VALUES (7844, 'TURNER', 'SELLER', 7698, ' 08-SEP-81', 1500, NULL, 30);

    INSERT INTO employee

    VALUES (7900, 'JAMES', 'CLERKS', 7698, 3 DECEMBER 81', 950, NULL, 30);

    INSERT INTO employee

    VALUES (7521, 'WARD', 'SELLER', 7698, FEBRUARY 22, 81 ', 1 250, 500, 30);

    INSERT INTO employee

    VALUES (7902, "FORD", "ANALYST", 7566, DECEMBER 3, 81 ', 3000, NULL, 20);

    INSERT INTO employee

    VALUES (7369, 'SMITH', 'CLERKS', 7902, DECEMBER 17, 81 ', 800, NULL, 20);

    INSERT INTO employee

    VALUES (7788, 'SCOTT', 'ANALYST', 7566, DECEMBER 9, 82 ', 3000, NULL, 20);

    INSERT INTO employee

    VALUES (7876, ' ADAMS, "CLERK", 7788, 12 JANUARY, 83', 1100, NULL, 20);

    INSERT INTO employee

    VALUES (7934, 'MILLER', 'CLERKS', 7782, JANUARY 22, 82 ', 1300, NULL, 10);

    COMMIT;



    I need to print all Department names, employee and salary. I did this, but how can display the name of each Department only once?





    Here is my code:



    DECLARE

    v_department_name department.department_name%TYPE;

    v_employee_name employee.employee_name%TYPE;

    v_salary employee.salary%TYPE;

    CURSOR dept_cur

    IS

    SELECT employee_name, department_name, Department OF employee salary

    WHERE department.department_id = employee.department_id (+)

    ORDER BY department_name, employee_name;

    BEGIN

    OPEN dept_cur.

    EXTRACT the dept_cur IN v_department_name, v_employee_name, v_salary;

    DBMS_OUTPUT. PUT_LINE ('DEPARTMENT_NAME EMPLOYEE_NAME WAGES');

    DBMS_OUTPUT. PUT_LINE('---------------------------------------------------');

    While dept_cur % FOUND

    LOOP

    DBMS_OUTPUT. Put_line (RPAD (v_department_name, 10) |) ' ' || RPAD (v_employee_name, 10). ' ' || v_salary);

    EXTRACT the dept_cur IN v_department_name, v_employee_name, v_salary;

    END LOOP;

    CLOSE Dept_cur;

    END;

    I would appreciate if you could help me with this. I'm sure it's a quick and easy answer, but I can't do it. I spent so much time already.

    Published by: 831522 on January 26, 2011 11:44

    It is a problem of display/reports rather than a problem of duplication of query data. The answer depends on what tools you use to query and display the data. You can use the clause "break it" I suggested earlier if you use SQL Plus.

    Otherwise, you can try this based on the version of Oracle you are using. Someone else may be able to get the data in a single pass.

    SELECT decode(emp_id, 1, department_name) department_name, employee_name, salary
    FROM(SELECT department_name, employee_name, salary,
           ROW_NUMBER() OVER (PARTITION BY department_name order by department_name, employee_name) AS emp_id
         FROM department
         LEFT OUTER JOIN employee ON (department.department_id = employee.department_id)
    ORDER BY department_name, employee_name, emp_id);
    
  • How to generate a dba database

    Hello.
    I had used software to generate a sql script for database on win xp.
    There where a GUI to design tables and relationships.
    Someone at - it known what kind of software for linux?
    And how dba pro designed and build the database?
    THX

    Published by: user566430 on February 15, 2009 10:49

    Published by: user566430 on February 15, 2009 10:49

    According to the instructions for Oracle SQL Developer, you must download and install the JDK 1.5 (or 1.6). See downloads for more information.

    My installation on Windows includes a java runtime in... \oracle\sqldeveloper\jre1.6.0_06\jre\.

  • How to generate a matrix of data in column 3

    I am eager to generate a matrix using data attached so that x is row 1 and column 1. I tried to divide the table and using the generation of table however it did not work. I checked the forums but no luck. any idea would be appreciated

    "Board Index" resized to three exits. If you have a 2d array, leaving the low index unwired gives you a row and leaving the disconnected upper index gives you a column. The two indices of wiring gives you an element. See the online help.

    My photo above is a snippet of code. Drag it to the diagram (LabVIEW 2012) and it will be transformed into executable code.

  • How to decrypt files from Windows vista using windows 7?

    I encrypt files in windows vista. as I now currently using windows 7, but I cannot decrypt the files. Other ways I can decipher? Your help is appreciated!

    Hello vinceteng,

    Welcome to the community Microsoft and thanks for posting the question.

    According to the description, it seems that you are having problems with decrypt files.

    1. How do encrypt you files in Windows Vista?

    2. do you get an error message when you try to decrypt the files?

    Perform the steps from the link to decrypt files and check.

    http://Windows.Microsoft.com/en-in/Windows7/encrypt-or-decrypt-a-folder-or-file

    Answer to us if you are having problems with the decryption of the files or any other issue of Windows, and I'd be happy to help you.

    Good day!

    Hope this information helps.

  • How to access the remote database by using express application server

    I wan to access the database in one of my servers of laboratory since my laptop remotely. I could easily connect to the server when I use the LAN by simply giving the ip address. But it does not work when remote. I installed PuTTy to connect to the server (that I have), but now I want to access the specific request of this database in the lab server. Is it possible to do?

    Any help would be appreciated.

    Thank you

    Hi 3030553,

    3030553 wrote:

    Please change your login username of "3030553" to something meaningful. Reference: Video tutorial how to change username available

    I wan to access the database in one of my servers of laboratory since my laptop remotely. I could easily connect to the server when I use the LAN by simply giving the ip address. But it does not work when remote. I installed PuTTy to connect to the server (that I have), but now I want to access the specific request of this database in the lab server. Is it possible to do?

    Your laptop must be in the lab server LAN network to access, or else you should have the VPN connection to the LAN in which the lab server exists.

    Also to access objects of database in your schema to Application Express workspace, you can use the workshop of SQL as mentioned by Tommy or you can use Oracle SQL Developer, since you have the credentials for the schema to connect to and related IE required database server information full domain name / ip address of the server port on which the listener database service is running, database SID/database service name listening.

    Kind regards

    Kiran

  • How can I start the database without using crsctl? ~ Xev

    Hey guys, it's Xev.

    I'm trying to recover cancellation based, and when I try to put the database to mount with sqlplus, it won't let me.

    How to use srvctl to put the database in a mode of editing?

    I stopped the entire stack of crs on both nodes, but I'm not clear on how to assemble the database now to the CCR?

    Thank you

    Xev.

    Xev Bellringer wrote:

    Ho Toby, when I try this command, srvctl start db d db_unique_name o mount

    It gives me the following two errors:

    PRCD-1027 unable to recover the RAC database

    RPRC-1070 has been unable to verify

    I have the GRID_HOME of source and I use root of course srvctl start because it is in srvctl.

    I have crs stack while I do this? If yes how do I start the CRS battery without the database?

    Hi Xev

    On this step, I'm assuming that you have defined cluster_database = false and have stop the CRS.

    Remember: -.

    1 take a full backup still running (assume that you already have).

    2. make cluster_database = false, before starting the recovery.

    3 went parallelmediarestore the RMAN parameter, because it can slow down the recovery process.

    4 restore the db.

    5. you start db.

    6. set cluster_database = true.

    7. stop your db in normal mode, immediate.

    8. start your database by srvctl

    Good luck...

    Concerning

    Jihane Narain Sylca

Maybe you are looking for

  • Equium A60 - Touchpad Code 10.

    Hi there, hope someone can help you.The touchpad on my laptop has suddenly stopped working.After checking the properties, he said there is a "Code 10" problemSo far I have rolled back drivers, drivers updated & also uninstalled then reinstalled the t

  • free hp media smart webcam download

    Where & how to download hp media smart webcam free without stress?

  • How to use references from web third party service with service Cloud Computing to Oracle database schema

    APEX 5.0Cloud Computing service for the Oracle database schemaI'm in the middle of do a proof of concept.  Basically, I need an application with security of the stored data, UI, user, data loading, and able to post data via an external web service sa

  • No Audio of SOUL [AE project/Mac]

    Export my project in After effects by SOUL translates into a video without the sound. Audio is checked. Tried multiple configurations, third-party stock H.264 presets and nothing seems to work. I put multiplexing None to isolate the audio file that c

  • How to synchronize Lightroom mobile office?

    I have Lightbox/Photoshop Creative Cloud installed on my desktop...  I have Lightbox installed on my Samsung android tablet...  What can I sinc my client application with my Tablet?  If I can, would youPlease send me instructions ~ I'm not the bright