reading data from a variable, separated by "|" and insert into the table

Hi experts,

I have a file on FTP and I read the file. Now what I have to do is to separate the data and insert them into a table. I have already created the table with the required fields.

How can I get data from str?

code below

declare
File1 UTL_FILE. TYPE_DE_FICHIER;
VARCHAR2 (1000) filename: = "GTECHFILES";
Long str;
Start
File1: = UTL_FILE. FOPEN (filename, 'agent_dump_csv.rep', 'r', 32767);
loop
UTL_FILE. GET_LINE (File1, str);
-dbms_output.put_line (' value is :'|| to_char (STR));
end loop;
UTL_FILE. FCLOSE (file1);
exception
When no_data_found then
dbms_output.put_line ("END OF FILE");
UTL_FILE. FCLOSE (file1);
while others then
UTL_FILE. FCLOSE (file1);
dbms_output.put_line (' ERROR: ' |) SQLCODE |': ' | SQLERRM);
end;

You must use ' \ [^ |] +' like regexp:

SQL> create table mytab (a varchar2(20), b varchar2(20), c varchar2(20));

Tabella creata.

SQL> declare
  2  str varchar2(100):= 'qwureer|iftsdfsuif|123134';
  3  begin
  4    insert into mytab
  5      values (regexp_substr(str,'[^|]+',1,1),
  6              regexp_substr(str,'[^|]+',1,2),
  7              regexp_substr(str,'[^|]+',1,3));
  8  end;
  9  /

Procedura PL/SQL completata correttamente.

SQL> select * from mytab;

A                    B                    C
-------------------- -------------------- --------------------
qwureer              iftsdfsuif           123134

Max
[My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/17/supporto-di-xml-schema-in-oracle-xmldb/]

