Home » SQL & PL/SQL » SQL & PL/SQL » xml question (oracle 11g)
xml question [message #664524] Thu, 20 July 2017 15:45 Go to next message
deb171100
Messages: 7
Registered: October 2015
Junior Member
NAME
--------------------------------
DOCTYPE ---TAG
-------------------------------
DOC TYPE CODE
DOC TYPE VERSION
-------------------------------
DOC VERSION TEXT LINES --TAG
---------------------------------
DOC TYPE TEXT LINE NUMBER
DOC TYPE VERSION
----------------------------------
DOCUMENTENTRY --TAG
---------------------------
DOC ENTRY TEXT NUMBER
-------------------------------

other attributes above are repeated values for a given document type code.
How I can create the xml?


Input tables for the sql:

TABLE: DOC_TYPE_VER_TEXT_LINES


DOC TYPE CD, DOC TYPE VERSION, DOC TYPE TEXT LINE NUMBER -> PRIMARY KEY

DOCCX1,1,1
DOCCX1,1,2
....
DOCCX1,2,1


REFERENCE TABLE: DOC_TYPE_VERSION



TABLE: DOC_TYPE_VERSION_ENTRY_TEXT:


DOC TYPE CD, DOC TYPE TEXT VERSION NUMBER, DOC_ENTRY_TEXT_NUMBER -> PRIMARY KEY

DOCCX1,1,12
DOCCX1,1,21
....
DOCCX1,2,11
Re: xml question [message #664526 is a reply to message #664524] Thu, 20 July 2017 17:09 Go to previous messageGo to next message
BlackSwan
Messages: 25748
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read
Re: xml question [message #664532 is a reply to message #664526] Fri, 21 July 2017 00:06 Go to previous messageGo to next message
deb171100
Messages: 7
Registered: October 2015
Junior Member
{code}
--------------------------------
DOCTYPE < ---this is XML TAG
-------------------------------
DOC TYPE CODE
DOC TYPE VERSION
-------------------------------
DOC VERSION TEXT LINES <--This is XML TAG
---------------------------------
DOC TYPE TEXT LINE NUMBER
DOC TYPE VERSION
----------------------------------
DOCUMENTENTRY <--This is XML TAG
---------------------------
DOC ENTRY TEXT NUMBER
-------------------------------
{/code}




other attributes above are repeated values for a given document type code derived from below table.
How I can create the xml?

{code}
Input tables:


TABLE: DOC_TYPE_VERSION
PRIMARY KEY:
DOC TYPE CD, DOC TYPE VERSION


Sample data with the above Primary key:
DOCCX1,1
DOCCX1,2

REFERENCE TABLE : DOC_TYPE


TABLE: DOC_TYPE_VER_TEXT_LINES

PRIMARY KEY:
DOC TYPE CD, DOC TYPE VERSION, DOC TYPE TEXT LINE NUMBER

Sample data with the above Primary key:
DOCCX1,1,1
DOCCX1,1,2
....
DOCCX1,2,1


REFERENCE TABLE: DOC_TYPE_VERSION



TABLE: DOC_TYPE_VERSION_ENTRY_TEXT

PRIMARY KEY:
DOC TYPE CD, DOC TYPE TEXT VERSION NUMBER, DOC_ENTRY_TEXT_NUMBER

Sanple data with the above Primary key:

DOCCX1,1,12
DOCCX1,1,21
....
DOCCX1,2,11


{/code}

[Updated on: Fri, 21 July 2017 00:08]

Report message to a moderator

Re: xml question [message #664534 is a reply to message #664524] Fri, 21 July 2017 01:17 Go to previous messageGo to next message
Michel Cadot
Messages: 65254
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Use the "Preview Message" or "Preview Quick Reply" button to verify.
Align the columns in result.
Also always post your Oracle version, with 4 decimals, as solution depends on it.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Re: xml question [message #664542 is a reply to message #664534] Fri, 21 July 2017 06:34 Go to previous message
Bill B
Messages: 1701
Registered: December 2004
Senior Member
if you are trying to dump the contents of a query into xml see

select dbms_xmlgen.getxml('select * from <tablename>') xml from dual;
Previous Topic: select from two tables
Next Topic: How do we implement NVL() in XSLT?
Goto Forum:
  


Current Time: Fri Dec 15 00:38:54 CST 2017

Total time taken to generate the page: 0.04973 seconds