Help - syntax nested XMLQuery (XQuery)

I need to query a relational table that includes an XMLType column to binary XML.  The XMLType column contains an arbitrary length XML document. My query is in part dependent on values of the relational columns and data values in XML documents.  The body of the XML document with the root element, consists of 3 main sections (items): Header1, 1/document; In - tete2, 1/document; and the details, 1/document.  The details section consists of multiple, arbitrary number, sections of details (elements). Provision of data and sample table are below.

For a particular TLID CUST or SHIP_DATE, etc... I need to return the Header1, in tete2 and several sections detail where the values of elements within the sections of specific details correspond to additional qualifications.

If I just want back the sections in detail, I can do this successfully with the following query:

Select cust, tlid, xmlquery('declare default element namespace ""http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd";") (::)

for $i in/C52R09/DETAILS/DETAIL

where $i / OrderNumber = "SBC00999."

                        return $i' PASSAGE xml_doc

HAPPY RETURN) .getClobVal (retail)

of xml_truck_info

where tlid = '424500'

and xmlexists (' declare default element namespace ""http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd";") (::)

$x/C52R09/HEADER1 [TruckNumber = "424500"]' Xml_doc of PASSAGE AS 'x');

However, I must return the sections Header1 and tete2 once per document, if the query returns all the sections in detail, regardless of the question of if the query returns 1 or more details sections.

My impression is that this will necessitate a nested XQuery.  I had no success, get the correct syntax for this.  I lost a lot of time searching the web for examples that would again my scenario.  It seems that there is a lack of detailed and clear information and examples available on the implementation of Oracle XQuery and the structure.  I found a few examples that are close to what I'm trying to do; However, when I twist them, the query spit upwards.

Based on the 2 following examples from the web or Oracle documentation:

SELECT rownum, XMLQuery)

<>counties

{for $c in ora:view("CHAMBER_OF_COMMERCE")

Let $coc_county: = $c / ROW/COC_COUNTY/text (),.

$coc_name: = $c/ROW/COC_NAME,.

$coc_phone: = $c / ROW/COC_PHONE/textb)

where $coc_county = $cc_county/county / text)

order of $coc_county

return

< population = "{xs County:unsignedInt(sum(/cities/city/population))}" >

< name > {$coc_county} < / name >

< Room phone = "{$coc_phone}" > {$coc_name / text ()} < / room >

< attractions >

{for $a in collection ("/public")

where $coc_county = $a / attraction/county/text)

return $a

}

< / attractions >

{< / county >}

< / counties >

THROUGH THE VALUE cc_city_populations,

XMLTYPE ("< count > ' |") cc_county | ("< / County >") AS "cc_county".

RETURN CONTENT)

OF county_census;

and