Tags: Database

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.

  • Divide the value and insert into the table

    create table mytab (a tank (25), b Varchar2 (50), Varchar2 (100)) C;

    I have a string like

    myStr:'A$bggoy#qwewewee@A$Qwe#zcxdf@A$po#xvcvxc@A$sdmy#sfdsdf @'

    I need to divide and insert into mytab

    That's what I tried

    declare p_str varchar2 (4000)

    Begin

    long l_str p_str default. '$';

    number of l_n;

    myTableType l_data: = myTabletype();

    Start

    loop

    l_n: = instr (l_str, ",");

    When the output (nvl(l_n,0) = 0);

    l_data.extend;

    l_data (l_data.count): =.

    LTRIM (rtrim (substr (l_str, 1, l_n - 1)));

    l_str: = substr (l_str, l_n + 1);

    -Connect mytab

    end loop;

    end;

    Shows below inf-s:

    describe the OBJ_SPLIT ;

    recreate

    CREATE OR REPLACE TYPE OBJ_SPLIT_table IS TABLE OF OBJ_SPLIT;

    to view the result of the compilation

    CREATE OR REPLACE Function Fn_get_split (P_str VARCHAR2)

    return OBJ_SPLIT_table

    PIPELINED is type t_ref_cursor IS REF CURSOR;

    rf_c t_ref_cursor;

    r_out_rec OBJ_SPLIT: = OBJ_SPLIT (null, null, null, null);

    Begin

    Open the rf_c for

    Select s,.

    REGEXP_SUBSTR (str, ' [^ $] +', 1, 1) s1,

    REGEXP_SUBSTR (str, ' [^ $#] +', 1, 2) s2,.

    REGEXP_SUBSTR (str, ' [^ $#] +' 1, 3) s3

    from (select s, REGEXP_SUBSTR (s, "[^ @] +', 1, rownum") str)

    (select s P_str of double)

    connect by instr (s, ' @', 1, level - 1) > 0)

    where str is not null;

    LOOP

    EXTRACTION rf_c

    IN

    r_out_rec. Str,

    r_out_rec. Delimter1,

    r_out_rec. Delimter2,

    r_out_rec. Delimter3;

    EXIT WHEN rf_c % NOTFOUND;

    PIPE ROW (r_out_rec);

    END LOOP;

    CLOSE Rf_c;

    end;

    and the result

    Select DELIMTER1, DELIMTER2, table DELIMTER3 (Fn_get_split('A$bggoy#qwewewee@A$qwe#zcxdf@A$po#xvcvxc@A$sdmy#sfdsdf@'));

    in SQLPLUS


    ----

    Ramin Hashimzade

  • Attempt to create run time (dynamic) table and insert the data in this... The entrance is a flat file (txt file) which has the numbers and strings... I'm trying to convert them to a string and insert into the table. It is a matter of urgency for me please

    create or replace procedure Dynamic_Table AS

    iVal VARCHAR2 (32);

    iTemp varchar (200): = ";

    sql_stmt VARCHAR2 (200);

    l_file1 UTL_FILE. TYPE_DE_FICHIER;

    l_file utl_file.file_type;

    BEGIN

    l_file1: = UTL_FILE. FOPEN ('TEST', 'dinput.txt', 'R');

    EXECUTE IMMEDIATE ' CREATE TABLE baseline (Item_ID varchar2 (32))';

    Loop

    BEGIN

    UTL_FILE. GET_LINE (l_file1, iVal);

    EXECUTE IMMEDIATE ' insert into baseline values (: ival) "using ival;

    EXCEPTION

    WHEN No_Data_Found THEN EXIT;

    While some OTHER THEN dbms_output.put_line (SQLERRM); * /

    END;

    end loop;

    END;

    You are approaching this the wrong way.  Create an external table based on the file.  External tables are CSV, fixed width data in a queryable table.

    You will need to create an oracle directory to put the file in (MY_ORA_DIR) I leave it for you to do, and then perform the following...

    create table BASELINE)

    ITEM_ID varchar2 (32)

    )

    EXTERNAL ORGANIZATION

    (

    TYPE ORACLE_LOADER

    THE DEFAULT DIRECTORY MY_ORA_DIR

    ACCESS SETTINGS

    (

    RECORDS DELIMITED BY NEWLINE

    LOGFILE "dinput.log".

    BADFILE "dinput.bad."

    NODISCARDFILE

    FIELDS

    (

    ITEM_ID

    )

    )

    LOCATION ("dinput.txt")

    )

    REJECT LIMIT UNLIMITED

    /

    All the dubious records appear in dinput.bad. Dinput.log will give you information.

    External tables are read-only, so once you set up your file, you can create editable as a normal table.

    create table ITABLE_EDITABLE as

    Select * from BASELINE

    /

    Work done, a few lines of code.

  • 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...

  • 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.

  • increase the value of minute in 14 minutes, while the data is inserted into the table

    Hello

    I'm having the asp page that connects with the DB to insert values into the table. One column is date data type. Value from this asp page must be incremented to 14 minutes before be inserted into the table.

    How can I do this?
    sqlG="INSERT INTO AEMU " &_
                                                      " (MSISDN,X,Y,TIME_STAMP,REQ_ID, " &_
                                                      "  COUNTRY_G)" &_
                                                      " VALUES " &_
                                                      "('"& msid &"'," &_
                                                      "'" & X & "'," &_
                                                      "' " & Y & " '," &_
                                                      "to_date('" & Day(TrueTimeStamp) & "-" & MonthName(Month(TrueTimeStamp), True) & "-" & Year(TrueTimeStamp) & " " & Hour(TrueTimeStamp) & ":" & Minute(TrueTimeStamp) & ":" & Second(TrueTimeStamp) & "', 'DD-MON-YYYY HH24:MI:SS')," &_
                                                      "' " & req_id & " '," &_
                                                      "'" & CountryName_G & "')"

    Try this way:

    sqlG="INSERT INTO AEMU " &_
         " (MSISDN,X,Y,TIME_STAMP,REQ_ID, " &_
         "  COUNTRY_G)" &_
         " VALUES " &_
         "('"& msid &"'," &_
         "'" & X & "'," &_
         "' " & Y & " '," &_
         "to_date('" & Day(TrueTimeStamp) & "-" & MonthName(Month(TrueTimeStamp), True) & "-" & Year(TrueTimeStamp) & " " & Hour(TrueTimeStamp) & ":" & Minute(TrueTimeStamp) & ":" & Second(TrueTimeStamp) & "', 'DD-MON-YYYY HH24:MI:SS')+14/(24*60)," &_
         "' " & req_id & " '," &_
         "'" & CountryName_G & "')"
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com]

  • a loop data and insert into another table fail

    HI EVEYONE,
    I'm new in PL/SQL and apply to develop, which I intend to extract data from PDF directly to the oracle database by looking at its difficulty that I changed the approach of the first extraction of my data to flat file and then convert Excel CSV format that makes it easier for me to handle in my oracle database.
    The challenge I'm having here is that
    The column id_number is a mixture of 3 identifications
    One for the facility, which has the form (YEAR/0145)
    The second is for participant with the form (* 01934764 *)
    And the last identification is for dependants with the form (0, 1, 2, 3, 4, 5)
    As shown below
    ID_Number status name
    YEAR/0145
    * 01934764 * MUOKA
    MUOKA main 0
    1 joint MUOKA
    Child2 3 MUOKA
    * 01934769 * TSILIA
    JOEL main 0
    1 joint TSILIA
    2 Child1 TSILIA
    3 Child2 TSILIA
    4 Child3 TSILIA
    5 child4 TSILIA
    * 02216419 * OKOLO
    OKOLO main 0
    1 joint OKOLO
    2 Child1 OKOLO
    3 Child2 OKOLO
    4 Child3 OKOLO
    YEAR/0145
    EZEOKOLI main 0
    1 joint EZEOKOLI
    YEAR/0171
    * 01580118 * ABDOU
    Main 0 ABDOU
    1 joint ABDOU
    2 Child1 ABDOU
    3 Child2 ABDOU
    4 Child3 ABDOU
    5 child4 ABDOU
    BA/0003
    * 00992897 * BAKARI
    BAKARI main 0
    1 joint BAKARI
    BA/0004
    * 00992011 * MAINA
    MAINA main 0
    1 joint MAINA
    2 Child1 MAINA
    3 Child2 MAINA
    4 MARCO Child3
    5 child4 MAINA
    My goal is to separate facilities, participants and beneficiaries so that questioning, I can easily identify a participant and its beneficiaries is under a given installation, so I developed this code.
    create or replace procedure my_new
    is
    cursor c1 is
    Select *.
    the registry
    where id_number like "% / %" or id_number like ' * % *' or id_number in ('0', '1', '2', '3', '4',' 5');

    vNhis register.id_number%TYPE: = NULL;
    vNhis1 register.id_number%TYPE: = NULL;

    Start
    I'm in c1
    loop

    If i.id_number like "% / %".
    then
    vNhis: = i.id_number;

    on the other
    vNhis1: = i.id_number;
    dbms_output.put_line(vNhis||) e '|| vNhis1);


    -loop
    -insert into new_REGISTER (FACILITY_CODE, ID_NUMBER)
    -values (vNhis, vNhis1);
    -commit;
    -end loop;
    end if;

    end loop;
    end;
    It gives me a good quick result as shown below
    YEAR/0145 * 01934764 *.
    YEAR/0145 0
    1 YEAR/0145
    3 YEAR/0145
    YEAR/0145 * 01934769 *.
    YEAR/0145 0
    1 YEAR/0145
    2 YEAR/0145
    3 YEAR/0145
    4 YEAR/0145
    5 YEAR/0145
    YEAR/0145 * 02216419 *.
    YEAR/0145 0
    1 YEAR/0145
    2 YEAR/0145
    3 YEAR/0145
    4 YEAR/0145
    YEAR/0145 0
    1 YEAR/0145
    YEAR/0171 * 01580118 *.
    YEAR/0171 0
    1 YEAR/0171
    2 YEAR/0171
    3 YEAR/0171
    4 YEAR/0171
    5 YEAR/0171
    BA/0003 * 00992897 *.
    BA/0003 0
    BA/0003 1
    BA/0004 * 00992011 *.
    BA/0004 0
    BA/0004 1
    BA/0004 2
    BA/0004 3
    BA/0004 4
    BA/0004 5





    But uncommenting to insert into the newly created table new_register table it is to say this part of the code
    Loop
    Insert in the REGISTER (FACILITY_CODE, NHIS_NUMBER)
    values (vNhis, vNhis1);
    commit;
    end loop;
    end if;

    It took all day to run for the first time and subsequent tests fail to run with my hanging of database. any help on this is appreciated
    Thanks to you all.

    It is slow because you do a lot of change between the SQL and PL/SQL engine with inserts all looped and individual context etc.

    What you need to do is to treat the external table (CSV file) data in a single SQL statement example

    SQL> select id1, id2
      2  from (
      3        select case when id1 is not null then id1 else last_value(id1 ignore nulls) over (order by rn) end as id1
      4              ,id2
      5              ,rn
      6        from (
      7              select rownum as rn
      8                    ,case when id_number like '%/%' then id_number else null end as id1
      9                    ,case when id_number not like '%/%' then id_number else null end id2
     10              from ext_test
     11             )
     12       )
     13  where id2 is not null
     14  order by rn;
    
    ID1                  ID2
    -------------------- --------------------
    AN/0145              *01934764*
    AN/0145              0
    AN/0145              1
    AN/0145              3
    AN/0145              *01934769*
    AN/0145              0
    AN/0145              1
    AN/0145              2
    AN/0145              3
    AN/0145              4
    AN/0145              5
    AN/0145              *02216419*
    AN/0145              0
    AN/0145              1
    AN/0145              2
    AN/0145              3
    AN/0145              4
    AN/0145              0
    AN/0145              1
    AN/0171              *01580118*
    AN/0171              0
    AN/0171              1
    AN/0171              2
    AN/0171              3
    AN/0171              4
    AN/0171              5
    BA/0003              *00992897*
    BA/0003              0
    BA/0003              1
    BA/0004              *00992011*
    BA/0004              0
    BA/0004              1
    BA/0004              2
    BA/0004              3
    BA/0004              4
    BA/0004              5
    
    36 rows selected.
    
  • 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

  • Select values from the db1 table and insert into the DB2 table

    Hello

    I have three databases oracle running in three different machines. their ip address is different. among the DB can access databases. (means am able to select values and insert values into tables individually.)

    I need to extract data from the DB1 table (ip say DB1 is 10.10.10.10 and the user is DB1user and the table is DB1user_table) and insert the values into DB2 table (say ip DB2 is 11.11.11.11 and the user is DB2user and table DB2user_table) of DB3 that is to have access to the two IPs DB.

    How do I do this

    Edited by: Aemunathan on February 10, 2010 23:12

    Depending on the amount of data must be moved between DB1 and DB2, and the frequency at which this should happen, you might consider the SQL * COPY more control. I think it's very useful for one-off tasks little, so I can live within its limits of the data type. More http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/apb.htm#i641251.

    Change some parameter of sqlplus session are almost mandatory in order to get decent transfer rates. Tuning ARRAYSIZE and COPYCOMMIT can make a huge difference in flow. LONG change may be necessary, too, depending on your data. The documentation offers these notes on use:

    To activate the copy of data between Oracle and databases non-Oracle, NUMBER of columns is replaced by DECIMAL columns in the destination table. Therefore, if you are copying between Oracle databases, a NUMBER column with no precision will become a DECIMAL column (38). When copying between Oracle databases, you must use SQL commands (CREATE TABLE AS and INSERTION), or you must make sure that your columns have a specified precision.

    SQL * the VALUE LONGER variable limits the length of the LONG column you are copying. If all LONG columns contain data exceeds the value of LONG, COPY truncates the data.

    SQL * Plus performs a validation at the end of each successful COPY. If you set the SQL * variable more COPYCOMMIT DEFINED to a value positive n, SQL * Plus performs a validation after copying all lots n of records. The SQL * Plus ARRAYSIZE variable SET determines the size of a batch.

    Some operating environments require that the service names be placed between double quotes.

    From a SQL * Plus term on DB3, can resemble the command to move all content from my_table in DB1 to the same table in DB2

    COPY from user1/pass1@DB1 to user2/pass2@DB2 -
    INSERT INTO my_table -
    USING select * from my_table
    

    Note the SQL code * more line-continuation character ' - '. It is used to escape the newline character in a SQL * Plus command if you do not have to type all on one line. I use it all the time with this command, but I can't locate the documentation on that right now. Maybe someone else can put their finger on it.

    There are other ways to accomplish what the command copy and it is not without its quirks and limitations, but I find that there is usefulness in an Oracle Toolbox.

  • Having two channels separated by commas and try to insert into the table.

    Hi, in my procedure there are two upcoming channels as separated by a comma.

    Ex:
    Channel 1: 1: a, 2, 3: c, 4:d, 5:e, 6:f, 7:g, 8:h, 9:i, 10: I;
    Channel 2: 10: a, 11:b, 12:c, 34:d, 45:e, 112:f';

    I have a table like this:
     create table temp_updrop (id number ,valto1 varchar2(10),valfrom1 varchar2(10),valto2 varchar2(10),valfrom2 varchar2(10));
    Now I want to break the chain that he insert the records as:
    Channel 1: 1: a, 2, 3: c, 4:d, 5:e, 6:f, 7:g, 8:h, 9:i, 10: I;
    1 insert in valto1
    an insert in valfrom1

    2. insert into valto1
    b insert into valfrom1
    .
    . so now

    Second string
    Channel 2: 10: a, 11:b, 12:c, 34:d, 45:e, 112:f'

    10 insert into valto2
    an insert in valfrom2

    11. Insert in valto2
    b insert into valfrom2

    .
    .
    .so on.

    The chain might have a number any of values separated by commas or null as well.

    I started with something lie this but after that I don't know how any help appreciated!...
    declare
        vtab   dbms_utility.uncl_array;
        string1 varchar2(4000) :='1:a,2:b,3:c,4:d,5:e,6:f,7:g,8:h,9:i,10:j';
        string2 varchar2(4000) :='10:a,11:b,12:c,34:d,45:e,112:f';
        cnt number;
        
        begin 
                
         dbms_utility.comma_to_table(string1, vtab, cnt);
    Thanks in advance!

    Published by: BluShadow on 18-Sep-2012 15:28
    fixed {noformat}
    {noformat} tags.  Ensure you specify the word "code" in lower case in the tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Glad I could help.

    Please check the question 'answered' if it is. That helps others to focus on the outstanding issues.

  • Select and insert into the code of people

    (1) I have the sql statement to follow, I want to select ROLEUSER, ROLENAME and insert it in my new journal The Recode, how to handle this?
      
    select ROLEUSER,ROLENAME from roleuserTab where roleuser in( 
    select oprid from student where stuId ='KU0056')
    and (rolename) in
    (select rolename from student where roleuser in( 
    select oprid from student where stuID ='KU0056')
    minus
    select rolename from roleuserTab  
     where roleuser = 'SupperIT_user')

    If I understand you correctly, you have a variable in PeopleCode of type Date and you want to assign a value to this variable.

    If the State save the the_AET field. Z_LEFT_DEPT_ON is a type of date, you can assign
    & resultvalue3 = the_AET. Z_LEFT_DEPT_ON

    If the State save the the_AET field. Z_LEFT_DEPT_ON is of type number and value is in the format YYYYMMDD, you can assign
    & resultvalue3 = date (the_AET. Z_LEFT_DEPT_ON)

    If the State save the the_AET field. Z_LEFT_DEPT_ON is a string and the value is in the format YYYYMMDD, you can assign
    & resultvalue3 = date (value (the_AET. Z_LEFT_DEPT_ON))

    If the State save the the_AET field. Z_LEFT_DEPT_ON is of type string and value is not in YYYYMMDD format, you can use the following instructions
    Date3 (year, month, day)

    Do not use % DateIn in PeopleCode to assign values to variables, only in SQL
    PeopleBooks > Enterprise PeopleTools 8.51 PeopleBook: PeopleCode language reference > Meta-SQL elements
    % DateIn
    Syntax

    %DateIn(DT)
    Description

    The variable % of meta-SQL DateIn develops in SQL syntax specific to the platform for the date. % Use DateIn every time that a literal date or the link Date variable is used in a comparison in the Where clause of a statement Select or Update, or when a Date value is passed in an Insert statement.

    you wrote

    so, how I decide when I should help SQLExec or CreateSQL? With CreateSQL is the only building an SQL statement and assign values to the command prompt.
    You can no longer use the SQL built in & SQL. Search for loops or & SQL. Run the toe run SQL
    PeopleBooks > Enterprise PeopleTools 8.51 PeopleBook: PeopleCode QAnywhere > class SQL

    PeopleBooks > Enterprise PeopleTools 8.51 PeopleBook: PeopleCode language reference > built-in functions PeopleCode
    Use the SQLExec function to execute a SQL command from within a PeopleCode program by passing a SQL command string. The SQL command bypasses the processor component and interacts directly with the database server. If you want to delete, insert, or update a single record, use the corresponding PeopleCode record object method.

    If you want to delete, insert, or update a series of records, all of the same type, use the CreateSQL or GetSQL functions, then the method of the class to execute SQL.

    As you can see that all the information in PeopleBooks, you needn't wait for answers on the forums when the information is available.
    http://docs.Oracle.com/CD/E17566_01/epm91pbr0/Eng/psbooks/psft_homepage.htm

  • data not getting not inserted into the table in pl/sql

    Hi all

    Here is my code to the procedure:
    CREATE or REPLACE PROCEDURE GENERATE_SHIFTS (p_plant_fk_key in NUMBER,
    p_start_date IN this update,
    p_end_date IN DATE)
    IS
    -declation of local variable
    l_plant_fk_key NUMBER;
    l_sysdate DATE: = sysdate; - sysdate variable
    l_last_update_system_id NUMBER;
    l_last_update_date DATE;
    l_plant_pk VARCHAR2 (120);
    l_start_time varchar2 (8); - variable to store the start time
    l_end_time VARCHAR2 (8); - variable to store end_time
    l_graveyard VARCHAR2 (30);
    number of l_shift_num;
    l_shift_name VARCHAR2 (240);
    l_line_num NUMBER;
    l_start_date DATE;
    l_end_date DATE;
    l_equipment_fk_key NUMBER;
    NUMBER of l1_plant_fk_key;
    Number of N;
    l_creation_system_id NUMBER;
    l_organization_code VARCHAR2 (120);
    l_system_fk_key NUMBER;
    l_site_id NUMBER;
    l_entity_pk_key NUMBER;
    l_entity_name VARCHAR2 (100);
    l_entity_type VARCHAR2 (30);
    l_production_entity VARCHAR2 (1);
    l_shift_workday_pk_key NUMBER;
    DATE of l1_shift_date;
    l_from_date DATE;
    l_to_date DATE;
    BEGIN

    l_plant_fk_key: = p_plant_fk_key;
    l_start_date: = p_start_date;
    l_end_date: = p_end_date;

    DELETE FROM mth_workday_shifts_D WHERE plant_fk_key = l_plant_fk_key and shift_date > = l_start_date and shift_date < = l_end_date;

    Select value start_time, end_time, cemetery, shift_num, line_num, shift_name l_start_time, l_end_time, l_graveyard, l_shift_num, l_line_num, l_shift_name of

    mth_site_shift_definitions where plant_fk_key = l_plant_fk_key;
    Select plant_pk in the mth_plants_d l_plant_pk where plant_pk_key = l_plant_fk_key;
    SELECT organization_code, system_fk_key IN l_organization_code, l_system_fk_key FROM mth_organizations_l WHERE plant_fk_key is
    l_plant_fk_key;
    N: = l_end_date-l_start_date;

    because me in 1... N
    LOOP


    l_last_update_system_id: = - 99999.
    l_last_update_date: = l_sysdate;
    l_creation_system_id: = - 1;

    INSERT INTO mth_workday_shifts_D (shift_workday_pk_key, shift_workday_pk,
    shift_date, shift_date_julian, plant_fk_key, line_num, shift_type, graveyard_shift, from_date, to_date, shift_num, shift_name, source_org_code, system_fk_key,
    CREATION_DATE, last_update_date, creation_system_id,
    last_update_system_id)
    VALUES (mth.mth_workdays_shifts_s.nextval, l_start_date |) » -'|| l_shift_num | » -'|| l_plant_pk, l_start_date, TO_NUMBER (TO_CHAR (l_start_date, 'J')),
    l_plant_fk_key, l_line_num, null, l_graveyard, l_start_date + ((TO_NUMBER (SUBSTR (l_start_time, 1, 2)) + (TO_NUMBER (SUBSTR (l_start_time, 4, 2)) / 60) + (TO_NUMBER (SUBSTR (l_start_time, 7, 2)) / 3600)) / 24).
    l_start_date + ((TO_NUMBER (SUBSTR (l_end_time, 1, 2)) + (TO_NUMBER (SUBSTR (l_end_time, 4, 2)) / 60) + (TO_NUMBER (SUBSTR (l_end_time, 7, 2)) / 3600)) / 24), l_shift_num, l_shift_name, l_organization_code, l_system_fk_key,.
    l_sysdate, l_sysdate, l_creation_system_id, l_last_update_system_id);
    l_start_date: = l_start_date + 1;


    END LOOP;
    COMMIT;


    DELETE FROM mth_equipment_shifts_d WHERE availability_date > = l_start_date AND availability_date < = l_end_date
    AND equipment_fk_key IN (SELECT DISTINCT (Nvl(a.equipment_fk_key,0))
    OF mth_equipment_shifts_d a, b mth_equipments_d WHERE the b.equipment_pk_key = a.equipment_fk_key AND b.plant_fk_key = l_plant_fk_key);

    INSERT INTO mth_equipment_shifts_d (equipment_fk_key, availability_date, shift_workday_fk_key, from_date, To_Date, line_num, availability_flag, entity_type, creation_date, last_update_date, creation_system_id,
    (last_update_system_id)

    SELECT b.entity_pk_key entity_pk_key, a.shift_date shift_date, a.shift_workday_pk_key shift_workday_fk_key, a.from_date from_date, To_Date, line_num, 'Y', a.line_num a.to_date
    b.entity_type entity_type, SYSDATE-1, SYSDATE,-99999

    -IN l_site_id, l_entity_pk_key, l_entity_name, l_entity_type, l_production_entity,.
    -l_shift_workday_pk_key, l1_shift_date, l_from_date, l_to_date
    Mth_workday_shifts_d a.,
    (
    SELECT site_id plant_fk_key, entity_pk_key, entity_name, entity_type, production_entity production_entity
    OF mth.mth_equip_entities_mst
    UNION ALL
    SELECT plant_pk_key site_id, plant_pk_key entity_pk_key, plant_name entity_name, "Site", production_site production_entity
    OF mth.mth_plants_d
    UNION ALL
    SELECT plant_fk_key site_id, resource_pk_key entity_pk_key, nom_entite resource_name, "Resource", production_resource production_entity
    OF mth.mth_resources_d
    UNION ALL
    SELECT plant_fk_key site_id, equipment_pk_key entity_pk_key, equipment_name entity_name, "Equipment", production_equipment production_entity
    OF mth.mth_equipments_d
    ) b
    WHERE b.site_id = l_plant_fk_key
    AND a.plant_fk_key = l_plant_fk_key
    AND shift_date > = l_start_date
    AND shift_date < = l_end_date);

    COMMIT;
    END GENERATE_SHIFTS;

    data are not get inserted in the camera moves d table. If I use the same query off 25000 procedure lines get inserted. Can someone tell me what is the problem with him.

    Kind regards
    Amrit

    The start date you passed is changed before EXECUTION of your insert on this table

    l_start_date := l_start_date+1;
    

    Maybe she go back to the original value before the isnert

    l_start_date := l_start_date-1;
    

    See you soon!
    Bobin

  • insert into the table using the loop and permanently display

    Hello

    I am trying to insert some values of loop loop run into two tables and trying to draw using Graph XY. I need values Joanie be inserted one by one in each iteration. But at the end of the iteration in the table, I get only last value... can someone help me?

    Hello Manu,

    use a shift register to store each table. BuildArray allows to add/Add (not Insert!) of new values in the table.

    Then you need not use an ExpressVI to create the chart, a knot simple bundle (as indicated in the context-sensitive help) is enough to create a field in a XY Chart...

    Example with a table:

    Keep in mind:

    It's not (memory/CPU time) effective to use for time of data acquisition time (giving rise to large Bay). Use different approaches then...

  • insert into the table using dynamic data

    Oracle form 6i
    Hai

    I need to insert data into a table. I have generated my data text file with data in a form, now I need to insert data into a table. How can insert my field at that table if it is given in the table, I need to update, and there is no data I need to insert... Pls tell me the solution...

    Concerning

    Srikkanth.M

    Create the trigger of the sur-insert and check the data are thre or not through the value of the primary key in this trigger. If the data is thre then update or it is then do not insert in the same trigger.

    Thank you
    SUN

Maybe you are looking for