Hi I have a problem of xml with xsd validation and insert into the table...

I use this function to validate the XML with xsd, but it gives-31000 error related to xdb

and I also try to recover data from the xml file, but it is fetching nullability of him.

while I was trying to recover data after removing the tablenamespace, url and other additional field or can tell

from a simple xml file than it is to get him.

Please help me with this!

FUNCTION to CREATE or REPLACE ALI$ XML_VALID (P_xml IN xmltype
P_xsd IN xmltype)
RETURN NUMBER
is


l_status NUMBER;
l_xml xmltype.
l_xsd XMLTYPE.
l_v_schemaURL VARCHAR2 (256): = "NewBusinessApplication.xsd";
schema_doesnt_exist exception;
pragma exception_init (schema_doesnt_exist,-31000);

BEGIN
l_xsd: = p_xsd;
Start
DBMS_XMLSCHEMA.deleteSchema (l_v_schemaURL, dbms_xmlSchema.DELETE_CASCADE_FORCE);
exception
When schema_doesnt_exist then
null;
end;

DBMS_XMLSCHEMA. REGISTERSCHEMA)

schemaurl = > l_v_schemaURL

, schemadoc = > l_xsd

local = > TRUE

, genTypes = > FALSE

, genbean = > FALSE

, genTables = > FALSE

);
l_xml: = p_xml;

If l_xml.isSchemaValid () = 1 then

dbms_output.put_line ("' scheme is valid");
l_status: = 1;
RETURN l_status;
on the other
l_xml.schemaValidate ();
l_status: = 0;
RETURN l_status;
end if;
END;

-call to above function

DECLARE