(SELECT XMLQuery

' for $i in $h / / channel

return

< headlines >

new articles < title > OTN on Oracle Solaris < /title >

elements <>

{

for $j in $h / / article

where ora: contains ($j, "Oracle Solaris")

return < element > {($j/title, $j/link)} < / item >

}

< / object >

< / news > '

PASSAGE xmlparse (document httpuritype ('http://feeds.delicious.com/v2/rss/OracleTechnologyNetwork/ ))

otntecharticle') .getCLOB ()) as 'h '.

HAPPY RETURN) .getStringVal () as a RESULT OF THE DOUBLE;

I modified my simple and successful query above the following:

Select tlid, XMLQuery('declare default element namespace ""http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd";") (::)

for $i in /C52R09

return

headers <>

"{$i / Header1}.

"{$i / in tete2}.

< / header >

{

for $x in $i/DETAILS/DETAILS

where $x / MarvinOrderNumber = "SBC00999".

return $x

}'

PASSAGE xml_doc

HAPPY RETURN) .getClobVal (retail)

of xml_truck_info

where TLID = '424500'

and xmlexists (' declare default element namespace ""http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd";") (::)

$x/C52R09/HEADER1 [TruckNumber = "424500"]' Xml_doc of PASSAGE AS 'x');

When it is running in SQLDeveloper the result still reflects a problem with the curly braces "{" around the second 'for' expression.  I ran this with different iterations, to remove the braces around the $i / Header1 and $i / tete2 sections.  It makes no difference.  I get similar results as follows:

Error in the command line: 16 column: 6

Error report:

SQL error: ORA-19114: XPST0003 - error during parsing of the XQuery expression:

LPX-00801: XQuery syntax error in ' {'}

9                   {

-                   ^

19114 00000 - "error during the analysis of the XQuery expression: %s.

* Cause: An error occurred during parsing of the XQuery expression.

* Action: Check the error message for possible causes.

My table, XML_TRUCK_INFO, looks like this:

Name Type

-----------------   ----------------------------

CUST VARCHAR2 (7)

LOC VARCHAR2 (5)

NUMBER OF TLID

NUMBER OF STID

SHIP_DATE DATE

SHIPPED_FLAG VARCHAR2 (1)

SYS XML_DOC. XMLTYPE BINARY STORAGE

Here is a sample of the content XML_DOC I run the XQuery query against.

<? XML version = "1.0" standalone = "yes"? >

" < C52R09 xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "

' xsi:noNamspaceSchemaLocation = ' http://abhist.acme.com:8080/Acme/schema/C52R09_v2.xsd                                           

http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd' > .

< HEADER1 >

< TruckNumber > 424500 < / TruckNumber >

< StopID > 16 < / StopID >

< ShipFrom > CITYNAME < / ShipFrom >

< ShippingDate > 10 June 2013 < / ShippingDate >

< PlannedDepartureDate > 10 June 2013 05:00 < / PlannedDepartureDate >

< ETADate > 11 June 2013 < / ETADate >

< LoadName > SW 29 < / LoadName >

< StopName > 16 - FREEPORT, < / StopName >

< StopComment / >

BILL to < TruckStatus > < / TruckStatus >

< ReportType > C < / ReportType >

< / HEADER1 >

-< tete2 >

< DestAddrName > - NAME of the CLIENT-COMPANY < / DestAddrName >

< DestAddrLine1 > 23 EAST 4TH AVENUE < / DestAddrLine1 >

< DestAddrLine2 / >

< DestCity / >

< DestState / >

< DestZip > 55555 < / DestZip >

< /-tete2 >

< DETAILS >

< DETAIL >

SBC00999 < OrderNumber > < / OrderNumber >

< LineNumber > 3 < / LineNumber >

ORDER CUSTOMER < OrderType > STANDARD < / OrderType >

< OrderStatus > SHIPPED COMPLETE < / OrderStatus >

< OrderDate > 23 May 2013 < / OrderDate >

Job1 < JobName > < / JobName >

< QtyOrdered > 3 < / QtyOrdered >

< QtyShipped > 3 < / QtyShipped >

< WeekofDelivery > 10 June 2013 < / WeekofDelivery >

< status > CE TRUCK < / status >

< Numeroclient > 5000 - 000 < / Numeroclient >

CUSTNAME1 < CustomerName > < / CustomerName >

W163409 < CustomerPONumber > < / CustomerPONumber >

< > 4.56 CubicFeet < / CubicFeet >

< ListPrice > 677 < / ListPrice >

< SpecialMQSCode >

< ProductType > AAZG < / ProductType >

< UnitType > ABEG < / UnitType >

< / SpecialMQSCode >

MOUNTING INSERT < ShortDescription > < / ShortDescription >

< OpeningCount > 5 < / OpeningCount >

< TrackingLines >

< TrackingNo > 0YD 746 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:05 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< TrackingNo > 0YD 747 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:31 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< TrackingNo > 0YD 748 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:06 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< / TrackingLines >

< / DETAILS >

< DETAIL >

SBC00999 < OrderNumber > < / OrderNumber >

< LineNumber > 4 < / LineNumber >

ORDER CUSTOMER < OrderType > STANDARD < / OrderType >

< OrderStatus > SHIPPED COMPLETE < / OrderStatus >

< OrderDate > 23 May 2013 < / OrderDate >

Job1 < JobName > < / JobName >

< QtyOrdered > 3 < / QtyOrdered >

< QtyShipped > 3 < / QtyShipped >

< WeekofDelivery > 10 June 2013 < / WeekofDelivery >

< status > CE TRUCK < / status >

< Numeroclient > 5000 - 000 < / Numeroclient >

CUSTNAME1 < CustomerName > < / CustomerName >

W163409 < CustomerPONumber > < / CustomerPONumber >

< > 4.56 CubicFeet < / CubicFeet >

< ListPrice > 677 < / ListPrice >

< SpecialMQSCode >

< ProductType > AAZG < / ProductType >

< UnitType > ABEG < / UnitType >

< / SpecialMQSCode >

MOUNTING INSERT < ShortDescription > < / ShortDescription >

< OpeningCount > 5 < / OpeningCount >

< TrackingLines >

< TrackingNo > 0YD 749 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:05 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< TrackingNo > 0YD 750 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:05 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< TrackingNo > 0YD 751 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 06:46 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< / TrackingLines >

< / DETAILS >

< DETAIL >

SBC00999 < OrderNumber > < / OrderNumber >

< LineNumber > 5 < / LineNumber >

ORDER CUSTOMER < OrderType > STANDARD < / OrderType >

< OrderStatus > SHIPPED COMPLETE < / OrderStatus >

< OrderDate > 23 May 2013 < / OrderDate >

Job1 < JobName > < / JobName >

< QtyOrdered > 2 < / QtyOrdered >

< QtyShipped > 2 < / QtyShipped >

< WeekofDelivery > 10 June 2013 < / WeekofDelivery >

< status > CE TRUCK < / status >

< Numeroclient > 5000 - 000 < / Numeroclient >

CUSTNAME1 < CustomerName > < / CustomerName >

W163409 < CustomerPONumber > < / CustomerPONumber >

< > 4.56 CubicFeet < / CubicFeet >

< ListPrice > 677 < / ListPrice >

< SpecialMQSCode >

< ProductType > AAZG < / ProductType >

< UnitType > ABEG < / UnitType >

< / SpecialMQSCode >

MOUNTING INSERT < ShortDescription > < / ShortDescription >

< OpeningCount > 5 < / OpeningCount >

< TrackingLines >

< TrackingNo > 0YD 752 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:05 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< TrackingNo > 0YD 753 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:42 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< / TrackingLines >

< / DETAILS >

< DETAIL >

SBC01011 < OrderNumber > < / OrderNumber >

< LineNumber > 1 < / LineNumber >

ORDER CUSTOMER < OrderType > STANDARD < / OrderType >

< OrderStatus > SHIPPED COMPLETE < / OrderStatus >

< OrderDate > 28 may 2013 < / OrderDate >

Job2 < JobName > < / JobName >

< QtyOrdered > 4 < / QtyOrdered >

< QtyShipped > 4 < / QtyShipped >

< WeekofDelivery > 10 June 2013 < / WeekofDelivery >

< status > CE TRUCK < / status >

< Numeroclient > 5000 - 000 < / Numeroclient >

CUSTNAME1 < CustomerName > < / CustomerName >

W163766 < CustomerPONumber > < / CustomerPONumber >

< > 4.6 CubicFeet < / CubicFeet >

< ListPrice > 823 < / ListPrice >

< SpecialMQSCode >

< ProductType > AAZG < / ProductType >

< UnitType > ABEG < / UnitType >

< / SpecialMQSCode >

MOUNTING INSERT < ShortDescription > < / ShortDescription >

< OpeningCount > 5 < / OpeningCount >

< TrackingLines >

< TrackingNo > 0YV016 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:46 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< TrackingNo > 0YV017 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:25 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< TrackingNo > 0YV018 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 06:51 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< TrackingNo > 0YV019 < / TrackingNo >

Shipped from < TrackingStatus > < / TrackingStatus >

< ScanData >

< ScanDate > 11 June 2013 07:22 < / ScanDate >

brand of < signature > < / Signature >

SCANNED < ScanStatus > < / ScanStatus >

< / ScanData >

< / TrackingLines >

< / DETAILS >

< / DETAILS >

< / C52R09 >

I would appreciate any help and/or an overview from others more experienced in what I have.

Thanks in advance,

Paul

Paul,

If I just replace the element root of your original sample with that described by a space, then the following works as expected:

SQL > select tlid

2, XMLSerialize (document

(3) XMLQuery

4 ' declare ns0 namespace = "http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd"; (::)

5. let $dtls: = /ns0:C52R09 / ns0:DETAILS / ns0:DETAIL [ns0:OrderNumber = $order_no]

6 if return ($dtls) then

7

8              {

9 {/ ns0:C52R09 / ns0:HEADER1, /ns0:C52R09 / ns0:HEADER2}

10              ,

{ $dtls }

11              }

12

13 (else)"

14 PASSING xml_doc

15, 'SBC00999' as 'order_no '.

16 RETURN CONTENT

17           )

18 as clob dash

(19) details

20 of xml_truck_info

where the 21 tlid = '424500'

22 and xmlexists)

23 ' declare default element namespace "http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd"; (::)

24/C52R09/HEADER1 [TruckNumber = $truck_no].

25 PASSING xml_doc

26, '424500' as 'truck_no '.

27        )

28;

TLID DETAIL

---------- --------------------------------------------------------------------------------

424500

http://abhist.acme.com:8080/Acme/schema/C52R09_v2.xsd">

424500

16

CITYNAME

JUNE 10, 2013

JUNE 10, 2013 05:00

JUNE 11, 2013

SW 29

16-FREEPORT,

There is another thing that has changed in the XML content, such as namespace redeclaration?

Tags: Database

Similar Questions

  • Need help - multilevel nested table - create table problem

    Hello

    My version of oracle db: 11g

    I just created a table that contains a nested multi-level table.

    Here is the code:

    create or replace type sdef_t_nt_empNames21 is table of the varchar2 (50);

    create or replace type sdef_ot_SCmarks21 as an object (number of physics, chemistry number, number of Biology);

    create or replace type sdef_t_nt_SCmarks21 is table of the sdef_ot_SCmarks21;

    create or replace type sdef_ot_allsubmarks21 as an object (eid, eng, math, sc sdef_t_nt_SCmarks21 number number);

    create or replace type sdef_t_nt_dep_m_info21 is table of the sdef_ot_allsubmarks21;

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    store table nested like NT_c_sdef_t_nt_dep_m_info21; c_sdef_t_nt_dep_m_info21  <-I know that the problem is here.

    TRACE OF THE ERROR:

    Error at startup on line: 13 in the command.

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    Nested table c_sdef_t_nt_dep_m_info21 (sdef_t_nt_SCmarks21) store as NT_c_sdef_t_nt_dep_m_info21

    Error report-

    SQL error: ORA-00904: invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    * Cause:

    * Action:

    PS: I'm just solve a problem given to me by some1, is not a practical implementation, I'm just trying to get through

    I'm sure that some1 could help me with this, I have searched a lot of this problem but could not find my answer, please help me.

    Concerning

    Rahul

    SQL > create table (nt_dep21)
    Did number 2,
    3 dname varchar2 (50).
    4 c_sdef_t_nt_empNames21 sdef_t_nt_empNames21,
    c_sdef_t_nt_dep_m_info21 5 sdef_t_nt_dep_m_info21
    6                       )
    store c_sdef_t_nt_empNames21 7 nested as NT_c_sdef_t_nt_empNames21 table
    store c_sdef_t_nt_dep_m_info21 8 table nested as NT_c_sdef_t_nt_dep_m_info21)
    9 table nested as NT_sc sc store
    10                                                                               )
    11.

    Table created.

    SQL >

    SY.

  • Help on recovery of XQuery

    I'm having a problem, understand the results of a return to a FLWOR. Basically I want the second part of the XQuery query to run on the total performance of the first part.

    I have a series of documents in a collection. Each document to the next level with the < flight-data > tag that has an ID of the aircraft as an attribute. In the document, then, there are lower level data under the < maintenance-data raw > tag that contains the ID of the error.

    An example of two of the documents in the collection:
    < data of flight of the aircraft-id = "1" >
    <-maintenance outages-id = "0001" raw-data >
    <-raw-data maintenance outages-id "0002" = >
    <-raw-data maintenance outages-id "0003" = >
    <-maintenance outages-id = "0001" raw-data >
    < / data >

    < data of flight of the aircraft-id = "2" >
    <-raw-data maintenance outages-id "0002" = >
    <-raw-data maintenance outages-id "0003" = >
    <-raw-data maintenance outages-id "0003" = >
    <-raw-data maintenance outages-id "0004" = >
    <-raw-data maintenance outages-id "0005" = >
    < / data >
    So the xquery function intended to select all the data for one or more aircraft, then on this "total" selection, a list of all separate fault codes. The xquery query is as follows:

    for $z in data/flight-collection("brickdata2")
    where $z/@aircraft-id="1 'or $z/@aircraft-id="2') return
    for $x in distinct-values ($z//maintenance-raw-data/@fault-id) return $x

    Basically I want the query to return for two aircraft flight data and then on this total return, find the fault unique IDs. However, the second part works on IDS of single failure for each plane separately. It gives the unique fault ID for the first aircraft, then fault unique ID for the second plane.

    Results with plane 1 and 2 of the plane of the query in the Where clause
    Error ID 0001
    ID error 0002
    ID error 0003
    ID error 0002
    ID error 0003
    ID error 0004
    ID error 0005
    If we then changed the first line of the XQuery to ' let $z: = collection. etc."and then the query that retrieves two aircraft works (you get 0001, 0002, 0003, 0004 0005)" but if you change the place where clause to retrieve for a plane (one), you get the same answer (i.e. fault ID for both devices). "

    Appreciate any help. Thanks in advance.

    Basically I want the query to return for two aircraft flight data and then on this total return, find the fault unique IDs. However, the second part works on IDS of single failure for each plane separately. It gives the unique fault ID for the first aircraft, then fault unique ID for the second plane.

    You can do the following, by collecting first the complete sequence of attributes for two aircraft, then by applying Values:

    distinct-values(
      for $z in collection("brickdata2")/flight-data
      where $z/@aircraft-id = "1"
         or $z/@aircraft-id = "2"
      return $z/maintenance-raw-data/@fault-id
    )
    
  • Helps the nested Table

    Hi all

    I have a task to insert data in a nested table. First, I'll explain the scenario.

    I have 2 table (of patients) and (tumors) that contain medical data on patients with cancer.
    CREATE TABLE "DSS2_MINING"."PATIENTS" 
       (     "PATIENT_ID" VARCHAR2(10 BYTE) NOT NULL ENABLE, 
         "REGISTRY_ID" NUMBER(10,0), 
         "RACE" VARCHAR2(2 BYTE), 
         "SEX" VARCHAR2(1 BYTE), 
         "BIRTHDATE_YEAR" NUMBER(4,0), 
         "NUMBER_OF_PRIMARIES" NUMBER(1,0), 
         "VITAL_STATUS_RECORD" VARCHAR2(1 BYTE), 
         "CAUSE_OF_DEATH" VARCHAR2(5 BYTE), 
         "SURVIVAL_TIME" VARCHAR2(4 BYTE), 
         "SURVIVAL_TIME_FINAL" NUMBER, 
         "SURVIVAL_VARIABLE" VARCHAR2(1 BYTE), 
          CONSTRAINT "PATIENTS_PK" PRIMARY KEY ("PATIENT_ID");
    
    
    
    CREATE TABLE "DSS2_MINING"."TUMORS" 
       (     "TUMOR_ID" NUMBER NOT NULL ENABLE, 
         "PATIENT_ID" VARCHAR2(10 BYTE),   -- FK
         "SEER_RECORD_NUMBER" NUMBER,       -- This column contain a sequance number of the records for each patients
         "MARITAL_STATUS" VARCHAR2(1 BYTE), 
         "AGE" NUMBER, 
         "DATE_OF_DIAGNOSIS" DATE, 
         "HISTOLOGY_GROUP" VARCHAR2(2 BYTE), 
         "BEHAVIOR" VARCHAR2(1 BYTE), 
         "GRADE" VARCHAR2(1 BYTE), 
         "DERIVED_AJCC_STAGE_GROUP" VARCHAR2(2 BYTE), 
         "STAGE_OF_CANCER" VARCHAR2(2 BYTE), 
         "RADIATION" VARCHAR2(1 BYTE), 
         "CS_SCHEMA" VARCHAR2(2 BYTE), 
         "FIRST_PRIMARY_IND" VARCHAR2(1 BYTE), 
         "TUMOR_SIZE" NUMBER(4,1), 
         "TUMOR_EXTENSION" VARCHAR2(2 BYTE), 
         "LYMPH_NODES" VARCHAR2(1 BYTE), 
         "NODES_POSITIVE" NUMBER, 
         "ESTROGEN" VARCHAR2(3 BYTE), 
         "PROGESTERONE" VARCHAR2(3 BYTE), 
         "SURGERY" VARCHAR2(2 BYTE), 
          CONSTRAINT "TUMORS_PK" PRIMARY KEY ("TUMOR_ID");
    The table (of patients) contain the basic information about patients. The table (tumors) contain information about the tumors. each record in the table (the patients) may have one or more records in the table (tumors) using the column (patient_id). I want to transfer data from (of patients) and (tumors) tables to a new table (cancer_patients) that contains a nested table column. so I did the following code
    create or replace type tumor_object AS
    object(
    tumor_id VARCHAR2(1),   
    marital_status VARCHAR2(1),   
    age NUMBER(3),   
    date_of_diagnosis DATE,  
    cs_schema VARCHAR2(2),   
    histology_group VARCHAR2(2),   
    behavior VARCHAR2(1),   
    grade VARCHAR2(1),   
    first_primary_ind VARCHAR2(1),   
    tumor_size NUMBER(4,   1),   
    tumor_extension VARCHAR2(2),   
    lymph_nodes VARCHAR2(1),   
    nodes_positive NUMBER(4),   
    surgery VARCHAR2(2),
    radiation VARCHAR2(1)
    );
    
    
    create or replace type tumor_table as table of tumor_object;
    
    
      CREATE TABLE "DSS2_MINING"."CANCER_PATIENTS" 
       (     "PATIENT_ID" VARCHAR2(10 BYTE) NOT NULL ENABLE, 
         "RACE" VARCHAR2(2 BYTE), 
         "SEX" VARCHAR2(1 BYTE), 
         "NUMBER_OF_PRIMARIES" NUMBER(1,0), 
         "TUMORS" "DSS2_MINING"."TUMOR_TABLE" , 
         "VITAL_STATUS_RECORD" VARCHAR2(1 BYTE), 
         "CAUSE_OF_DEATH" VARCHAR2(5 BYTE), 
         "SURVIVAL_TIME_FINAL" NUMBER, 
         "SURVIVAL_VARIABLE" VARCHAR2(1 BYTE), 
          CONSTRAINT "CANCER_PATIENTS_PK" PRIMARY KEY ("PATIENT_ID")
       NESTED TABLE "TUMORS" STORE AS "TUMORS_STOR_TABLE"
     
    So my problem on the transfer and inserts data, I tried to use the associative array to keep the rows in the table of tumors, but it didn't work. I think that the main problem is that each record in the patient table have multiple records in the table of tumors.

    I hope that if anyone can help in this case or I you know any reference on similar cases

    Thank you
    A.L

    Published by: user9003901 on November 26, 2010 02:48

    Something like:

    INSERT
      INTO CANCER_PATIENTS
      SELECT  PATIENT_ID,
              RACE,
              SEX,
              NUMBER_OF_PRIMARIES,
              (
               SELECT  CAST(
                            COLLECT(
                                    TUMOR_OBJECT(
                                                 TUMOR_ID,
                                                 MARITAL_STATUS,
                                                 AGE,
                                                 DATE_OF_DIAGNOSIS,
                                                 CS_SCHEMA,
                                                 HISTOLOGY_GROUP,
                                                 BEHAVIOR,
                                                 GRADE,
                                                 FIRST_PRIMARY_IND,
                                                 TUMOR_SIZE,
                                                 TUMOR_EXTENSION,
                                                 LYMPH_NODES,
                                                 NODES_POSITIVE,
                                                 SURGERY ,
                                                 RADIATION
                                                )
                                   )
                            AS TUMOR_TABLE
                           )
                 FROM  "TUMORS" T
                 WHERE T.PATIENT_ID = P.PATIENT_ID
              ),
              VITAL_STATUS_RECORD,
              CAUSE_OF_DEATH,
              SURVIVAL_TIME_FINAL,
              SURVIVAL_VARIABLE
        FROM  PATIENTS P
    /
    

    SY.
    P.S. This site has censorship. It replaces the word S E X with *, change it if during the test.

  • Help with nested Styles - change of leader between the stanzas.

    Hello

    I am new to the forum but a constant Indesign user and sort of self-taught. I have a list of about 5000 names, hometowns and universitys of our grantees, and the space is not enough to give a complete break between the stanzas - like this:

    Y mcnamerson

    Cedar Falls, Iowa

    School of their choice

    (Line break)

    Y O'namerson

    Boondocks, Iowa

    School of their choice

    I need to do this:

    Y mcnamerson

    Cedar Falls, Iowa

    School of their choice

    (line break)

    Y O'namerson

    Boondocks, Iowa

    School of their choice

    And I can't bear the idea of going through every space, accentuate the empty text area, ranging in character menu, changing the leader - and repeating 4999 times more.

    I think I need to use a nested style, but I can't understand it. Can someone explain to me how to do this in order to simply select and apply a paragraph style? You'll be my new hero.

    Character: Gill Sans MT concentrated

    8pt, 9pt leader fonts

    I would like to only 4 points of the leader between each stanza - I think he'll do.

    Thank you

    Jared

    Do not put the newlines between your "stanzas" (although technically, the stanzas are poetry)

    First - remove empty lines, you have inserted by doing a search for

    Edit > find change and go to the GREP TAB

    To find

    \r+

    Implement

    \r

    So instead of a newline - simply use a space after paragraph style, just to make sure that the style of paragraph for the school of choice has a space after application

    So what you have here

    Y mcnamerson

    Cedar Falls, Iowa

    School of their choice

    In the style options, you set the

    Names of people to have a Style depending on location

    Instead of having a Style next school

    School to have the next Style names (also include a space after the paragraph style setting)

    The follow-up of this

    http://InDesignSecrets.com/where-is-apply-__-then-next-style.php

  • Help to TRIM() xmlquery

    Hello

    In the syntax below:

    XMLTABLE (' for $i in xml where upper-case ($i / text ()) = "JANUARY" return $i / text () ")
    from a.xml_object)

    Is it possible to add a function trim() around the text I'm checking? for example, trim (upper-case ($i / text ()) = "JANUARY")

    See you soon,.

    Dan.

    Hello

    Normalize-space function does this:

    SQL> SELECT *
      2  FROM
      3  XMLTable(
      4   'for $i in /root/c where upper-case(normalize-space($i)) = "JANUARY" return $i'
      5   passing xmltype(
      6   '
      7    january
      8      January 
      9    FEBRUARY
     10    MARCH 
     11   '
     12   )
     13  );
    
    COLUMN_VALUE
    --------------------------------------------------------------------------------
    january
      January 
     
    
  • Question of syntax nested symbol

    I'm dynamically loading 'slides' on the stage. In the symbol which is responsible on his script, I have the following:

    var icon = sym.$("honIcon");

    Icon.Hide ();

    This works as expected. However, the following does not work:

    var icon = sym.$("honIcon");

    Icon.CSS ('cursor', 'pointer');

    Neither binder of triggers such as

    var icon = sym.$("honIcon");

    Icon.bind ("Click", showToolTip);

    function showToolTip() {}

    Alert ("received message");

    }

    Suggestions?

    I have:

    Add this

    SYM.$("slideContainer1"). CSS('z-index',1000);

    line 70

    in the slide:

    var icon = sym.$("honIcon");

    SYM.$('HON_tooltip'). Hide();

    {Icon.Click (Function ()}

    SYM.$('HON_tooltip'). Show();

    });

  • Syntax error when you use 'let '.

    HI gentlemen,

    I have a small XQuery file that works A1 if I do not use leash $p... However, the scheme is deeply nested and I tried to do for the sake of readability. Now I always get a syntax error - it will put in place with 'let' and 'element' together. Here is a test for a single line. By removing $p and re - his replacement by its content, it's OK.
    <?xml version="1.0" encoding='windows-1252'?>
    <!--<?xml-stylesheet type="text/xsl" href="icd.xsl"?>-->
    <page xmlns:xsql="urn:oracle-xsql"  connection="gksconnection">
    <xsql:include-xml xmlns:xsql="urn:oracle-xsql">
    SELECT XMLSerialize(DOCUMENT
    XMLQuery(
      'xquery version "1.0"; (: :)
       declare namespace n1="urn:ehd/001"; (: :)
       declare namespace n2="urn:ehd/icd/001"; (: :)
    
    let $p := /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel
    
       element h 
       {  
         /n1:ehd/n1:header/n1:provider/n1:organization/n1:id/@EX,
         element kap 
         {
           $p[n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:nummer,
           /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel[n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:bezeichnung,
           /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel[n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:von_icd_code,
           /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel[n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:bis_icd_code,
           element group 
           {
              /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel/n2:gruppen_liste/n2:gruppe[n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:bezeichnung,
              /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel/n2:gruppen_liste/n2:gruppe[n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:von_icd_code, 
              /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel/n2:gruppen_liste/n2:gruppe[n2:diagnosen_liste/descendant::n2:diagnose/n2:icd_code/@V="{@icd_code}"]/n2:bis_icd_code, 
              element diag
              {
                 /n1:ehd/n1:body/n2:icd_stammdaten/n2:kapitel_liste/n2:kapitel/n2:gruppen_liste/n2:gruppe/n2:diagnosen_liste/descendant::n2:diagnose[n2:icd_code/@V="{@icd_code}"]
              }
           }
         }
       }'
      PASSING xml_document
      RETURNING CONTENT
    )
    AS CLOB INDENT SIZE = 2
    ) as result
    FROM icd
    where id = {@idno} 
    </xsql:include-xml>
    </page>
    Can someone help me find the cause of the error? Unfortunately, I need some 'header' < chapter > and < group > data too, which lies over the "core" of the query: < diagnose > node. That's why I chose the technique of qualification.

    Thank you, best regards

    Miklós HERBOLY
     RESULT
     --------------------------------------------------------------------------------
     
       
         
       
                                                                                                                         
    

    OK, you get the empty elements on 11.2.0.2, so there is certainly a problem on this version.
    The fact that the NO_XML_QUERY_REWRITE indicator work means that there is a problem with the optimizer tries to use the internal binary XML structure to deal with the XQuery.

    I can't say much more than that, but since the test case is simple enough, you probably connect a SR with Oracle Support on that one.

  • Difference between sous-suite and nested sequence?

    What is the difference between the subsequence and nested in first Pro CC 2015 sequence?

    -RK

    Hi guys,.

    With the help of 'Nest' on a selection of elements in a sequence will be 1) create a new sequence in your bin, 2) place the clips selected in the sequence and 3) replace the clips selected by the instance of the nested sequence.

    With the help of 'Do the sous-séquence' on a selection of elements in a sequence 1) will create a new sequence in your tray and 2) place the clips selected in the sequence. However, unlike the 'nest', it does not replace the selected clips. It is a useful option if you want to keep a backup of part of your sequence until you review the part.

  • Error in adding an editable region in the nested template header

    I have a basic model for the website (creation of main menus) and a secondary model using this basic model, which establishes a common table, on the one hand of the site layout. After you create the PHP to drive page, I need to lock this secondary nested region - otherwise any edit I make on my secondary & quot; -definition of table & quot; model is not passed to the last pages using the secondary model. I created a secondary edit box successfully in every part of the & lt; body & gt; region, and of course, it locks text outside the secondary editable help DW says it should. So far so good.

    Now the problem - I can not create a region inside the & lt; head & gt; combo box to lock this region too. Normally we'd like keywords and so on to be variable from one page to another, but as I am filling variable keywords from a database, it makes sense to lock the & lt; head & gt; Too much. Does anyone know why that generates an error & quot; failed to create an optional region here & quot;? Is there anything we can do about it?

    > by whom?
    This is DW CS3 help on nested models:

    A nested template is a template whose design and editable regions is based on another model. Nested models are useful for the control of content in the pages of a site that share many design elements, but have some differences between pages. For example, a basic model can contain broader design areas and be usable by many contributors of content on site, while a nested model can further define the editable regions in the pages of a specific section of a site.

    > the solution
    I just figured out how to lock the header in the document of reference to TechNote 16416. It is referenced in the called DW CS3 help page

    Prevent an editable region to a nested model

    In summary - insert the marker @@("") @ in the editable area.

    I tried it and it works perfectly! The cephalic region is now locked in the nested template, so the changes in this area went from child pages. That's the answer.

    > your book
    Yes, I saw it on Amazon. Kudos to you for publication.

    > your suggestion extracted
    Thanks for that. This looks like a more manual approach, however.

    > mysteriously missing paragraphs
    Very strange, I can see them on my screen in Firefox and IE7.

    Best regards
    Richard

  • ORA-19228: XPST0008 - identifier not declared when using more then a var.

    HI gentlemen,

    Given an XMLTYPE table with only one line. Under the root element, it has a header of <>and < body > where things inside the body has a different namespace. When I try to dig with the statement in p.SQL/ below, I always get

    SQL > @c:\xsl\p
    Z
    *
    FEHLER in line 10:
    ORA-19228: XPST0008 - nicht deklarierter identifier: Prafix 'j' lokaler name "(undeclared identifier)

    I have also tried to include a WHERE clause, he always complains with $j. When I use only a single variable, $i, that's OK. DB XML Developer's Guide includes examples that are very close to that - they run A1. Can you help me where I'm wrong?

    Thank you, best regards
    Miklós HERBOLY
    SELECT 
       XMLQuery('xquery version "1.0"; (: :)
       declare namespace n1="urn:ehd/001"; (: :)
       declare namespace n2="urn:ehd/go/001"; (: :)
       for $i in /n1:ehd/n1:header
    let $j := /n1:ehd/n1:body/n2:gnr_liste/n2:gnr
       return $i,$j'
       PASSING xml_document
       RETURNING CONTENT) as ziffer
      FROM z 
    /

    Hi Miklos,

    You need parentheses to indicate that you return the sequence of $i and $j:

    xquery version "1.0"; (: :)
    declare namespace n1="urn:ehd/001"; (: :)
    declare namespace n2="urn:ehd/go/001"; (: :)
    for $i in /n1:ehd/n1:header
    let $j := /n1:ehd/n1:body/n2:gnr_liste/n2:gnr
    return ($i, $j)
    

    or a shorter version (if there is only one header per document):

    xquery version "1.0"; (: :)
    declare namespace n1="urn:ehd/001"; (: :)
    declare namespace n2="urn:ehd/go/001"; (: :)
    (
      /n1:ehd/n1:header
    , /n1:ehd/n1:body/n2:gnr_liste/n2:gnr
    )
    
  • Windows 7 administraitive functions limited by the SYSTEM. (solution)

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    C:\Windows\System32>NT user administrator / Active: Yes
    'nt' is not recognized as an internal or external command
    operable program or batch file.
    C:\Windows\System32>NT administrator \active:yes user
    'nt' is not recognized as an internal or external command
    operable program or batch file.
    C:\Windows\System32 > net user administrator / Active: Yes
    System 5 error has occurred.
    Access is denied.
    C:\Windows\System32 > net user administrator / Active: Yes
    System 5 error has occurred.
    Access is denied.
    C:\Windows\System32>copy
    The syntax of the command is incorrect.
    C:\Windows\System32 >
    TRIED TO RUN A BACKUP, BUT HAS BEEN LOCKED FROM READING AUTO...
    Directory of d:\
    2010-05-18 05:39 CAMERON-PC
    2010-05-18 05:39 MediaID.bin 528
    2010-05-18 05:39 restore.ico 101 212
    2010-05-18 05:39 130 autorun.inf
    3 file (s) on 102 082 bytes
    1 dir 56,717,312 bytes free
    C:\Windows\System32>start d:\cameron-pc
    C:\Windows\System32>start d:\autorun.inf
    Access is denied.
    C:\Windows\System32>start d:\media.bin
    The system does not find the file d:\media.bin.
    User AUTHORITY/delete C:\Windows\System32>NET
    The syntax of this command is:
    NET USER
    [username [password | *] [options]] [/ DOMAIN]
    username {password | *} / add [options] [/ domain]
    username [/ delete] [/ domain]
    username [/ TIMES: {both |}] ALL}]
    C:\Windows\System32>NET user administrator / Active: Yes SYSTEM cameron *.
    The syntax of this command is:
    NET USER
    [username [password | *] [options]] [/ DOMAIN]
    username {password | *} / add [options] [/ domain]
    username [/ delete] [/ domain]
    username [/ TIMES: {both |}] ALL}]
    Directory of C:\Windows\System32
    File not found
    C:\Windows\System32 > net user administrator / Active: Yes
    System 5 error has occurred.
    Access is denied.
    C:\Windows\System32>dir dir dir
    Volume in drive C is eMachines
    Volume serial number is F + AG-*.
    Directory of C:\Windows\System32
    Directory of C:\Windows\System32
    File not found
    C:\Windows\System32 >
    Computer C:\Windows\System32>net of the user
    The user name is not found.
    More help is available by typing NET HELPMSG 2221.
    Config computer C:\Windows\System32>net
    The syntax of this command is:
    NET COMPUTER
    \\computername {/ ADD | / del}
    The available commands are:
    NET NET ACCOUNTS NET HELPMSG
    NET COMPUTER NET LOCALGROUP NET STOP
    NET CONFIG NET PAUSE NET TIME
    NET CONTINUE NET NET SESSION USE
    NET FILE NET SHARE NET USER
    NET GROUP NET START, NET VIEW
    NET HELP
    NET HELP NAMES explains different types of names in the NET HELP syntax lines.
    SERVICES of HELP NET lists some of the services, you can start.
    NET HELP SYNTAX explains how to read NET HELP syntax lines.
    NET HELP command | MORE displays one screen of help at the same time.
    Accounts C:\Windows\System32>net
    Force user logoff how long after the expiry of the period
    ? : Never
    Minimum password age (days): 0
    Maximum password age (days): 42
    Minimum password length: 0
    Length of the history of maintained password: None
    Locking threshold: never
    Duration of the lock (min): 30
    Lockout observation window (minutes): 30
    Computer role: workstation
    The command completed successfully.
    C:\Windows\System32 > YES SUCCESS! FIRST THING I'LL DO IS? {DO A GEEZE OF DEFAULT PROFILE THAT WAS PROBABLY MUCH MORE DIFFICULT, THEN HE HAS TO BE X-}
  • Can you turn off or get rid of ligatures in muse?

    Can you turn off or get rid of ligatures in muse?

    Ligatures are a CSS / presentation of fonts. Muse of all is to use the text in characters, the rest is totally dependent on what font you use and if the actual rendering of ligatures is enabled in your browser. It is more than something TypeKit, so this may enlighten you a bit:

    Typekit help | Using OpenType features

    Typekit help | Syntax for OpenType in CSS features

    Mylenium

  • It is possible that none of your fonts can damaged or not fully functioning?

    I'm working on a website of Smokin ' Joe | Pizza - Grill hosted on Adobe BC.

    Model was purchased from BCGURUS. The original model works fine with a different font: HAYMAKER. Fine Bar & Grill

    Customer asked to use fonts: prater ff without web

    I did everything according to the instructions. Created a kit, change my main CSS files to use the font:

    {@font-face}

    do-family: 'ff-prater-without-web', without serif.

    make-style: normal! important;

    Police-weight: 400;

    do-variant: normal! important;

    letter-spacing: normal! important;

    police kerning: none;

    }

    (/ * src:url('/fonts/haymaker-webfont.eot');

    SRC:URL('/fonts/Haymaker-webfont.EOT?#iefix') format('embedded-opentype'),.

    URL('/fonts/Haymaker-webfont.svg#haymakerregular') ('svg') format.

    URL('/fonts/Haymaker-webfont.woff') format ('woff').

    URL('/fonts/Haymaker-webfont.ttf') format ('truetype');

    Police-weight: normal;

    make-style: normal;

    }*/

    This worked perfectly on my desktop, on any browser and any screen size, but did not work properly on mobile (using iPhone 5 c - completely up to date)

    Resembled a kerning problem. Spaces between letters do not match.

    I tried the upgrade to Jquery and has made some changes with some CSS classes, but nothing has worked.

    How can I solve this problem?

    It is the police itself?

    Would appreciate a feed back.

    Hi Tony,.

    I'm sorry we missed your post on the forum! You can always feel free to contact support at [email protected] Typekit if you don't get an answer in short order here.

    The font you're using, FF Prater, includes ligatures of the letters. Safari is not apply spacing of these ligatures, and so you see uneven spacing between different characters.  There are a few options of fixing of the screen:

    (1) turn off ligatures in Safari (and other webkit browsers) by adding this rule in your CSS:

    -webkit-font-feature-settings: 'liga' 0, 'flashing' 0;

    With ligatures off, there is distance equal between the characters, as expected.  (For more information on ligatures, please see Typekit help |) Syntax for OpenType features in CSS )

    (2) If you do not want to disable full ligatures, try a different value of letter-spacing in this CSS to equalize the difference in spacing:

    #main image-gallery h2 {}

    color: #fff;

    fonts: 64px/62px "haymakerregular", Times, serif;

    letter-spacing: 6px;

    margin: 0;

    }

    Here's a screenshot you're current letter-polenta (left) and with (right), the comparison value 2px spacing:

    I hope this helps; Let me know if you have any other questions.  Best,

    -liz

  • Access to the value displayed in the selection list

    Hello
    On a form, I have a select list (drop-down list).
    I can access the value selected in the help: syntax SelectListName.
    But how to get the displayed value?

    Thanks in advance,
    Alex

    If necessary in a PL/SQL environment (or I guess you can call AJAX then PL/SQL javascript) you can use these two APIs to help you perhaps?

    APEX_ITEM. TEXT_FROM_LOV
    APEX_ITEM. TEXT_FROM_LOV_QUERY

    Or should give you the value displayed for a corresponding return value (so since you can access the return value already, switch to one of these functions (as appropriate to your situation)).

