The values of cursor two corresponding and insertion into tables

I ' am using sql developer oracle 11g.

I have 3 tables called

PRODUCT_NOTIFICATION

RECORD

PCS_NOTIFICATION

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

PRODUCT_NOTIFICATION

IDTITLEMessage
21sale50% discount on all brand products

RECORD

IDREGNAMEACTIVATIONCODESTATUSMOBILENUM
747407931107TESTTHERE12345
39717371107TESTuco1THERE6789

Now, I want to take only the message of product_notification table column and

pick up the registered customer of registration table where the activationcode_status = 'Y '.

PCS_NOTIFICATION

Output of desire in the PCS_NOTIFICATION TABLE

IDMOBILENUMMessage
11234550% discount on all brand products
2678950% discount on all brand products

THEN insert the message in pcs_notification.

It is the procedure goes as...

create or replace

PROCEDURE sp_notification)

p_out_msg OUT VARCHAR2

)

AS

CURSOR C_product_notification

IS

Select the description of product_notification;

-Search for registered customer

CURSOR C_registered

IS

Select * from registration where activation_code = 'Y ';

for k C_INSERT

LOOP

THEN

BEGIN

If C_product_notification = C_registered THEN

INSERT INTO PRODUCT_CLOUD_NOTIFICATION VALUES () - stuck here

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

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

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

Goal is to send the generic message for every individual mobile numbers of registered customers.

Help, please...

Create a sequence object to fill PCS_NOTIFICATION.ID. allows you to call him PCS_NOTIFICATION_ID_SEQ.

Now all you need is a simple insert statement.

insert into pcs_notification (id, mobilenum, message)
select pcs_notification_id_seq.nextval, r.mobilenum, pn.message
  from product_notification pn
  cross join registration r
 where r.activationcodestatus = 'Y';

Tags: Database