l_xml xmltype: = xmltype (' <? xml version = "1.0" encoding = "UTF - 8"? >)

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

"" xsi: schemaLocation = "http://www.example.org NewBusinessApplication.xsd.

xmlns ="http://www.example.org" > ".

< TransactionHeader >

< TR_REF_NO > 000009812681 < / TR_REF_NO >

< EFF_DT > 20140703094140.572 [-4:US / Eastern] < / EFF_DT >

< SRC_SYS_CD dmnSRC_SYSTEM = "TSS" > Support of TV system < / SRC_SYS_CD >

< / TransactionHeader >

< ApplicationRq >

< ApplInfo >

< APPLNO > A00018L < / APPLNO >

< MED_NONMED dmnMED_NONMED = "M" > medical < / MED_NONMED >

< APPL_DT > 20140714 < / APPL_DT >

< EFF_DT > 20140714 < / EFF_DT >

< APPL_RECV_DT > 20140714 < / APPL_RECV_DT >

< / ApplInfo >

< AgentInfo >

<! – repeat the nodes below for more than one agent - >

<>Agent

< AGT_CD > AGN0000001 < / AGT_CD >

James < FIRSTNAME > < / NAME >

< NAME > Whorphin < / LASTNAME >

BKK1010090009 < AGT-LICNO > < / AGT-LICNO >

the Warriors < TEAM > < / TEAM >

Suriya Thapa < TEAMLEADER > < / TEAMLEADER >

BKK909988999 < TEAMLEADER-LICNO > < / TEAMLEADER LICNO >

< / agent >

< / AgentInfo >

< InsuredInfo >

< dmnPERS_NAMEPREFIX PREFIX-TH = "XX" > Dr. < / PREFIX-TH >

XXXXXXX < FIRSTNAME-TH > < / FIRSTNAME-TH >

XXXXXX < MIDNAME-TH > < / MIDNAME-TH >

XXXXXX < LASTNAME-TH > < / LASTNAME-TH >

XXXXXX < FORMERNAME > < / FORMERNAME >

< PREFIX-dmnPERS_NAMEPREFIX-EN = "XX" > Dr. < / PREFIX-EN >

YYYYYY < FIRSTNAME-EN > < / FIRSTNAME-EN >

YYYYYY < MIDNAME-EN > < / MIDNAME-FR >

YYYYYY < LASTNAME-EN > < / LASTNAME-EN >

< BIRTH_DT > 19800101 < / BIRTH_DT >

< 33 YEARS > < / AGE >

< dmnPERNSEXCD = "XX" SEX > male < / TYPE >

< DmnPERC_MAR_STAT_CD MARITAL_STATUS = "XX" > single < / MARITAL_STATUS >

< dmnRACE = "XX" RACE > ZZZ < / RACE >

< dmnRELIGION RELIGION = "H" > HINDU < / RELIGION >

< dmnNATIONALITY NATIONALITY = an' TH' > THAI < / NATIONALITY >

< dmnIDTYPE ID-TYPE = "TI" > Thai National ID < / ID-TYPE >

> ID < AJMPK0001J < / ID >

< ID-XPIR_DT > 20200101 < / ID-XPIR_DT >

< dmnOCCUP_CD OCCUPATION = "XX" / >

< OCCUP_CLASS dmnOCCUP_CLASS_CD = 'XX' / >

< ANNUAL_INCOME > 100000 < / ANNUAL_INCOME >

< HEIGHT > 175 < / HEIGHT >

< WEIGHT > 80 < / WEIGHT >

< / InsuredInfo >

< ProposerInfo >

< dmnPERS_NAMEPREFIX PREFIX-TH = "XX" > Dr. < / PREFIX-TH >

XXXXXXX < FIRSTNAME-TH > < / FIRSTNAME-TH >

XXXXXX < MIDNAME-TH > < / MIDNAME-TH >

XXXXXX < LASTNAME-TH > < / LASTNAME-TH >

XXXXXX < FORMERNAME > < / FORMERNAME >

< PREFIX-dmnPERS_NAMEPREFIX-EN = "XX" > Dr. < / PREFIX-EN >

YYYYYY < FIRSTNAME-EN > < / FIRSTNAME-EN >

YYYYYY < MIDNAME-EN > < / MIDNAME-FR >

YYYYYY < LASTNAME-EN > < / LASTNAME-EN >

< BIRTH_DT > 19800101 < / BIRTH_DT >

< 33 YEARS > < / AGE >

< dmnPERNSEXCD = "XX" SEX > male < / TYPE >

< DmnPERC_MAR_STAT_CD MARITAL_STATUS = "XX" > single < / MARITAL_STATUS >

< dmnRACE = "XX" RACE > ZZZ < / RACE >

< dmnRELIGION RELIGION = "H" > HINDU < / RELIGION >

< dmnNATIONALITY NATIONALITY = an' TH' > THAI < / NATIONALITY >

< dmnIDTYPE ID_TYPE = "TI" > Thai National ID < / ID_TYPE >

AJMPK0001J < ID_NUMBER > < / ID_NUMBER >

< ID_XPIR_DT > 20200101 < / ID_XPIR_DT >

< dmnOCCUP_CD OCCUPATION = "XX" / >

< OCCUP_CLASS dmnOCCUP_CLASS_CD = 'XX' / >

< ANNUAL_INCOME > 100000 < / ANNUAL_INCOME >

< / ProposerInfo >

< ContactInfo >

< AddressInfo >

<! – repeat the nodes below for each address type - >

< address >

< dmnADDR_ADDRTYPE ADDRTYPE = "01" > home < / ADDRTYPE >

< PRIMARY_CONTACT > 0 < / PRIMARY_CONTACT >

< / address >

< address >

< dmnADDR_ADDRTYPE ADDRTYPE "02" = > Office < / ADDRTYPE >

< PRIMARY_CONTACT > 1 < / PRIMARY_CONTACT >

< / address >

< / AddressInfo >

< PhoneInfo >

<! – repeat the nodes below for each type of phone - >

< Phone >

< dmnADRP_PHONETYPE PHONETYPE "01" = > Mobile < / PHONETYPE >

< PHONENUM > 9887666789 < / PHONENUM >

< PRIMARY_CONTACT > 1 < / PRIMARY_CONTACT >

< / Phone >

< Phone >

< dmnADRP_PHONETYPE PHONETYPE "02" = > home < / PHONETYPE >

< PHONENUM > 9887666789 < / PHONENUM >

< PRIMARY_CONTACT > 0 < / PRIMARY_CONTACT >

< / Phone >

< / PhoneInfo >

< EmailInfo >

<! – repeat the nodes below for each type of email - >

< email >

< EMAILTYPE dmnADRO_EMAILTYPE = "01" > e-mail1 < / EMAILTYPE >

< EMAILDATA > [email protected] < / EMAILDATA >

< PRIMARY_CONTACT > 0 < / PRIMARY_CONTACT >

< / email >

< email >

< EMAILTYPE dmnADRO_EMAILTYPE "02" = > Email2 < / EMAILTYPE >

< EMAILDATA > [email protected] < / EMAILDATA >

< PRIMARY_CONTACT > 1 < / PRIMARY_CONTACT >

< / email >

< / EmailInfo >

< / ContactInfo >

< PolicyInfo >

STG102 < BASE-PLAN_CD > < / BASE-PLAN_CD >

< BASE-PLAN_NM > Smart term 10 gold < / BASE-PLAN_NM >

< MODEOFPAYMENT dmnZZFREQUENCY = "M" > monthly < / MODEOFPAYMENT >

< BASE - ITS > 100000.00 < / BASE - SA >

< BASE-PREMIUM > 12000.00 < / BASE-PREMIUM >

< BASE-MODALPREMIUM > 1000.00 < / BASE-MODALPREMIUM >

< AYFP > 13200.00 < / AYFP >

< RiderInfo >

< rider >

RIDER < CODE > ME < / RIDER-CODE >

Medical costs < RIDER-NAME > < / RIDER-NAME >

< RIDER - HIS 20000.00 > < / RIDER - SA >

< RIDER-PREMIUM > 600.00 < / RIDER-PREMIUM >

< RIDER-MODALPREMIUM > 50.00 < / RIDER-MODALPREMIUM >

< / rider >

< rider >

RIDER HAB < CODE > < / RIDER-CODE >

< NAME-RIDER > Admission hospitalization < / RIDER-NAME >

< RIDER - HIS 20000.00 > < / RIDER - SA >

< RIDER-PREMIUM > 600.00 < / RIDER-PREMIUM >

< RIDER-MODALPREMIUM > 50.00 < / RIDER-MODALPREMIUM >

< / rider >

< / RiderInfo >

< / PolicyInfo >

< PaymentInfo >

< borde >

< TMP_RECEIPT_NO > TEMP0001 < / TMP_RECEIPT_NO >

< TOTAL_PYMT_AMT > 13200.00 < / TOTAL_PYMT_AMT >

<! – repeat the nodes below for payment through several channels - >

< payment >

< dmnPAYRTYPE PAYER "01" = > secured < / PAYER >

credit card < dmnPaymentType PYMT TYPE = "01" > < / PYMT-TYPE >

< PYMT-AMT > 13200.00 < / PYMT-AMT >

< PYMT-Channel >

credit <>card

Visa < dmnCardType CARD-TYPE = "01" > < / CARD-TYPE >

< BADGE - N ° > 9890989098909877 < / CARD-NOT >

< HOLDERNAME-CARD > RICKY WHORPHIN < / CARD-HOLDERNAME >

< BANKNM-CARD > Standard Chartered Bank < / MAP-BANKNM >

< MAP SHOWED > 08/14 < / CARD-SHOW >

< MAP-AUTHCODE / >

< CARD-AUTHDATE / >

< / credit card >

< / PYMT-Channel >

< / payment >

< payment >

< dmnPAYRTYPE PAYER "01" = > secured < / PAYER >

< dmnPaymentType PYMT-TYPE = '02' > account < / PYMT-TYPE >

< PYMT-AMT > 13200.00 < / PYMT-AMT >

< PYMT-Channel >

< Bank >

< BANK CODE / >

< BANK BRANCH / >

< BANK-ACCNO / >

< BANK-ACCNAME / >

< / Bank >

< / PYMT-Channel >

< / payment >

< payment >

< dmnPAYRTYPE PAYER "01" = > secured < / PAYER >

< dmnPaymentType PYMT TYPE = "03" > check < / PYMT-TYPE >

< PYMT-AMT > 13200.00 < / PYMT-AMT >

< PYMT-Channel >

< check >

< CHQ - n / >

< CHQ-DATE / >

< CHQ-ISSUEBANK / >

< / cheque >

< / PYMT-Channel >

< / payment >

< / shell >

< RenewalPayment >

< dmnPAYRTYPE PAYER "01" = > secured < / PAYER >

< DDCHANNEL dmnPaymentType "01" = > SDC < / DDCHANNEL >

< DDCDetails >

Visa < dmnCardType CARD-TYPE = "01" > < / CARD-TYPE >

< BADGE - N ° > 9890989098909877 < / CARD-NOT >

< HOLDERNAME-CARD > RICKY WHORPHIN < / CARD-HOLDERNAME >

< BANKNM-CARD > Standard Chartered Bank < / MAP-BANKNM >

< MAP SHOWED > 08/14 < / CARD-SHOW >

< / DDCDetails >

< DDADetails >

< dmnBNK_TYP_CD BANK-ACCTYPE = "01" > save < / BANK-ACCTYPE >

< BANK-ACCNO / >

< BANK-ACCNAME / >

< BANK BRANCH / >

< / DDADetails >

< / RenewalPayment >

< / PaymentInfo >

< BeneficiaryInfo >

<!--repeat the nodes below for each beneficiary and the sum of the pct should be 100-->

< recipient >

Joint < dmnBENE_RELT_CD RELATIONSHIP = "01" > < / RELATIONSHIP >

XXXX < FIRSTNAME > < / NAME >

XXXXX < MIDNAME > < / MIDNAME >

XXXX < NAME > < / LASTNAME >

< PERCENT > 50 < / PERCENTAGE >

< BIRTH_DT > 19800101 < / BIRTH_DT >

< dmnPERNSEXCD SEX = "XX" > female < / TYPE >

< NATLIDNO > TH000001 < / NATLIDNO >

< / recipients >

< recipient >

< dmnBENE_RELT_CD RELATIONSHIP "02" = > child < / RELATIONSHIP >

XXXX < FIRSTNAME > < / NAME >

XXXXX < MIDNAME > < / MIDNAME >

XXXX < NAME > < / LASTNAME >

< PERCENT > 50 < / PERCENTAGE >

< BIRTH_DT > 19800101 < / BIRTH_DT >

< dmnPERNSEXCD = "XX" SEX > male < / TYPE >

< NATLIDNO > TH000002 < / NATLIDNO >

< / recipients >

< / BeneficiaryInfo >

< survey >

< HealthDeclaration >

< question >

Q001 < QUESTION_ID > < / QUESTION_ID >

< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >

< / question >

< question >

Q002 < QUESTION_ID > < / QUESTION_ID >

< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >

< / question >

< question >

Q003 < QUESTION_ID > < / QUESTION_ID >

< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >

< / question >

< question >

Q004 < QUESTION_ID > < / QUESTION_ID >

< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >

< / question >

< question >

Q005 < QUESTION_ID > < / QUESTION_ID >

< dmnZZYESNO_NUM RESPONSE = "N" > n < / ANSWER >

< / question >

< / HealthDeclaration >

< / questionnaire >

< / ApplicationRq >

< ApplicationRs >

<-reason for the rejection / >

< / ApplicationRs >

< / NewBusinessApplication >

');

l_xsd xmltype: = xmltype (' <? xml version = "1.0" encoding = "windows-1252"? >)

"< xsd: Schema container ="http://www.w3.org/2001/XMLSchema"xmlns ="http://www.example.org"

targetNamespace ="http://www.example.org" elementFormDefault = "qualified" > "

< xsd: element name = "NewBusinessApplication" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "TransactionHeader" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "TR_REF_NO" type = "xsd: Integer" / >

< xsd: element name = "EFF_DT" type = "xsd: String" / >

< xsd: element name = "SRC_SYS_CD" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnSRC_SYSTEM" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ApplicationRq" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "ApplInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "APPLNO" type = "xsd: String" / >

< xsd: element name = "MED_NONMED" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnMED_NONMED" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "APPL_DT" type = "xsd: Integer" / >

< xsd: element name = "EFF_DT" type = "xsd: Integer" / >

< xsd: element name = "APPL_RECV_DT" type = "xsd: Integer" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "AgentInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "The Agent" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "AGT_CD" type = "xsd: String" / >

< xsd: element name = "FIRSTNAME" type = "xsd: String" / >

< xsd: element name = "NAME" type = "xsd: String" / >

< xsd: element name = "AGT-LICNO" type = "xsd: String" / >

< xsd: element name = "TEAM" type = "xsd: String" / >

< xsd: element name = "TEAMLEADER" type = "xsd: String" / >

< xsd: element name = "TEAMLEADER-LICNO" type = "xsd: String" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "InsuredInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = 'PREFIX-TH' >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPERS_NAMEPREFIX" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "NAME-TH" type = "xsd: String" / >

< xsd: element name = "MIDNAME-TH" type = "xsd: String" / >

< xsd: element name = "LASTNAME-TH" type = "xsd: String" / >

< xsd: element name = "FORMERNAME" type = "xsd: String" / >

< xsd: element name = "PREFIX-FR" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPERS_NAMEPREFIX-EN" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "NAME-IN" type = "xsd: String" / >

< xsd: element name = "MIDNAME-EN" type = "xsd: String" / >

< xsd: element name = "LASTNAME-IN" type = "xsd: String" / >

< xsd: element name = "BIRTH_DT" type = "xsd: Integer" / >

< xsd: element name = "ÂGE" type = "xsd: Integer" / >

< xsd: element name = "GENDER" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPERNSEXCD" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "MARITAL_STATUS" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPERC_MAR_STAT_CD" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "RACE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnRACE" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "RELIGION" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnRELIGION" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "NATIONALITY" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnNATIONALITY" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ID-TYPE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnIDTYPE" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ID" type = "xsd: String" / >

< xsd: element name = "ID-XPIR_DT" type = "xsd: Integer" / >

< xsd: element name = "OCCUPATION" >

< xsd: complexType >

< xsd: attribute name = "dmnOCCUP_CD" type = "xsd: String" / >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "OCCUP_CLASS" >

< xsd: complexType >

< xsd: attribute name = "dmnOCCUP_CLASS_CD" type = "xsd: String" / >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ANNUAL_INCOME" type = "xsd: Integer" / >

< xsd: element name = "HEIGHT" type = "xsd: Integer" / >

< xsd: element name = "WEIGHT" type = "xsd: Integer" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ProposerInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = 'PREFIX-TH' >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPERS_NAMEPREFIX" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "NAME-TH" type = "xsd: String" / >

< xsd: element name = "MIDNAME-TH" type = "xsd: String" / >

< xsd: element name = "LASTNAME-TH" type = "xsd: String" / >

< xsd: element name = "FORMERNAME" type = "xsd: String" / >

< xsd: element name = "PREFIX-FR" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPERS_NAMEPREFIX-EN" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "NAME-IN" type = "xsd: String" / >

< xsd: element name = "MIDNAME-EN" type = "xsd: String" / >

< xsd: element name = "LASTNAME-IN" type = "xsd: String" / >

< xsd: element name = "BIRTH_DT" type = "xsd: Integer" / >

< xsd: element name = "ÂGE" type = "xsd: Integer" / >

< xsd: element name = "GENDER" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPERNSEXCD" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "MARITAL_STATUS" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPERC_MAR_STAT_CD" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "RACE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnRACE" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "RELIGION" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnRELIGION" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "NATIONALITY" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnNATIONALITY" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ID_TYPE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnIDTYPE" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ID_NUMBER" type = "xsd: String" / >

< xsd: element name = "ID_XPIR_DT" type = "xsd: Integer" / >

< xsd: element name = "OCCUPATION" >

< xsd: complexType >

< xsd: attribute name = "dmnOCCUP_CD" type = "xsd: String" / >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "OCCUP_CLASS" >

< xsd: complexType >

< xsd: attribute name = "dmnOCCUP_CLASS_CD" type = "xsd: String" / >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ANNUAL_INCOME" type = "xsd: Integer" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ContactInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "AddressInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "Address" maxOccurs = "unbounded" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "ADDRTYPE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnADDR_ADDRTYPE" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "PRIMARY_CONTACT" type = "xsd: Integer" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "PhoneInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "Phone" maxOccurs = "unbounded" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "PHONETYPE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnADRP_PHONETYPE" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "PHONENUM" type = "xsd: Integer" / >

< xsd: element name = "PRIMARY_CONTACT" type = "xsd: Integer" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "EmailInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "Email" maxOccurs = "unbounded" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "EMAILTYPE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnADRO_EMAILTYPE" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "EMAILDATA" type = "xsd: String" / >

< xsd: element name = "PRIMARY_CONTACT" type = "xsd: Integer" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "PolicyInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "BASE-PLAN_CD" type = "xsd: String" / >

< xsd: element name = "BASE-PLAN_NM" type = "xsd: String" / >

< xsd: element name = "MODEOFPAYMENT" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnZZFREQUENCY" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "BASE - SA" type = "xsd: float" / >

< xsd: element name = "BASE-PREMIUM" type = "xsd: float" / >

< xsd: element name = "BASE-MODALPREMIUM" type = "xsd: float" / >

< xsd: element name = "AYFP" type = "xsd: float" / >

< xsd: element name = "RiderInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "Rider" maxOccurs = "unbounded" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "RIDER-CODE" type = "xsd: String" / >

< xsd: element name = "RIDER-NAME" type = "xsd: String" / >

< xsd: element name = "RIDER - SA" type = "xsd: float" / >

< xsd: element name = "RIDER-PREMIUM" type = "xsd: float" / >

< xsd: element name = "RIDER-MODALPREMIUM" type = "xsd: float" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "PaymentInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "Bordered" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "TMP_RECEIPT_NO" type = "xsd: String" / >

< xsd: element name = "TOTAL_PYMT_AMT" type = "xsd: float" / >

< xsd: element name = "Payment" maxOccurs = "unbounded" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "PAYER" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPAYRTYPE" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "TYPE PYMT" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPaymentType" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "PYMT-AMT" type = "xsd: float" / >

< xsd: element name = "PYMT-Channel" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "CreditCard" minOccurs = "0" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "CARD TYPE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnCardType" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "CARD-NO" type = "xsd: Integer" / >

< xsd: element name = "CARD-HOLDERNAME" type = "xsd: String" / >

< xsd: element name = "CARD-BANKNM" type = "xsd: String" / >

< xsd: element name = "CARD-DISPLAYED" type = "xsd: String" / >

< xsd: element name = "CARD-AUTHCODE" / >

< xsd: element name = "CARD-AUTHDATE" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "Bank" minOccurs = "0" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "BANK CODE" / >

< xsd: element name = "BANK-BRANCH" / >

< xsd: element name = "BANK-ACCNO" / >

< xsd: element name = "BANK-ACCNAME" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "Cheque" minOccurs = "0" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "CHQ - NO" / >

< xsd: element name = "CHQ-DATE" / >

< xsd: element name = "CHQ-ISSUEBANK" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "RenewalPayment" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "PAYER" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPAYRTYPE" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "DDCHANNEL" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPaymentType" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "DDCDetails" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "CARD TYPE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnCardType" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "CARD-NO" type = "xsd: Integer" / >

< xsd: element name = "CARD-HOLDERNAME" type = "xsd: String" / >

< xsd: element name = "CARD-BANKNM" type = "xsd: String" / >

< xsd: element name = "CARD-DISPLAYED" type = "xsd: String" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "DDADetails" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "BANK-ACCTYPE" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnBNK_TYP_CD" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "BANK-ACCNO" / >

< xsd: element name = "BANK-ACCNAME" / >

< xsd: element name = "BANK-BRANCH" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "BeneficiaryInfo" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "Recipient" maxOccurs = "unbounded" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "RELATIONSHIP" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnBENE_RELT_CD" type = "xsd: Integer" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "FIRSTNAME" type = "xsd: String" / >

< xsd: element name = "MIDNAME" type = "xsd: String" / >

< xsd: element name = "NAME" type = "xsd: String" / >

< xsd: element name = "PERCENTAGE" type = "xsd: Integer" / >

< xsd: element name = "BIRTH_DT" type = "xsd: Integer" / >

< xsd: element name = "GENDER" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnPERNSEXCD" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "NATLIDNO" type = "xsd: String" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "Questionnaire" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "HealthDeclaration" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "Issue" maxOccurs = "unbounded" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "QUESTION_ID" type = "xsd: String" / >

< xsd: element name = "ANSWER" >

< xsd: complexType >

< xsd:simpleContent >

< xsd:extension base = "XSD: String" >

< xsd: attribute name = "dmnZZYESNO_NUM" type = "xsd: String" / >

< / xsd:extension >

< / xsd:simpleContent >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< xsd: element name = "ApplicationRs" >

< xsd: complexType >

< xsd: SEQUENCE >

< xsd: element name = "Reason for rejection" / >

< / xsd: SEQUENCE >

< / xsd: complexType >

< / xsd: element >

< / xsd: SEQUENCE >

< xsd: attribute name = "xsi" type = "xsd: String" / >

< xsd: attribute name = "schemaLocation" type = "xsd: String" / >

< / xsd: complexType >

< / xsd: element >

< / xsd: Schema >

');

BEGIN

dbms_output.put_line (Ali$ XML_VALID (l_xml, l_xsd));

END;

and please do not confused, you don't need to answer if I do not any sense.

BUT I STILL HAVE ONE LAST QUESTION

do you know how to use namespaces in the exctractvalue().

I'm not "troubled", just frustrated that you don't seem to understand what I've explained so far.

Why do you insist on the use of extractvalue? Don't use extractvalue, it is deprecated, use XMLTABLE instead.

If you feel compelled to use extractvalue of certain grounds, just the curiosity to seek it in the documentation, you can find the syntax to use the namespaces:

http://docs.Oracle.com/CD/E11882_01/server.112/e41084/functions061.htm#SQLRF06173

in your last code, you first insert the XML and extract data from it. I can do it too, but it's not my requirement. I'm supposed to read the first xml (if it is valid) as I do in my code using the table function and make the continuation of the procedure.

Look, I'll ask you one last time:

What problem are you having? What prevents you from first reading, certain values before inserting, as you need. Just use the same query XMLTABLE that I showed in my example, except you will not query the table, but directly from the XMLType variable:

PASSAGE v_xml

COLUMNS...

Tags: Oracle Development

Similar Questions

  • Extract the XML tags and insert into the table

    Description:

    XML is under inert atmosphere in the table containing the xmltype column. Need to extract value from xml tag and insert into the table.
    Once the XML record Treaty must update the status as 'Y' in the base table

    Problem:
    There are multiple occurrences of some tags that need to be combined and stored in a single column to delineate the '-'. No. area of occurrence can vary for each record.
    There are a few encrypted column that I managed to convert decoded value. But used select distinct... XMLTYPE...
    GTT table is used to store the intermediate result and decoding and the concatenation of several tags occurred using TWG.

    1.No. multiple tag will vary how to extract those and concatenate them into a single column. I assumed his occrrence in 3 for example: < student >
    2. how to set the value NULL if no tag is not present. Tag in XML record number can vary. I know that the complete list of xmltags.
    3 data not found error for some xml documents.

    Kindly Assits how to achieve this.

    version: 11.2.0.3.0

    Table Base: temp_XML

    XML_ID NOT NULL NUMBER (28) - auto-increment using the sequence
    PUBLIC EVENT. Stores the XMLTYPE STORAGE BINARY - XML file
    DATE OF EVTDATE
    STATUS VARCHAR2 (3) DEFAULT ' don't

    Sample XML: Includes all the brands mentioned in the common procedure below.

    <? XML version = "1.0" encoding = "US-ASCII"? >

    "< event xmlns ="http://xmlextrac.test.com/object">."

    < data xmlns = "" >

    < object >

    <>units

    < unit > TLAS < / unit >

    < unit > ATLAS < / unit >

    < / units >

    < receiverNetworks >

    < receiverNetwork > ABSAZAJ0XXXX < / receiverNetwork >

    < / receiverNetworks >

    < correspondentIds >

    < correspondentId > #SWF - ABSAZAJ0XXX < / correspondentId >

    < / correspondentIds >

    < comment >

    < comment / >

    < comment / >

    < comment / >

    < comment / >

    < / comment >

    < memo >

    < memo > 28 < / memo >

    < / memos >

    < tuxedoPriority > 20 < / tuxedoPriority >

    sender <>Mike < / sender >

    < typeReseauId > Message < / typeReseauId >

    < maxRetry > 4 < / maxRetry >

    < msgSecuLevel > CBA < / msgSecuLevel >

    < quantity >

    < amount > 12 < / amount >

    < amount > 34 < / amount >

    < amount > 56 < / amount >

    < / amounts >

    < currencys >

    < currency > $ < / currency >

    < currency > EUR < / currency >

    INR < currency > < / currency >

    < / currencys >

    < msgDateVal > ARST123 < / msgDateVal >

    wder < direction > < / direction >

    < eventType > 113 < / eventType >

    < date > 1407431619 < / date >

    < eventDate > 1407431624 < / eventDate >

    < management > R < / direction >

    < msgRef > R950140807AB6CBE < / msgRef >

    < format > SWF < / size >

    < type > 950 < / type >

    R950140807AB6CBE < WALL > < / WALL >

    < bankingPriority / >

    FSDS < field.20 > < / field.20 >

    < texteType > FSS < / texteType >

    < applicationCode > OHS < / applicationCode >

    < company > KETH < / company >

    < endFct > MOE < / endFct >

    < rate > BAM < / flow >

    < subtype / >

    < text > DQo6MjA6R0wxNDA4MDcwMDA1MTMNCjoyNTo3M == < / text >

    < msgHeaders > ezE6RjAxTE9ZRE5MMjBCWFhYMDAzMjAw = < / msgHeaders >

    < msgTrailer > ezU6e0NISzpEOUFFRUNCN0NBQTl9e1RORzp9fQ == < / msgTrailer >

    < / object >

    < / data >

    Procedure: This works very well for a few xml record and fails for some.

    CREATE OR REPLACE PROCEDURE XML_EXTR
    AS
    CURSOR c1
    IS
    SELECT * FROM temp_XML;

    c1_cur c1% ROWTYPE;

    bamdata_sql VARCHAR2 (3000);
    d_text VARCHAR2 (3000);
    d_msgHeaders VARCHAR2 (3000);
    d_msgTrailer VARCHAR2 (3000);
    x_text VARCHAR2 (3000);
    x_msgHeaders VARCHAR2 (3000);
    x_msgTrailer VARCHAR2 (3000);
    x_eventType VARCHAR2 (3000);
    x_amount number (28.2).
    x_currency VARCHAR2 (3000);
    x_state VARCHAR2 (3000);
    x_units VARCHAR2 (3000);
    x_correspondentId VARCHAR2 (3000);
    X_TYPE VARCHAR2 (3000);
    x_receiverNetworks VARCHAR2 (3000);
    x_bankingPriority VARCHAR2 (3000);
    x_applicationCode VARCHAR2 (3000);
    x_processCounter VARCHAR2 (3000);
    x_obsolescence VARCHAR2 (3000);
    x_maxRetry VARCHAR2 (3000);
    x_retries VARCHAR2 (3000);
    x_fileSize VARCHAR2 (3000);
    x_endFct VARCHAR2 (3000);
    x_subType VARCHAR2 (3000);
    x_field20 VARCHAR2 (3000);
    x_sequenceNumber VARCHAR2 (3000);
    x_requestorDn VARCHAR2 (3000);
    x_responderDn VARCHAR2 (3000);
    x_SWIFTNetService VARCHAR2 (3000);
    x_transfertRef VARCHAR2 (3000);
    x_nonrepudiation VARCHAR2 (3000);
    x_transfertInfo VARCHAR2 (3000);
    x_fileDesc VARCHAR2 (3000);
    x_transfertDesc VARCHAR2 (3000);
    x_logicalName VARCHAR2 (3000);
    x_signIndicator VARCHAR2 (3000);
    x_critId VARCHAR2 (3000);
    x_inFapId VARCHAR2 (3000);
    x_deliveryNotif VARCHAR2 (3000);
    x_comment1 VARCHAR2 (3000);
    x_comment2 VARCHAR2 (3000);
    x_comment3 VARCHAR2 (3000);
    x_comment4 VARCHAR2 (3000);
    x_comments VARCHAR2 (3000);
    x_memo1 VARCHAR2 (3000);
    x_memo2 VARCHAR2 (3000);
    x_memo3 VARCHAR2 (3000);
    x_memo4 VARCHAR2 (3000);
    x_msgSecuLevel VARCHAR2 (3000);
    x_dates VARCHAR2 (3000);
    x_tuxedoPriority VARCHAR2 (3000);
    x_fileDest VARCHAR2 (3000);
    x_stkMsgPDEId VARCHAR2 (3000);
    x_EMTId VARCHAR2 (3000);
    x_LTRcptSyno VARCHAR2 (3000);
    x_LTRcpt VARCHAR2 (3000);
    x_LTEmis VARCHAR2 (3000);
    x_flow VARCHAR2 (3000);
    x_FINCopy VARCHAR2 (3000);
    x_msgDateVal VARCHAR2 (3000);
    x_eventDate VARCHAR2 (3000);
    x_typeReseauId VARCHAR2 (3000);
    x_inFapSeq1 VARCHAR2 (3000);
    x_inFapSeq2 VARCHAR2 (3000);
    x_direction VARCHAR2 (3000);
    x_priority VARCHAR2 (3000);
    x_ack VARCHAR2 (3000);
    x_format VARCHAR2 (3000);
    x_mur VARCHAR2 (3000);
    x_TexteType VARCHAR2 (3000);
    x_creatingUser VARCHAR2 (3000);
    x_fileinfo VARCHAR2 (3000);
    x_company VARCHAR2 (3000);
    x_language VARCHAR2 (3000);
    x_ackText VARCHAR2 (3000);
    x_jaxbRef VARCHAR2 (3000);
    x_jaxbElt VARCHAR2 (3000);
    x_memos VARCHAR2 (3000);
    xmlid number (28);
    x_msgRef1 VARCHAR2 (3000);
    x_msgRef2 VARCHAR2 (3000);
    x_msgRef3 VARCHAR2 (3000);
    x_msgRef4 VARCHAR2 (3000);
    x_sender VARCHAR2 (3000);
    x_amlBehavior VARCHAR2 (3000);
    x_ownerServiceId VARCHAR2 (3000);
    x_correspondentName VARCHAR2 (3000);
    x_correspondentAddress1 VARCHAR2 (3000);
    x_correspondentAddress2 VARCHAR2 (3000);
    x_correspondentAddress3 VARCHAR2 (3000);
    x_correspondentAddress4 VARCHAR2 (3000);
    x_correspondentCity VARCHAR2 (3000);
    x_correspondentCountry VARCHAR2 (3000);
    x_correspondentNetworkAddr VARCHAR2 (3000);
    x_tested VARCHAR2 (3000);
    x_correspondentNetwork VARCHAR2 (3000);
    x_validatedPercentage VARCHAR2 (3000);
    x_nbOfValid VARCHAR2 (3000);
    x_requestRef VARCHAR2 (3000);
    x_notifQueue VARCHAR2 (3000);
    x_requestType VARCHAR2 (3000);
    x_secBpid VARCHAR2 (3000);
    x_queue VARCHAR2 (3000);
    x_receiverCode VARCHAR2 (3000);
    x_receiverInd VARCHAR2 (3000);
    x_validFlag VARCHAR2 (3000);
    x_ownerId VARCHAR2 (3000);
    x_dn VARCHAR2 (3000);
    x_RMAOurBic VARCHAR2 (3000);
    x_RMACorrespondentBic VARCHAR2 (3000);
    x_RMAService VARCHAR2 (3000);
    x_fileMsgRef VARCHAR2 (3000);
    date of x_ext_date;
    x_correspondentAddress VARCHAR2 (3000);
    x_msgrefs varchar2 (3000);
    d_ackText varchar2 (3000);
    ackText varchar2 (3000);
    date of x_extdate;

    BEGIN

    FOR C1_CUR IN C1

    LOOP

    INSERT INTO data_GTT_TEMP)
    eventType, amount, currency, State, units, correspondentId, sender, receiverNetworks, bankingPriority, applicationCode, processCounter.
    obsolescence, maxRetry, reminders, fileSize, endFct, xsubType, field.20, sequenceNumber, requestorDn, responderDn, SWIFTNetService, non-repudiation,
    transfertRef, transfertInfo, fileDesc, transfertDesc, logicalName, signIndicator, critId, inFapId, deliveryNotif, comment1, comment2, comment3, comment4,
    Memo1, memo2, memo3, memo4, msgSecuLevel, dates, tuxedoPriority, fileDest, stkMsgPDEId, EMTId, LTRcptSyno, LTRcpt, LTEmis, flow, FINCopy, msgDateVal,
    eventDate, typeReseauId, inFapSeq1, inFapSeq2, direction, priority, ack,
    msgRef1, msgRef2, msgRef3, msgRef4, amlbehavior, correspondentName, ownerServiceId,
    correspondentAddress1, correspondentAddress2, correspondentAddress3, correspondentAddress4,
    correspondentCity, correspondentCountry, correspondentNetworkAddr, tested,
    correspondentNetwork, validatedPercentage, nbOfValid, requestRef, notifQueue,
    requestType, secBpid, xqueue, receiverCode, receiverInd, validFlag, ownerId, dn, RMAOurBic, RMACorrespondentBic, RMAService,
    fileMsgRef, format, xtype, wall, TexteType, creatingUser, fileinfo,
    company, text, xlanguage, ackText, msgHeaders, msgTrailer, jaxbRef, jaxbElt)
    SELECT
    x.eventType, x.amount, x.currency, x.state, x.units, x.correspondentId, x.sender, x.receiverNetworks, x.bankingPriority, x.applicationCode, x.processCounter,
    x.obsolescence, x.maxRetry, x.Retries, x.FileSize, x.endFct, x.xsubType, x.Field20, x.SequenceNumber, x.requestorDn, x.responderDn, x.SWIFTNetService, x.nonRepudiation,
    x.transfertRef, x.transfertInfo, x.fileDesc, x.transfertDesc, x.logicalName, x.signIndicator, x.critId, x.inFapId, x.deliveryNotif, x.comment1, x.comment2,
    x.comment3, x.comment4, x.Memo1, x.memo2, x.memo3, x.MEMO4, x.msgSecuLevel, x.dates, x.tuxedoPriority, x.fileDest, x.stkMsgPDEId, x.EMTId, x.LTRcptSyno,
    x.LTRcpt, x.LTEmis, x.flow, x.FINCopy, x.msgDateVal, x.eventDate, x.typeReseauId, x.inFapSeq1, x.inFapSeq2, x.direction, x.priority, x.ack,
    x.msgRef1, x.msgRef2, x.msgRef3, x.msgRef4, x.amlbehavior, x.correspondentName, x.ownerServiceId,
    x.correspondentAddress1, x.correspondentAddress2, x.correspondentAddress3, x.correspondentAddress4,
    x.correspondentCity, x.correspondentCountry, x.correspondentNetworkAddr, x.tested,
    x.correspondentNetwork, x.validatedPercentage, x.nbOfValid, x.requestRef, x.notifQueue,
    x.requestType, x.secBpid, x.xqueue, x.receiverCode, x.receiverInd, x.validFlag, x.ownerId, x.dn, x.RMAOurBic, x.RMACorrespondentBic, x.RMAService,
    x.fileMsgRef, x.format, x.xtype, x.mur, x.TexteType, x.creatingUser, x.fileinfo,
    x.Company, x.Text, x.xLanguage, x.ackText, x.msgHeaders, x.msgTrailer, x.jaxbRef, x.jaxbElt

    of temp_XML t, XMLTABLE (XMLNAMESPACES ('http://xmlextrac.test.com/object' as "ns0"), ' / ns0:event' )
    PASSAGE t.BAM_EVENT COLUMNS
    eventType varchar2 (3000) PATH 'data, object, eventType' DEFAULT NULL,
    amount number (28.2) path data/object/amounts"."
    currency varchar2 (3000) PATH 'data, object, currencys, currency' DEFAULT NULL,
    VARCHAR2 (3000) path "data/object / / state of ' DEFAULT NULL, State
    units varchar2 (3000) PATH ' object/data/units' DEFAULT NULL,
    correspondentId varchar2 (3000) PATH "data/object/correspondentIds' DEFAULT NULL,
    sender varchar2 (3000) PATH 'data, object, sender' DEFAULT NULL,
    receiverNetworks varchar2 (3000) PATH "data/object/receiverNetworks' DEFAULT NULL,
    bankingPriority varchar2 (3000) PATH "data/object/bankingPriority' DEFAULT NULL,
    applicationCode varchar2 (3000) PATH ' object/data/applicationCode' DEFAULT NULL,
    processCounter varchar2 (3000) PATH "data/object/processCounter' DEFAULT NULL,
    obsolescence varchar2 (3000) PATH ' data/object/obsolescence' DEFAULT NULL,
    maxRetry varchar2 (3000) PATH ' data/object/maxRetry' DEFAULT NULL,
    attempts to varchar2 (3000) "data/object/attempts" DEFAULT NULL path,.
    size of the file varchar2 (3000) PATH ' data/object/fileSize' DEFAULT NULL,
    endFct varchar2 (3000) PATH "data/object/endFct' DEFAULT NULL,
    xsubType varchar2 (3000) PATH "data/object/subtype' DEFAULT NULL,
    field.20 varchar2 (3000) PATH ' object/data/field.20' DEFAULT NULL,
    sequenceNumber varchar2 (3000) PATH "data/object/sequenceNumber" DEFAULT NULL,
    requestorDn varchar2 (3000) PATH "data/object/requestorDn' DEFAULT NULL,
    responderDn varchar2 (3000) PATH "data/object/responderDn' DEFAULT NULL,
    SWIFTNetService varchar2 (3000) PATH "data/object/SWIFTNetService' DEFAULT NULL,
    non-repudiation varchar2 (3000) PATH ' object/data/repudiation' DEFAULT NULL,
    transfertRef varchar2 (3000) PATH "data/object/transfertRef' DEFAULT NULL,
    transfertInfo varchar2 (3000) PATH "data/object/transfertInfo' DEFAULT NULL,
    fileDesc varchar2 (3000) PATH "data/object/fileDesc' DEFAULT NULL,
    transfertDesc varchar2 (3000) PATH "data/object/transfertDesc' DEFAULT NULL,
    logicalName varchar2 (3000) PATH "data/object/logicalName" DEFAULT NULL,
    signIndicator varchar2 (3000) PATH "data/object/signIndicator' DEFAULT NULL,
    critId varchar2 (3000) PATH "data/object/critId' DEFAULT NULL,
    inFapId varchar2 (3000) PATH "data/object/inFapId' DEFAULT NULL,
    deliveryNotif varchar2 (3000) PATH "data/object/deliveryNotif' DEFAULT NULL,
    COMMENT1 varchar2 (3000) PATH ' data, subject, comments, comment [1] "DEFAULT NULL,
    comment2 varchar2 (3000) PATH 'data, subject, comments, how [2]' DEFAULT NULL,
    comment3 varchar2 (3000) PATH "data/object/observations/comments [3]" DEFAULT NULL,
    comment4, varchar2 (3000) PATH ' data, subject, comments, comment [4] "DEFAULT NULL,
    Memo1 varchar2 (3000) PATH "data/object/memos/memo [1]" DEFAULT NULL,
    Memo2 varchar2 (3000) PATH "data/object/notes/Notes [2]" DEFAULT NULL,
    memo3 varchar2 (3000) PATH "data/object/memos/memo [3]" DEFAULT NULL,
    MEMO4 varchar2 (3000) PATH "data/object/memos/memo [4]" DEFAULT NULL,
    msgSecuLevel varchar2 (3000) PATH "data/object/msgSecuLevel' DEFAULT NULL,
    Date varchar2 (3000) PATH ' object/data/date' DEFAULT NULL,
    tuxedoPriority varchar2 (3000) PATH "data/object/tuxedoPriority' DEFAULT NULL,
    fileDest varchar2 (3000) PATH "data/object/fileDest' DEFAULT NULL,
    stkMsgPDEId varchar2 (3000) PATH "data/object/stkMsgPDEId' DEFAULT NULL,
    EMTId varchar2 (3000) PATH "data/object/EMTId' DEFAULT NULL,
    LTRcptSyno varchar2 (3000) PATH "data/object/LTRcptSyno' DEFAULT NULL,
    LTRcpt varchar2 (3000) PATH "data/object/LTRcpt' DEFAULT NULL,
    LTEmis varchar2 (3000) PATH "data/object/LTEmis' DEFAULT NULL,
    flow varchar2 (3000) PATH "/ object/data flow ' DEFAULT NULL,
    FINCopy varchar2 (3000) PATH ' data/object/FINCopy' DEFAULT NULL,
    msgDateVal varchar2 (3000) PATH "data/object/msgDateVal' DEFAULT NULL,
    eventDate varchar2 (3000) PATH "data/object/eventDate" DEFAULT NULL,
    typeReseauId varchar2 (3000) PATH "data/object/typeReseauId' DEFAULT NULL,
    inFapSeq1 varchar2 (3000) PATH "data/object/inFapSeq1' DEFAULT NULL,
    inFapSeq2 varchar2 (3000) PATH "data/object/inFapSeq2' DEFAULT NULL,
    direction varchar2 (3000) PATH 'data, object, direction' DEFAULT NULL,
    priority varchar2 (3000) PATH ' data/object/priority' DEFAULT NULL,
    ACK varchar2 (3000) PATH ' object/data/ack' DEFAULT NULL,
    msgRef1 varchar2 (3000) PATH ' data, object, msgRefs, msgRef [1] "DEFAULT NULL,
    msgRef2 varchar2 (3000) PATH ' data, object, msgRefs, msgRef [2] "DEFAULT NULL,
    msgRef3 varchar2 (3000) PATH ' data, object, msgRefs, msgRef [3] "DEFAULT NULL,
    msgRef4 varchar2 (3000) PATH ' data, object, msgRefs, msgRef [4] "DEFAULT NULL,
    amlBehavior varchar2 (3000) PATH "data/object/amlBehavior' DEFAULT NULL,
    ownerServiceId varchar2 (3000) PATH "data/object/ownerServiceId' DEFAULT NULL,
    correspondentName varchar2 (3000) PATH ' data/object/correspondentName' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of correspondentAddress1 ' object/data/correspondentLine1Addresse' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of correspondentAddress2 ' object/data/correspondentLine2Addresse' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of correspondentAddress3 ' object/data/correspondentLine3Addresse' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of correspondentAddress4 ' object/data/correspondentLine4Addresse' DEFAULT NULL,
    correspondentCity PATH VARCHAR2 (3000) ' object/data/correspondentCity' DEFAULT NULL,
    correspondentCountry PATH VARCHAR2 (3000) ' object/data/correspondentCountry' DEFAULT NULL,
    correspondentNetworkAddr PATH VARCHAR2 (3000) ' object/data/correspondentNetworkAddr' DEFAULT NULL,
    tested VARCHAR2 (3000) PATH ' data/object/tested' DEFAULT NULL,
    correspondentNetwork PATH VARCHAR2 (3000) ' object/data/correspondentNetwork' DEFAULT NULL,
    validatedPercentage PATH VARCHAR2 (3000) ' object/data/validatedPercentage' DEFAULT NULL,
    nbOfValid PATH VARCHAR2 (3000) ' object/data/nbOfValid' DEFAULT NULL,
    requestRef VARCHAR2 (3000) PATH ' data/object/requestRef' DEFAULT NULL,
    notifQueue PATH VARCHAR2 (3000) ' object/data/notifQueue' DEFAULT NULL,
    requestType PATH VARCHAR2 (3000) ' data/object/requestType' DEFAULT NULL,
    secBpid PATH VARCHAR2 (3000) ' object/data/secBpid' DEFAULT NULL,
    xqueue PATH VARCHAR2 (3000) ' data/object/tail' DEFAULT NULL,
    receiverCode PATH VARCHAR2 (3000) ' object/data/receiverCode' DEFAULT NULL,
    receiverInd PATH VARCHAR2 (3000) ' object/data/receiverInd' DEFAULT NULL,
    validFlag PATH VARCHAR2 (3000) ' object/data/validFlag' DEFAULT NULL,
    ownerId PATH VARCHAR2 (3000) ' data/object/ownerId' DEFAULT NULL,
    DN VARCHAR2 (3000) PATH ' data/object/dn' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of RMAOurBic ' object/data/RMAOurBic' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of RMACorrespondentBic ' object/data/RMACorrespondentBic' DEFAULT NULL,
    PATH of VARCHAR2 (3000) of RMAService ' object/data/RMAService' DEFAULT NULL,
    fileMsgRef PATH VARCHAR2 (3000) ' object/data/fileMsgRef' DEFAULT NULL,
    ackText varchar2 (3000) PATH "data/object/ackText' DEFAULT NULL,
    format varchar2 (3000) PATH "data/object / ' DEFAULT NULL,
    xType varchar2 (3000) PATH ' data/object/type' DEFAULT NULL,
    Wall varchar2 (3000) PATH ' data/object/wall' DEFAULT NULL,
    texteType varchar2 (3000) PATH "data/object/texteType' DEFAULT NULL,
    creatingUser varchar2 (3000) PATH ' data/object/creatingUser' DEFAULT NULL,
    fileInfo varchar2 (3000) PATH ' data/object/fileInfo' DEFAULT NULL,
    VARCHAR2 (3000) path ' data/object/society' DEFAULT NULL, the company
    VARCHAR2 (3000) text ' data/object/text' DEFAULT NULL path.
    xLanguage varchar2 (3000) PATH ' data/object/language' DEFAULT NULL,
    msgHeaders varchar2 (3000) PATH "data/object/msgHeaders' DEFAULT NULL,
    msgTrailer varchar2 (3000) PATH "data/object/msgTrailer' DEFAULT NULL,
    jaxbRef varchar2 (3000) PATH ' info/jaxbRef' DEFAULT NULL,
    jaxbElt varchar2 (3000) PATH "jaxbElt/info") x
    where t.XML_ID = c1_cur. XML_ID and t.status =' no;

    Select x.text, x.msgHeaders, x.msgTrailer in x_msgTrailer, x_msgHeaders, x_text of
    temp_XML t, XMLTABLE (XMLNAMESPACES ('http://xmlextrac.test.com/object' as "ns0"), ' / ns0:event' )
    PASSAGE t.BAM_EVENT COLUMNS
    text varchar2 (3000) PATH data/object/text"."
    msgHeaders varchar2 (3000) PATH "data/object/msgHeaders,"
    msgTrailer varchar2 (3000) PATH "object/data/msgTrailer.
    ) x
    where t.XML_ID = c1_cur. XML_ID;
    Select sysdate in double x_extdate;


    d_text: = utl_raw.cast_to_varchar2 (utl_encode.base64_decode (utl_raw.cast_to_RAW (x_text)));
    d_msgHeaders: = utl_raw.cast_to_varchar2 (utl_encode.base64_decode (utl_raw.cast_to_RAW (x_msgHeaders)));
    d_msgTrailer: = utl_raw.cast_to_varchar2 (utl_encode.base64_decode (utl_raw.cast_to_RAW (x_msgTrailer)));
    -d_ackText: = utl_raw.cast_to_varchar2 (utl_encode.base64_decode (utl_raw.cast_to_RAW (ackText)));

    Select
    EventType, amount, currency, State, units, correspondentid, sender, receivernetworks, bankingpriority,
    applicationcode, processcounter, obsolescence, maxretry, reminders, filesize, endfct, xsubtype, field.20, sequencenumber, requestordn,
    responderdn, swiftnetservice, non repudiation, transfertref, transfertinfo, filedesc, transfertdesc, logicalname, signindicator,
    critid, infapid, deliverynotif, comment1, comment2, comment3, comment4, memo1, memo2, memo3, memo4, msgseculevel, dates, tuxedopriority, filedest,
    stkmsgpdeid, emtid, ltrcptsyno, ltrcpt, ltemis, flow, fincopy, msgdateval, eventdate, typereseauid, infapseq1,
    infapseq2, direction, priority, ack, msgref1, msgref2, msgref3, msgref4, amlbehavior, ownerserviceid, correspondentname, correspondentaddress1, correspondentaddress2, correspondentaddress3, correspondentaddress4,
    correspondentcity, correspondentcountry, correspondentnetworkaddr, test, correspondentnetwork, validatedpercentage, nbofvalid,.
    requestref, notifqueue, requesttype, secbpid, xqueue, receivercode, receiverind, validflag, ownerid, dn, rmaourbic, rmacorrespondentbic, rmaservice, filemsgref,
    acktext, format, xtype, wall, textetype, creatinguser, fileinfo, society, text, xlanguage, msgheaders, msgtrailer, jaxbref, jaxbelt
    in
    x_eventtype, x_amount, x_currency, x_state, x_units, x_correspondentid, x_sender, x_receivernetworks, x_bankingpriority, x_applicationcode, x_processcounter,
    x_obsolescence, x_maxretry, x_retries, x_filesize, x_endfct, x_subtype, x_field20, x_sequencenumber, x_requestordn, x_responderdn, x_swiftnetservice, x_nonrepudiation,
    x_transfertref, x_transfertinfo, x_filedesc, x_transfertdesc, x_logicalname, x_signindicator, x_critid, x_infapid, x_deliverynotif, x_comment1, x_comment2, x_comment3,
    x_comment4, x_memo1, x_memo2, x_memo3, x_memo4, x_msgseculevel, x_dates, x_tuxedopriority, x_filedest, x_stkmsgpdeid, x_emtid, x_ltrcptsyno, x_ltrcpt,
    x_ltemis, x_flow, x_fincopy, x_msgdateval, x_eventdate, x_typereseauid, x_infapseq1, x_infapseq2, x_direction, x_priority, x_ack, x_msgref1, x_msgref2,
    x_msgref3, x_msgref4, x_amlbehavior, x_ownerserviceid, x_correspondentname, x_correspondentaddress1, x_correspondentaddress2, x_correspondentaddress3,
    x_correspondentaddress4, x_correspondentcity, x_correspondentcountry, x_correspondentnetworkaddr, x_tested, x_correspondentnetwork, x_validatedpercentage,
    x_nbofvalid, x_requestref, x_notifqueue, x_requesttype, x_secbpid, x_queue, x_receivercode, x_receiverind, x_validflag, x_ownerid, x_dn, x_rmaourbic,
    x_rmacorrespondentbic, x_rmaservice, x_filemsgref, x_acktext, x_format, x_type, x_mur, x_textetype, x_creatinguser, x_fileinfo, x_company, x_text,
    x_language, x_msgheaders, x_msgtrailer, x_jaxbref, data_GTT_TEMP x_jaxbelt;

    x_memos: = x_memo1 | » -'|| x_memo2 | » -'|| x_memo3 | » -'|| x_memo4;
    x_comments: = x_comment1 | » -'|| x_comment2 | » -'|| x_comment3 | » -'|| x_comment4;
    x_correspondentAddress: = x_correspondentAddress1 | » -'|| x_correspondentAddress2 | » -'|| x_correspondentAddress3 | » -'|| x_correspondentAddress4;
    x_msgrefs: = x_msgRef1 | » -'|| x_msgRef2 | » -'|| x_msgRef3 | » -'|| x_msgRef4;

    BEGIN


    insert into donnees_xml
    (xml_id, x_ext_date, eventtype, amount, currency, State, unit, correspondentid, sender, receivernetworks, bankingpriority, applicationcode,
    ProcessCounter, obsolescence, maxretry, reminders, filesize, endfct, xsubtype, field.20, sequencenumber, requestordn, responderdn,
    swiftnetservice, non repudiation, transfertref, transfertinfo, filedesc, transfertdesc, logicalname, signindicator, critid, infapid,
    deliverynotif, comments, notes, msgseculevel, dates, tuxedopriority, filedest, stkmsgpdeid, emtid, ltrcptsyno, ltrcpt, ltemis, flow,
    FINCopy, msgdateval, eventdate, typereseauid, infapseq1, infapseq2, direction, priority, ack, msgrefs, amlbehavior, ownerserviceid,
    correspondentName correspondentaddress, correspondentcity, correspondentcountry, correspondentnetworkaddr, tested,
    correspondentnetwork, validatedpercentage, nbofvalid, requestref, notifqueue, requesttype, secbpid, xqueue, receivercode,
    receiverind, validflag, ownerid, dn, rmaourbic, rmacorrespondentbic, rmaservice, filemsgref, acktext, format, xtype, wall,
    textetype, creatinguser, fileinfo, society, text, xlanguage, msgheaders, msgtrailer, jaxbref, jaxbelt)
    values
    (xmlid, x_extdate, x_eventType, x_amount, x_currency, x_state, x_units, x_correspondentId, x_sender, x_receiverNetworks, x_bankingPriority, x_applicationCode,
    x_processCounter, x_obsolescence, x_maxRetry, x_retries, x_fileSize, x_endFct, x_subType, x_field20, x_sequenceNumber, x_requestorDn, x_responderDn,
    x_SWIFTNetService, x_nonRepudiation, x_transfertRef, x_transfertInfo, x_fileDesc, x_transfertDesc, x_logicalName, x_signIndicator, x_critId, x_inFapId,
    x_deliveryNotif, x_comments, x_memos, x_msgSecuLevel, x_dates, x_tuxedoPriority, x_fileDest, x_stkMsgPDEId, x_EMTId, x_LTRcptSyno, x_LTRcpt, x_LTEmis, x_flow,
    x_FINCopy, x_msgDateVal, x_eventDate, x_typeReseauId, x_inFapSeq1, x_inFapSeq2, x_direction, x_priority, x_ack, x_msgrefs, x_amlbehavior, x_ownerServiceId,
    x_correspondentName, x_correspondentAddress, x_correspondentCity, x_correspondentCountry, x_correspondentnetworkaddr, x_tested,
    x_correspondentNetwork, x_validatedPercentage, x_nbOfValid, x_requestRef, x_notifQueue, x_requestType, x_secBpid, x_queue, x_receiverCode,
    x_receiverInd, x_validFlag, x_ownerId, x_dn, x_RMAOurBic, x_RMACorrespondentBic, x_RMAService, x_fileMsgRef, ackText, x_format, x_type, x_mur,
    x_TexteType, x_creatingUser, x_fileinfo, x_company d_text, x_language, d_msgHeaders, d_msgTrailer, x_jaxbRef, x_jaxbElt);

    Update temp_XML set status = 'Y' where XML_ID = xmlid;

    END;
    COMMIT;
    END LOOP;
    END;
    /

    1.No. multiple tag will vary how to extract those and concatenate them into a single column. I assumed that his occrrence in 3 for example:

    Use the fn:string-join() function:

    path varchar2 (4000) of comments 'string-join(comments/comment, "-").

    2. how to set the value NULL if no tag is not present. Tag in XML record number can vary.

    You don't have anything specific to do in this case.

    Missing tags with a projection in the COLUMNS clause will produce a column NULL by default.

  • Parse XML and insert into the table Oracel

    Hi all

    I have an XML document, I need to analyze and take the respective tag data and inserting it into another table.

    This is the XML code that I have.

    " < convertTo xsi: schemaLocation =" https://xecdapi.XE.com/schema/v1/convertTo.xsd "> "

    < terms > http://www.XE.com/privacy.php < / terms >

    < privacy > http://www.XE.com/legal/DFS.php < / privacy >

    < to > < /pour > USD

    < amount > 1.0 < / amount >

    < timestamp > 2015-10-25T 23: 00:00Z < / timestamp >

    < from >

    rate <>

    < currency > EUR < / currency >

    < e > 0.9075541422 < / mid >

    < / rates >

    rate <>

    INR < currency > < / currency >

    < e > 65.0313451105 < / mid >

    < / rates >

    rate <>

    < currency > CAD < / currency >

    < e > 1.3167560135 < / mid >

    < / rates >

    rate <>

    < currency > GBP < / currency >

    < e > 0.6528693249 < / mid >

    < / rates >

    < / from >

    < / convertTo >


    Here is the code I use to analyze the values

    DECLARE

    XMLType x: = XMLType)

    ' ' < convertTo xsi: schemaLocation = " https://xecdapi.XE.com/schema/v1/convertTo.xsd "> "

    < terms > http://www.XE.com/privacy.php < / terms >

    < privacy > http://www.XE.com/legal/DFS.php < / privacy >

    < to > < /pour > USD

    < amount > 1.0 < / amount >

    < timestamp > 2015-10-25T 23: 00:00Z < / timestamp >

    < from >

    rate <>

    < currency > EUR < / currency >

    < e > 0.9075541422 < / mid >

    < / rates >

    rate <>

    INR < currency > < / currency >

    < e > 65.0313451105 < / mid >

    < / rates >

    rate <>

    < currency > CAD < / currency >

    < e > 1.3167560135 < / mid >

    < / rates >

    rate <>

    < currency > GBP < / currency >

    < e > 0.6528693249 < / mid >

    < / rates >

    < / from >

    < / convertTo > '

    );

    BEGIN

    FOR r IN

    (

    SELECT

    Name of the AS ExtractValue (Value (p),'/ rate/currency/text () ')

    -, ExtractValue (value (p), '/ Row/Address/State/Text ()') State

    -, ExtractValue (value (p), '/ Row/Address/City/Text ()') city

    Of

    TABLE (XMLSequence (Extract(x,'convertTo/from/rate'))) p

    )

    LOOP

    -do what you want with r.name, r.state, r.city

    dbms_output.put_line ('Name' | r.Name);

    END LOOP;

    END;

    I get the error message below

    Error report:

    ORA-31011: XML parsing failed

    ORA-19202: an error has occurred in the processing of XML

    LPX-00234: the 'xsi' namespace prefix is not declared

    Error on line 1

    ORA-06512: at "SYS." XMLTYPE", line 310

    ORA-06512: at line 2

    31011 00000 - "XML parsing failed"

    * Cause: XML parser returned an error trying to parse the document.

    * Action: Check whether the document to parse is valid.

    Any help on how to fix this would be really useful.

    Appreciate your time and your help.

    Thank you

    Olivier

    Have you even tried to do what we have suggested?

    SQL > ed
    A written file afiedt.buf

    1 with t as (select xmltype ('))
    "" 2 http://xecdapi.xe.com "xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"" xsi: schemaLocation = "https://xecdapi.xe.com/schema/v1/convertTo.xsd" > ""
    3 http://www.xe.com/privacy.php
    4 http://www.xe.com/legal/dfs.php
    5 USD
    6    1.0
    7 2015-10 - 25 T 23: 00:00Z
    8
    9
    10 EUROS
    11 0.9075541422
    12

    13

    14
    ") in XML of the double)"
    15-
    16 end of test data
    17-
    18 select x.*
    19 t
    20, xmltable (xmlnamespaces ("http://www.w3.org/2001/XMLSchema-instance" as "xsi", default 'http://xecdapi.xe.com'),)
    21 ' / convertTo/of/rate.
    22 passage t.xml
    path of VARCHAR2 (3) currency 23 columns '. / currency '
    24, half-way number '. / mid'
    25*                ) x
    SQL > /.
    HEART MI
    --- ----------
    EUR.907554142

    1 selected line.

  • I have a laptop 425 HP with windows 7 and I lost the sound on the computer built-in Laptop speakers.

    I have a laptop 425 HP with windows 7 and I lost the sound on the computer built-in Laptop speakers. I have sound in my headphones. Windows troubleshooting has not contributed so far.

    My laptop is 30 days

    Hello

    • You did recently change software to the computer?
    • What is the brand and the model number of the sound card?


    Method 1.

    Follow the procedure step by step in the article below and check.
    No sound in Windows
    http://Windows.Microsoft.com/en-us/Windows/help/no-sound-in-Windows

    Method 2.

    If the problem persists, follow the steps listed in the article below and check. http://Windows.Microsoft.com/en-us/Windows7/tips-for-fixing-common-sound-problems

    It will be useful. Let us know for help.

  • How the values to insert into the table with the command insertion

    Dear all
    can someone tell me how the values to insert into the table with the command insert, I want to say I always use command insert behind my forms on what shutter release button press the button of my save, but today I had a form of 6i, where controls (textbox, combo, etc.) are delineated with directly the table with I guess than the Properties Windows , I created 3 columns in tand 3 text on forms fields, now kindly tell me how to do this fields to fill and do not insert command, I mean directly defined with table column



    Please help me its urgent

    Hello

    If the block is based on your database table, just committed the shape, then changes will be applied to the database.

    François

  • XML with XSD validation when there is more than one XSD.

    Hello

    I need to validate an XML against a set of xsd.

    I am aware that, when there is a single XSD to compare, it is possible to compare using xmlDoc.schemaValidate () with xmlDoc and xmlSchema.

    But in my case, there is more than one XSD against which I need to compare the XML code.

    My main XSD has the statement as mentioned below.

    " < xs: import namespace = ' http://www.w3.org/1999/xxxx "schemaLocation ="xxxx.xsd"/ > "

    " < xs: import namespace = ' http://www.w3.org/1999/02/yyyy "schemaLocation ="yyyy.xsd"/ > "

    I don't know how to handle this situation.

    Please, help me!

    Thank you

    Vicky

    Hi Vicky,

    This situation is not different, just validate the main schema.

    But, to use the XMLType schemaValidate method, you must save the schema in the database (via the DBMS_XMLSCHEMA API).

    If the main schema contains imports then these referenced schemas must be saved too.

    To sum up: register all 3 patterns in their order of dependency, then you will be able to validate your XML with the main XSD code.

    () dbms_xmlschema.registerSchema

    schemaURL-online , for example 'xxxx.xsd'

    schemaDoc =>

    local-online true

    genTypes-online fake

    genTables-online fake

    enableHierarchy-online dbms_xmlschema. ENABLE_HIERARCHY_NONE

    ) ;

  • Extraction of data from a XML and inserting into a table

    Hi all

    I have a problem for which I couldn't find any convincing solution

    I have an XML format

    <data>
    <students>
    <student>
    <studentname>Raymond<studentname>
    <StudentId>1</StudentId>
    <StudentAge>11</StudentAge>
    <StudentMark>0</StudentMark>
    </student>
    </students>
    
    
    

    Now I have to insert this XML DB, the table consists of the following columns

    (line number, property name, value)

    Wait it out put is

    (1, studentname, Raymond).

    (1, studentid, 1)

    (1, studentAge, 11)

    (1, Studentmark, 0)

    The challenge here

    1. how to get the tag names and fill in the property name column?

    2. the number of properties for a student can be variable, how can I deal with them?

    I am very new to PLSQL XML manipulation. Can someone give me some advice I can start with the creation of a solution?  I hope, I've been able to describe my use case. If this isn't the case, please let me know.

    Thanks in advance,

    Cherif

    Here is an example:

    SQL > with sample_data like)

    2. Select xmlparse (document

    3'

    4

    5

    6 Raymond

    7        1

    8        11

    9        0

    10

    11

    12 John

    13        2

    14        18

    15        15

    16

    17

    18 ') xmldoc

    19 of the double

    20)

    21 select x1.record_id

    22, x2.*

    sample_data 23 t

    24, xmltable)

    25 ' / data/students/pupils.

    26 passage t.xmldoc

    record_id 27 columns for ordinalite

    28, property xmltype path ' *'

    (29) x 1

    30, xmltable)

    31         '*'

    32 passage x1.properties

    path of varchar2 (30) 33 columns property_name "local - name (.)".

    34, path name varchar2 (30) '.'

    (35) x 2

    36;

    RECORD_ID PROPERTY-NAME NAME

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

    1 studentname Raymond

    StudentId 1 1

    1 StudentAge 11

    1 StudentMark 0

    2 John studentname

    StudentId 2 2

    2 StudentAge 18

    2 StudentMark 15

    8 selected lines

  • insert into the table of GLOBAL of AWT DYNAMICS with passthrough CACHE GROUP 3

    Hi all

    I have AWT DYNAMIC GLOBAL GROUP CACHE table on the customer table


    Relay 3:
    insert into customer values (5, 'US', 'Dublin', 'KkROAD');
    3340: Delete/update/insert/truncate Passthrough of the grid cache tables are not allowed


    but when I insert it to PL/SQL passthrough block 3:


    Start
    insert into customer values (5, 'US', 'Dublin', 'KkROAD');
    end;

    /

    PL/SQL procedure successfully completed.


    record inserted, but I

    1. Select * from customer (passthrough 0)
    can not see the record inserted in Timesten

    2 see the recoerd inserted in oracle

    3. can not insert gives same record in TT agiain .it
    342: introduced key already exists on Oracle or remote node


    is that corect behavior, can tell me

    I need to confirm, but I think that the fact that the Pl/SQL based insert works is a bug; He must also fail with error 3340. I will check into it and get back to you.

    The reason that SELECT * FROM CUSTOMER doesn't nto show the record is this "dynamic load" (extraction of missing data from Oracle) works only when the query contains a key equality predicate on a primary key or foreign defined on one of the tables in the Group of cache (it's documenetd in the cache user guide).

    The reason for which the insertion fails later in TimesTen is that we are to check if the record exists in Oracle (who does) and rejecting the insert (behavior correct and expected).

    It is not clear to me why you would want to use PassThrough to insert a row in Oracle in this case. The idea is surely that you insert the TimesTen online and it gets proagated to Oracle via AWT...

    Chris

  • Insert into the table with the help of the string

    Hi all

    I have a string with commas.
    Is it possible to insert the values of string directly in the table in each column.

    For ex:

    v_str = "10,20,30,40";

    insert into v_tab (col1, col2, col3, col4) values (10,20,30,40);

    I would like to pass v_str instead of numbers in the insert statement.

    Thank you

    I try with this simple block
    DECLARE
      v_char VARCHAR2(1000) := '10,20'; 
      v_query VARCHAR2(3000); 
    BEGIN
      v_query := 'INSERT INTO week_bkgs(week_num, product_bkg) VALUES (:x)'; 
      EXECUTE IMMEDIATE v_query USING v_char; 
    END; 
    /
    How can achieve us if
    the column a. data types are the NUMBER
    b column data types are VARCHAR2

    Published by: polasa on October 30, 2008 21:20

    Try this

    SQL> set lines 100
    SQL> desc student;
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ------------------------------------
     NAME                                                           VARCHAR2(100)
     STUDENT_NUMBER                                                 NUMBER(10)
    
    SQL> declare
      2     str_v   varchar2(100) :='''abc'',1';
      3  begin
      4     execute immediate 'insert into student values ('|| str_v ||')';
      5  end;
      6  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from student where student_number=1
      2  ;
    
    NAME                 STUDENT_NUMBER
    -------------------- --------------
    abc                               1
    
    SQL> 
    
  • Insert into the table with restrictions

    Hello

    I'm trying to insert into the rows of the table to a table, but this inserts are conditioned by the other table.

    The old table is:

    CREATE TABLE control)

    ID number 4 NOT NULL,.

    FD varchar2 (10) NOT NULL,

    HD varchar2 (10) NOT NULL,

    Code number 4 NOT NULL,

    fcod varchar2 (10) NOT NULL,

    Type varchar2 (10) NOT NULL,

    invoice_text varchar2 (10) NOT NULL

    )

    This table includes the following values:

    Fd hd place ID code fcod typ invocie

    So if you want to help change your original message and finish it. Otherwise, just mark the ANSWER thread.

  • My new copy of Quickbooks Pro 2012 seems to have a problem of compatibility with Explorer 9

    My new copy of Quickbooks Pro 2012 seems to have a problem of compatibility with Explorer 9.  If anyone has experienced this problem and do you know a solution?

    Hello
     
    What is the full error message?
    The average while you can also contact QuickBooks for additional help.
  • Silverlight has been installed on my dell with media player and after that the tuner has stoped running silverlight would have something to do with it? I get a low rate and no signal tuner.

    Silverlight has been installed on my dell with media player and after that the tuner has stoped running silverlight would have something to do with it? I get a low rate and no signal tuner.

    Hello

    Thanks for the quick response.

    What web browser do you use to access the links in my previous post?

    If you use Internet Explorer, I suggest to optimize Internet Explorer settings and check if it works.

     

     

     

    How to optimize Internet Explorer

    http://support.Microsoft.com/kb/936213/ro

     

    Warning: Please note that the reset Internet Explorer (IE) resets all of the settings defined by the user, including those established by the installed extensions, toolbars and other add-ons for IE by default. This includes all the security, privacy and settings area. Also this will erase browsing history, delete all temporary Internet, cookies, form data files and especially all the passwords.

     

    If the problem persists, you can reinstall the drivers for the Tuner card and check with the question.

    It will be useful. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

  • I have a problem check my code for Lightroom 6 help please, the site says code cannot be verified. I have an existing application of Lightroom 2 and I paid for the upgrade

    I have a problem check my code for Lightroom 6 help please, the site says code cannot be verified. I have an existing application of Lightroom 2 and I paid for the upgrade

    If you purchased the version of LR 6 upgrade then when you install and run for the first time it asks you to Sign In. You must sign in with the same Adobe ID you used to buy it. Then once it's a window will appear asking for a serial number. In this window, you enter the serial number LR 6 What adobe sent you. Then once that went into a second serial number box will appear asking for a serial number from a previous version. Then you enter the serial number LR 2. Series LR 2 will begin with the same 4 numbers, 1160.

  • Why Lightroom CC will not download Nikon D610 photos, the same problem, I got with lightroom 3 and told me that I had to upgrade.

    Why Lightroom CC will not download Nikon D610 photos, the same problem, I got with lightroom 3 and said to upgrade?

    Make sure you sort the display you are looking at instead of file name recording time. It is in the context menu with a small sign of a to z just below images. Make sure also that you have no active filters.

  • I have an iMac 27' 2012 with macOS Sierra and Apple Watch with watch OS 3, I can use the function "Log?" in Apple Watch

    I have an iMac 27' 2012 with macOS Sierra and Apple Watch with watch OS 3, I can use the function "Log?" in Apple Watch

    Hi John 2078 Tito.

    I understand that you have updated your iMac and Apple Watch and now you're curious about unlock your iMac using your Apple Watch. I know that it is a nice feature to be able to quickly and safely unlock your computer, so I'm happy to help you.

    This feature is available on 2013 iMacs and later versions, which means that your iMac won't be compatible. You can see more info on this feature here:
    Unlock your Mac with Apple Watch - Apple Watch user's Guide

    Thank you for using communities Support from Apple. See you soon!

Maybe you are looking for

  • 2000-2314TU HP: not able to connect to the LAN and Wireless network

    Hello I have a HP laptop and it had Windows 8 is installed. It was very slow so I installed windows 7. After the downgrade, I am not able to connect to LAn or wireless n/w. I think that there are some missing drivers. Can anyone please suggest what d

  • convergence error

    I do a simple circuit with a relay, I have an scr to latch and energize the relay. the circuit works no problem, but when I put a diode on the coil, as we always do with relay coils, It gives the error of convergence. I have the version 11 student ed

  • Error publishing app for Windows

    HelloI did all the necessary with makecert and pvk2pfx to generate the .pfx certificate. Transferred to the phonegap build and generated the .aspx file. But if I download this file on my windows developer account to publish to the top, I get this err

  • Replace the numbers with alphanumeric symbols using liquid

    Hi guys, I have an application is difficult to achieve. Because I don't know how to do in this regard. I want to hide a phone number of the user to show in its entirety on the opposite page before. Assuming that the number of the user is "08093334456

  • adjust the image for the full photo format?

    I use Lightroom 6. Not very teckie so pls be gentle.  When I work on culture, my proportions shows as feasible in only half of the picture, not all the way around it likemost of my fellow photographers that use lightroom.  Is there something I can do