Maybe you are looking for

  • Software update 10.0.2

    I downloaded and installed the software update 10.0.2 for my phone this morning and HE HATES! Why Apple does not provide a way to uninstall the update, as an option for pc Microsoft System Restore?  Either that, or allow users to get an overview of w

  • iPhone stuck in recovery mode 5 c

    Hi all I'm not native English and my grammar isn't the best, so if you do not understand something I posted, just ask and I try to be more specific. I have the problem that my iPhone 5 c is stuck in recovery mode and I have so far failed. The problem

  • I need to update my Safari browser, help!

    I have a desktop gateway PC running Windows 8.1. I need to update my version of Safari, because there are things that I can't do until I update my Safari browser. Currently I have 5.1.7. Whenever I have download what I think, it's a version update al

  • 2015 mbp has lost all power

    Plugged my iPod Classic 60 GB to try to synchronize with my iCloud library. ITunes has shown, but wouldn't a synchronization and then it wouldn't show it, so I restarted computer. IPod is connected and then the computer would not start. Not nothing b

  • Satellite A100 does not start after the wrong Bios Update

    Yesterday, I upgraded my BIOS of 1.90 to 2.20 for VISTA... now, apparently, I downloaded the BIOS bad a100 to my A100 (PAAS...) Now the computer turn on (no display) then a few seconds later stops offshore and turns on again (without interruption), I