Similar Questions

  • Add the value of point two apex and display the result in another part of the apex

    Hello

    I need to make the addition of the two item values using apex.item.text and find the result in another apex.item.text.

    For example:
    SELECT
    apex_item. Text(1,null) ONE
    apex_item. Text(2,null) TWO
    apex_item. Text(3,null) RESULT
    FROM EMP
    please suggest me

    Thank you
    Sudhir

    >
    No it does not add the two values in the column, user key to enter the value, it must add the value of the item and displays the result in a dynamic way. Need a suggestion for using javascript
    >
    This requirement was not not clear in the op.

    See the demo of Denes Kubicek.

    This topic is discussed far too often. Have you tried to Oracle Application Express (APEX) and adapting one of the many examples of LoV cascading to your situation?

    See you soon,.

    PS: Tip:
    Look for the p_item_id and p_attributes of the APEX_ITEM API parameters.
    You can call JS functions for example using p_attribute

    APEX_ITEM.TEXT(...
    p_attributes => 'onchange="doTotal(this);"', /* doTotal being your JS Function */
    ...
    

    Published by: Dominic August 16, 2012 11:52

  • Reading data from a file txt and inserting into table

    I have a text file and have uploaded data in this text file in an internal table,

    the data is normally placed online and I managed to recover most of the data, but I have problems by inserting a few conditions

    OK, well it goes like this.

    I got the right reailer id,

    Well, I have a table with all the columns in the file. Now it I'll try to throw it out as simple as I can


    Reseller 1

    column 1 column 1 column 1 column 1 column 1 column 1 column 1 column 1
    ===============
    Total 0 0 0 0 0 0 0
    -------------------------------------

    Distributor 2

    column 1 column 1 column 1 column 1 column 1 column 1 column 1 column 1
    ===============
    X 1123... .. .. .. .. ..
    234 Y... .. .. .. .. ..

    Total 23... .. .. .. .. ..

    see the problem is I have to associate the retailer number to their corresponding x and y and also not all retailers have values X and Y

    The remains of standard file format but only the values of the columns may change, but they must be inserted in the table according to the number of retailers.

    U understand what I mean...

    How about you, including both terminal number (just for the fun of it... hehe!):

    SQL> ed
    Wrote file afiedt.buf
    
      1  select retailer_no, terminal_no, retailer_name, val1, val2, val3, val4, val5, val6, val7, val8, val9, val10
      2  from (
      3        select case when retailer_no is null then lag(retailer_no, decode(val1, 'Loto', 1, 'Inst Tk', 2, 3)) over (order by line_no) else null end as retailer_no
      4              ,case when terminal_no is null then lag(terminal_no, decode(val1, 'Loto', 1, 'Inst Tk', 2, 3)) over (order by line_no) else null end as terminal_no
      5              ,case when retailer_name is null then lag(retailer_name, decode(val1, 'Loto', 1, 'Inst Tk', 2, 3)) over (order by line_no) else null end as retailer_name
      6              ,val1, val2, val3, val4, val5, val6, val7, val8, val9, val10
      7        from (
      8              select rownum as line_no
      9                    ,case when regexp_like(line, '^Retailer Number:') then regexp_replace(line, '^Retailer Number: +([0-9]+).*$', '\1') else null end as retailer_no
     10                    ,case when regexp_like(line, '^Retailer Number:') then regexp_replace(line, '^.* Terminal Number: +([0-9]+).*$', '\1') else null end as terminal_no
     11                    ,case when regexp_like(line, '^Retailer Number:') then regexp_replace(line, '^.* Retailer Name: +(.*)$', '\1') else null end as retailer_name
     12                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then trim(substr(line, 1, 15)) else null end as val1
     13                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then regexp_substr(line, '[^ ]+', 16, 1) else null end  as val2
     14                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then regexp_substr(line, '[^ ]+', 16, 2) else null end  as val3
     15                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then regexp_substr(line, '[^ ]+', 16, 3) else null end  as val4
     16                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then regexp_substr(line, '[^ ]+', 16, 4) else null end  as val5
     17                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then regexp_substr(line, '[^ ]+', 16, 5) else null end  as val6
     18                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then regexp_substr(line, '[^ ]+', 16, 6) else null end  as val7
     19                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then regexp_substr(line, '[^ ]+', 16, 7) else null end  as val8
     20                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then regexp_substr(line, '[^ ]+', 16, 8) else null end  as val9
     21                    ,case when regexp_like(line, '^( +Loto | +Inst Tk|Totals)') then regexp_substr(line, '[^ ]+', 16, 9) else null end  as val10
     22              from cdc_file
     23              where regexp_like(line, '^( +Loto | +Inst Tk |Totals|Retailer Number:)')
     24             )
     25        )
     26  where retailer_no is not null
     27* order by 1, decode(val1, 'Loto', 1, 'Inst Tk', 2, 3)
    SQL> /
    
    RETAILER_N TERMINAL_N RETAILER_NAME                  VAL1       VAL2       VAL3       VAL4       VAL5       VAL6       VAL7       VAL8       VAL9       VAL10
    ---------- ---------- ------------------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
    10000      1000006    XXXX XXXX XX Default Location  Totals     0.00       0.00       0          0.00       0          0.00       0          0.00       0
    10000      1000008    XXXX XXXX XX Default Location  Totals     0.00       0.00       0          0.00       0          0.00       0          0.00       0
    200101     20010100   XXXXXXX Popular Store          Loto       36,100.00  0.00       0          0.00       36         -5,646.00  0          0.00       0
    200101     20010100   XXXXXXX Popular Store          Inst Tk    22,000.00  0.00       0          0.00       166        -9,360.00  0          0.00       0.00
    200101     20010100   XXXXXXX Popular Store          Totals     58,100.00  0.00       0          0.00       202        -15,006.00 0          0.00       0
    200103     20010300   XX XXXXXXXX Snack              Loto       35,980.00  0.00       0          0.00       20         -3,426.00  0          0.00       0
    200103     20010300   XX XXXXXXXX Snack              Inst Tk    14,000.00  0.00       0          0.00       157        -9,180.00  0          0.00       0.00
    200103     20010300   XX XXXXXXXX Snack              Totals     49,980.00  0.00       0          0.00       177        -12,606.00 0          0.00       0
    
    8 rows selected.
    
    SQL>
    

    Published by: BluShadow on January 22, 2010 13:37
    added the retailer's name as well, but out anonymous that we dislike the actual data on the forums... ;)

  • With the help of MERGE for update and insert a table

    -Oracle 11 g
    -Windows 2008

    I'm working on a script which requires update on insertion according to requirement.

    I table_a in the Test database and table_b in a Production environment and want to sync database availability.
    I need help to place the dblink (where to put it etc.).
    Here's what I've got so far:

    / * Update the tables for the production of Test environment
    November 28, 2011
    */

    FUSION
    in prod.tbl_link P
    using (select * from test.tbl_link) T
    On(prod.tbl_link.link_id = test.tbl_link.link_id.ID)
    When matched then
    Update
    Set P.LINK_ID = T.L_LINK_ID,
    P.L_URL = T.L_URL =,
    P.L_TITLE = T.L_TITLE,
    P.L_DESCRIPTION = T.L_DESCRIPTION,
    P.ISSUE_DATE = T.L_ISSUE_DATE,
    P.PUBLICATION_DATE = T.L_PUBLICATION_DATE,
    P.LAST_MODIFIED_DATE = T.L_LAST_MODIFIED_DATE,
    P.L_ICON_NEW = T.L_ICON_NEW,
    P.L_ICON_RECENT = T.L_ICON_RECENT,
    P.L_ICON_NEW_FROM_DATE = T.L_ICON_NEW_FROM_DATE,
    P.L_ICON_NEW_TO_DATE = T.L_ICON_NEW_TO_DATE,
    P.L_ICON_RECENT_FROM_DATE = T.L_ICON_RECENT_FROM_DATE,
    P.L_ICON_RECENT_TO_DATE = T.L_ICON_RECENT_TO_DATE,
    P.ACTIVE_FLAG = T.ACTIVE_FLAG,
    P.MODIFIED_BY = T.MODIFIED_BY,
    P.MODIFIED_DATE = T.MODIFIED_DATE,
    P.CATEGORY_ID = T.CATEGORY_ID,
    P.SUBCATEGORY_ID = T.SUBCATEGORY_ID,
    P.SUBJECT_ID = T.SUBJECT_ID,
    P.STATUS_ID = T.STATUS_ID
    When not matched then
    Insert (P.LINK_ID,
    P.L_URL,
    P.L_TITLE,
    P.L_DESCRIPTION,
    P.L_ISSUE_DATE,
    P.L_PUBLICATION_DATE,
    P.L_LAST_MODIFIED_DATE,
    P.L_ICON_NEW,
    P.L_ICON_RECENT,
    P.L_ICON_NEW_FROM_DATE,
    P.L_ICON_NEW_TO_DATE,
    P.L_ICON_RECENT_FROM_DATE,
    P.L_ICON_RECENT_TO_DATE,
    P.ACTIVE_FLAG,
    P.MODIFIED_BY,
    P.MODIFIED_DATE,
    P.CATEGORY_ID,
    P.SUBCATEGORY_ID,
    P.SUBJECT_ID,
    P.STATUS_ID)
    values (T.LINK_ID,
    T.L_URL,
    T.L_TITLE,
    T.L_DESCRIPTION,
    T.L_ISSUE_DATE,
    T.L_PUBLICATION_DATE,
    T.L_LAST_MODIFIED_DATE,
    T.L_ICON_NEW,
    T.L_ICON_RECENT,
    T.L_ICON_NEW_FROM_DATE,
    T.L_ICON_NEW_TO_DATE,
    T.L_ICON_RECENT_FROM_DATE,
    T.L_ICON_RECENT_TO_DATE,
    T.ACTIVE_FLAG,
    T.MODIFIED_BY,
    T.MODIFIED_DATE,
    T.CATEGORY_ID,
    T.SUBCATEGORY_ID,
    T.SUBJECT_ID,
    T.STATUS_ID)

    You cannot update the same column that is used in the join.

    The error is been derived from here:
    on (t.status_id = s.status_id)
    

    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:556373000346392260

  • 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

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

  • My one year contract is about to expire. Can I extend the same price for two months and cancel the contract without redoing the accession of another full year?

    My one year contract is about to expire. Can I extend the same price for two months and cancel the contract without redoing the accession of another full year?

    Hello

    The plan of photography is an annual plan therefore would renew for another 12 months.

    Under the terms of subscription, an early termination fee would be applied if you have decided to cancel two months in the new contract - Adobe - General conditions of subscription

    Fill the cloud creative and plans unique app are available on a monthly basis, which can be another option - https://creative.adobe.com/plans

    Kind regards

    Bev

  • get the name of a directory file and insert it into a table

    Hello

    I have a requirement, I need to read the name of a Linux directory file and enter the file name in a variable,

    After that, I need to insert this file name in a table.

    EX: is it a file1.txt in Yearbook of the CBA, and I read that 'file name' in the v_file_name variable and I'm going to insert this file name in a table.

    Hello

    I think you've got your request of replied by Chantal.
    Shoul you have a kind of intelience in the name of the file itself so that ODI retrieves the correct file and insert into the table.

    Thank you
    Fati

  • How to get the values separated by commas of multiple records in table

    How to get the values separated by commas of multiple records in table

    for example

    name address age sex
    a 12 m e
    b hh 12 f
    BB c 13 h

    I need to get output as a, b, c from a query

    Use the query as below he works for me, change the names of tables and columns

    SELECT SUBSTR (SYS_CONNECT_BY_PATH (PROXY_EMAIL, ','), 2) csv FROM (SELECT PROXY_EMAIL, ROW_NUMBER () ON the rn (ORDER OF PROXY_EMAIL), COUNT (*) NTC (STARS_PROXY_ASSIGNMENT) WHERE EMPLID = #EMPLID) WHERE rn = cnt START WITH rn = 1 CONNECT BY rn = rn + 1 ADVANCE

  • INSERT INTO table (columns...) with table_tmp in select... ...

    Hi guru,.

    Is less than a valid SQL | Statement of PLSQL? or several instructions and what it does?

    insert into table (col1, col2, col3, col4)
    with table_tmp as
    (select ccol1, ccol2, ccol3, ccol4, ccol5, ccol6
    from table1, table2 t2 t1
    where t1.id = t2.id
    and t2.start > sysdate()
    )
    Select tcol1, tcol2, tcol3, tcol4
    of table_tmp tt1, table3 t3
    where tt1.id = tt3.id;

    I checked the SQL quick reference card and don't see anything similar to this... I wonder where I can find a better book of reference for the syntax.

    Thanks in advance
    KH

    user5885318 wrote:
    Is less than a valid SQL | Statement of PLSQL? or several instructions and what it does?

    It inserts data into the table

    insert into table (col1, col2, col3, col4)

    (ok, ignoring the fact that you can't have a table named table)

    using the select statement located below

    with table_tmp as
    (select ccol1, ccol2, ccol3, ccol4, ccol5, ccol6
    from table1, table2 t2 t1
    where t1.id = t2.id
    and t2.start > sysdate()
    )
    Select tcol1, tcol2, tcol3, tcol4
    of table_tmp tt1, table3 t3
    where tt1.id = tt3.id;

    I checked the SQL quick reference card and don't see anything similar to this... I wonder where I can find a better book of reference for the syntax.

    SQL reference documentation contains the complete syntax for Oracle SQL, so how can you find a better reference for the syntax. I think your concept to better is all simply because you are not familiar with things and don't know where to find things. SQL is a huge beast, so you cannot expect to find things very quickly in all cases, especially if you don't really know what you are looking for.

    I'm guessing you are struggling to find information about the clause "WITH"?

    It is called subquery factoring and lie under the SELECT statement in the SQL reference:

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/statements_10002.htm#i2161315

    An equivalent statement without the WITH clause (using your insert as a base statement)...

    insert into table(col1, col2, col3, col4)
    select tcol1, tcol2, tcol3, tcol4
    from (select ccol1, ccol2, ccol3, ccol4, ccol5, ccol6
          from table1 t1, table2 t2
          where t1.id=t2.id
          and t2.start > sysdate()
         ) tt1
         , table3 t3
    where tt1.id=tt3.id;
    

    The done WITH clause takes the subquery in the main query. This is useful if the same subquery is needed more than once in the main query.

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

  • 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

  • read the values of an array element and by sending a digital output to a designated channel according to the value read from the table

    Hello world

    could someone help me before I get out of my hair. Here's my problem.

    I read 3 values of an array of 3 elements i.e. 1,2,3. These values are then compared to a constant value, example if the first element of the array is 1 and it meets the comparison condition can send a digital camera of output for that channel on data acquisition

    I want to be able to send a value from a table to its corresponding comparison and then on its designated channel on the acquisition of data, the whole point of this is due to the fact the table element will not always read the value 1,2,3 for example could be 2,3,1

    Here's one the vi I have so far

    If someone could help it would be much appreciated

    all the best

    brand

    Take time to explore the many examples included with LabVIEW that cover the basics.

    -Indexing table

    -reading a spreadsheet file

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

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

Maybe you are looking for