Same question different results when insert into one table.

Hello

I have an insert statement as below.

insert into mid_table_name
Select seq.nextval key1, Field1, Field2,...)
Select Field1, Field2 b.test2 a.test1...
tab1 tab2 a and b
where a.key1 = b.key1
and...
...
)

When I run the present, it's inserting less files that actually, the subquery returns.

I noticed that

(1) when I run the subquery, illustrated below, it returns more than 60 lines of k which is what I expect.
(select Field1, Field2 b.test2 a.test1...
tab1 tab2 a and b
where a.key1 = b.key1
and...
...
)

(2) However, when I run including the outer query, showb below, it returns only about 8 k; the same is get inserted into the table.

Select seq.nextval key1, Field1, Field2,...)
Select Field1, Field2 b.test2 a.test1...
tab1 tab2 a and b
where a.key1 = b.key1
and...
...
)


Any help will be greatly appreciated.

Thank you
Prep

You can try this one.

Select seq.nextval, ff.*
Select * from)
Select Field1, Field2 b.test2 a.test1...
tab1 tab2 a and b
where a.key1 = b.key1
and...
...
)
FF

Tags: Database

Similar Questions

  • Issue when inserting into a table using sequence in Oracle 11 g Rel 2

    Hi all

    I am facing problem when I insert sequence values in my table.
    When inserting, my sequence does not begin with the beginning with the value.
    Example Script

    CREATE SEQUENCE xyz_seq
    START WITH 1
    INCREMENT BY 1
    NOMAXVALUE
    MINVALUE 1
    NOCYCLE
    NOCACHE
    ALL;

    create table abc (a number not null);

    insert into abc (xyz_seq.nextval) values;

    Select *.
    ABC;

    xyz_seq sequence of fall;

    drop table abc;

    Output

    Order of creation.
    Table created.
    1 line of creation.

    ONE
    ----------
    2
    1 selected line.
    Sequence has fallen.
    Deleted table.

    I can't understand why this is inserting value 2, when my sequence should start at 1.


    To overcome that road, I implemented a different logic.
    Example of

    CREATE SEQUENCE xyz_seq
    START WITH 1
    INCREMENT BY 1
    NOMAXVALUE
    MINVALUE 1
    NOCYCLE
    NOCACHE
    ALL;

    create table abc (a number not null);
    declare
    x number (1): = xyz_seq.nextval;
    Start


    insert into abc (x) values.
    end;
    Select *.
    ABC;

    xyz_seq sequence of fall;

    drop table abc;

    Output

    Order of creation.
    Table created.
    PL/SQL procedure successfully completed.

    ONE
    ----------
    1
    1 selected line.
    Sequence has fallen.
    Deleted table.

    However, my question remains why referring to the sequence.nextval in my insert does not return me the beginning with the value.

    Kind regards
    Rishi

    That's what says the doc ;

     If you attempt to insert a sequence value into a table that uses deferred segment creation, the first value that the sequence returns will be skipped.
    

    It ignores the value 1 and returns 2.

  • Error when inserting into a table

    Hello
    I run this insert stmt
    SQL > insert into cntct select * from CUSTSRV_ADMN.cntct_bk1;
    *
    ERROR on line 1:
    ORA-01733: virtual column not allowed here

    This is the structure of the table.

    SQL > cntct desc;
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    CNTCT_KEY NOT NULL NUMBER (10)
    CNTCT_NUM NOT NULL CHAR (12)
    SRC_SYS_DESC NOT NULL VARCHAR2 (5)
    ACTVTY_DT NOT NULL DATE
    CNTCT_TYPE_DESC NOT NULL VARCHAR2 (15)
    CNTCT_INIATR_CD NOT NULL CHAR (1)
    CNTCT_INIATR_DESC NOT NULL VARCHAR2 (10)
    CNTCT_INIATR_NAME NOT NULL VARCHAR2 (30)
    CNTCT_INIATR_PHONE_NUM VARCHAR2
    CNTCT_STUS_CD NOT NULL CHAR (1)
    CNTCT_STUS_DESC NOT NULL VARCHAR2 (10)
    CNTCT_AGE_DAYS_CNT NOT NULL NUMBER 4
    CNTCT_ELPSD_TIME_SEC_CNT NOT NULL NUMBER (10)
    CNTCT_RCVD_DT NOT NULL DATE
    CNTCT_OPEN_DT NOT NULL DATE
    CNTCT_RSLTN_DT NOT NULL DATE
    CNTCT_NEW_IND NOT NULL CHAR (1)
    HIGHST_NMIS_CD NOT NULL NUMBER (1)
    INIATNG_AGENT_KEY NOT NULL NUMBER (5)
    CLSNG_AGENT_KEY NOT NULL NUMBER (5)
    CNTCT_ID NOT NULL VARCHAR2 (20)
    IMG_NUM NOT NULL VARCHAR2 (13)
    PRVDR_NPI NOT NULL VARCHAR2 (10)
    PRVDR_TIN NOT NULL VARCHAR2 (9)
    CNTCT_OPEN_DTIME NOT NULL DATE
    CNTCT_RSLTN_DTIME NOT NULL DATE

    Please notify.

    Kind regards
    Narayan

    The table where you try to insert data, is a table or a view.

    Please check the details of the error.

    ORA-01733: virtual column not allowed here
    Cause: An attempt was made to use an INSERT, UPDATE, or DELETE statement on an expression in a view.
    Action: INSERT, update, or DELETE data in the base tables, instead of the view.

  • How to access the NextVal when inserting into the Table

    All,

    I create a type of page process: the anonymous PL/SQL block

    Source:

    Start
    insert into
    c00_reimbursement_checks
    Select
    C00_REIMBURSEMENT_CHECKS_SEQ. NEXTVAL,
    '1',
    PTP.regular_payment_date,
    DC. Paid,
    NULL,
    Pap1.person_id,
    NULL,
    Sum (DC.amount_100_pct) + Sum (DC.paid_at_80) + Sum (DC.paid_at_50),
    "Dental reimbursement plan."
    NULL,
    DC. Reference,
    NULL,
    NULL,
    DCB.batch_date,
    DC.claim_id
    Of
    hrapps.dental_claims dc,
    Apps.per_all_people_f pap,
    Apps.per_all_people_f pap1,
    hrapps.dental_claim_batch dcb,
    hrapps.dental_plans dp,
    TPP apps.per_time_periods
    where dc.plan_id =: P4_PLAN_ID
    and dc.payee <>1069
    and dc.claim_status_id = 3
    and dcb.batch_id = dc.batch_id
    and dcb.batch_date =: P4_BATCH_DATE
    and pap.person_id = dc.patient_person_id
    and dc.date_of_service between pap.effective_start_date and pap.effective_end_date
    and pap1.person_id = dc.person_id
    and dc.date_of_service between pap1.effective_start_date and pap1.effective_end_date
    and dp.plan_id = dc.plan_id
    and ptp.payroll_id = decode(dc.plan_id,1,61,67)
    and dcb.batch_date between (ptp.start_date) and (ptp.end_date)
    Group of null, '1', ptp.regular_payment_date, dc.payee, null, pap1.person_id, null, 'Dental Plan', null, dc.reference, null, null, dcb.batch_date, dc.claim_id of refund
    order of null, '1', ptp.regular_payment_date, dc.payee, null, pap1.person_id, null, 'Dental Plan', null, dc.reference, null, null, dcb.batch_date, dc.claim_id of refund;
    commit;

    End;


    I get this error:

    1 error has occurred
    ORA-06550: line 6, column 60: PL/SQL: ORA-02287: sequence number unauthorized here ORA-06550: line 3, column 1: PL/SQL: statement ignored


    How can I get access to and use the sequence of pk for my table.

    The answer surely is a trigger?

    create or replace trigger "BI_"
      before insert on 
    for each row begin if :NEW.
    is null then select .nextval into :NEW.
    from dual; end if; end;

    You need to change the SQL code to specify the columns that you insert in, but it avoids all the other faff.

    John.

  • Create a button for inserting into a table

    What I can't do, because I've never needed, is to create, in a page (where I have an interactive report), a button is clicked that once performs a simple sql (for example, an insert into a table using the values of page element).

    How can I do?

    Thank you

    Here are some of the steps:

    (1) create the button.

    (2) then right click on the name of the button and select Create Dynamic Action

    (3) give it to DA a name, click Next

    (4) on the 'when' step, event should already be "Click" and the name of the button must be filled

    (5) for the Condition, you would have a condition when you want that the display of the button.  Say, if your page elements have a certain range of values, and then display this button.  No condition means that the button is always displayed.

    (6) for the 'real Action' stage, action, select "run the Code in PL/SQL.

    [There are other ways to do this, but it's simple for me.]

    (7) in the Code PL/SQL block, enter says:

    Begin

    INSERT INTO EMP (EMPNO, ENAME, HIREDATE)

    VALUES (: P6_EMPNO, 'MARK1970',: P6_HIREDATE);

    COMMIT;

    END;   -You'd probably all the variables page element

    (8) here the part I'm not sure 100%.

    For items to submit "Page, name used in YOUR QUERY - in my example page elements, these are P6_EMPNO, P6_HIREDATE (don't note any use of & or: or here.)

    Hmm.  Start by putting nothing in "Page of elements to return.   If that fails, then try the same elements of page P6_EMPNO, it P6_HIREDATE as well.

    [I'm too lazy to go running at present].

    (9) I think that's it.

    Howard

  • Inserting into the table of the apex report log

    Hi all

    I have an interactive report with check boxes for each line, when I select a checkbox one according to the report and click the button submit that the first records of departure in the report are getting inserted into the table
    the lines that I select in the report is not getting inserted into the table.

    For example, if I select all 4 records in the box and click submit button 4 first records will be inserted into the table. Not the selected records.

    I put all the attributes attribute of standard report columns.

    Here is my code I wrote for the process to insert in the journal table.
    declare
    v_index varchar2(2000);
    begin
     
    FOR i in 1..APEX_APPLICATION.G_F21.COUNT LOOP
    --v_index := APEX_APPLICATION.G_F21(i);
    
    insert into eptlog(ptr , cat , pgroup , splptr,gisv ,
              mptr , hip , oml ,wa_type , stl_acc,last_updated_by )
    values(apex_application.g_f22(i), A-Cat,P-Group,
    'N',
    'Y',
    'N',
    'Y',
    'HIP',
    'APC',
    'N',
    apex_application.g_user);
    
    END LOOP;
    end;
    For the report query
    -------------------
    select 
    apex_item.checkbox(21,'#ROWNUM#','UNCHECKED')||APEX_ITEM.HIDDEN(22,p.cc||'-'||p.name) ptr,
    p.row_id,
    p.cc,
    c.ctrdesc,
    p.name,
    p.cat,
    ptr.onumber,
    p.c_id,
    apex_item.select_list_from_query(23,ptr.ecat, 'select catdesc,cat from ptrcatmst') cat1,
    apex_item.select_list_from_query(24,ptr.partner_group, 'select pgroup,gid from APTNRGROUP') pgroup,
    apex_item.select_list(25,p.gisv,'Y;10,N;20') iv,
    apex_item.select_list(26,p.splptr,'Y;10,N;20')  splptr,
    sum(rate)
    from aptr p
    left outer join aptr_a s on p.name = s.pname and p.cc = s.cc
    left outer join lcomp c on s.cc = c.cc
    where rate>0 and p.cat1<>'D' and s.cc ='10'
    group by rownum,p.row_id,
    p.cc,
    c.ctrydesc,
    p.name,
    p.cat,
    p.onumber,
    p.cid,
    p.cat1,
    p.pgroup,
    p.iv,
    splptr,
    order by rate desc
    Please guide me on what I need on urgent basis.

    Thank you

    Hello

    I have fixed the bothe insert and update now procs.

    Here's what I changed.

    Changed the sql report to render the rownum as the value for the column in the box.

    Edited the page processes to use the value of rownum.

    Please check and mark the correct answer

    Thank you

  • when_button_pressed, inserting into a table

    I created a button 'OK' and in the when_button_pressed, I put the code to insert into a table (X for example), the values of entries in the form (ie., main block B_MAIN). The B_MAIN block is built manually and refers to the X table above.

    The OK button is in a different block called B_ACTION.

    When I run the form and click on 'OK', nothing happens. Is no error message or another. This could be it prevents insertion of data in the table?

    Thank you
    Chiru

    Published by: Megastar_Chiru on February 17, 2009 16:23

    The B_MAIN is the database block? Check the BLOCK of DATA of DATABASE property, it must be set to NO because you entered the data manually.

    Another thing, when using the pl/sql commit it is not necessary to follow by commit_form, since he initiated commit_form built-in function.

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

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

  • Insert into a table using the check boxes

    Hello

    I want to insert into a table emp when I press a button "Insert" area of employee report. the SQL query for the report is

    SELECT HTMLDB_ITEM. CheckBox(1,rowNum) "",
    x.EmpNo,
    x.Ename
    de)
    Select empno htmldb_item.hidden(2,empno),
    htmldb_item. Text(3,Ename) ename from emp) x
    order by 2

    I created the following process:

    declare
    v_test varchar (10);
    Start
    BECAUSE me in 1.HTMLDB_APPLICATION. G_F01. COUNTY
    LOOP
    v_test: = HTMLDB_APPLICATION. G_F02 (HTMLDB_APPLICATION. G_F01 (i));
    dbms_output.put_line (v_test);
    insert into emp(empno,ename,job,mgr,hiredate,sal,comm,deptno)
    values(v_test,'A','B',10,01-May-81,200,1,10)
    WHERE empno = HTMLDB_APPLICATION. G_F02 (HTMLDB_APPLICATION. G_F01 (i));
    END LOOP;
    end;

    But IT is not working properly, infact, it gives me errors like:

    ORA-06550: line 9, column 47:
    PL/SQL: ORA-00933: SQL not correctly completed command
    ORA-06550: line 8, column 1:
    PL/SQL: SQL statement ignored

    7 dbms_output.put_line (v_test);
    8 insert into emp (empno, ename, job, mgr, hiredate, sal, comm, deptno)
    9 values(v_test,'A','B',10,01-MAY-81,200,1,10)
    10 WHERE empno = HTMLDB_APPLICATION. G_F02 (HTMLDB_APPLICATION. G_F01 (i));
    11. END OF LOOP;

    Any help?
    Additional info: table Emp is the default table in the database

    This is an example showiing how such a process must be put in place:

    http://Apex.Oracle.com/pls/OTN/f?p=31517:95

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • How to identify the name of the procedure that inserts into a table in the TRIGGER

    Hello
    There are several procedures in my DB that perform the INSERT operation on a main table - MYTAB say.

    I created a trigger on the table MYTAB, to follow closely, what procedure is insert data in there. Is there a function that captures the name of this object?

    For example: PROC_A, PROC_B, PROC_C insert into the table MYTAB. And my query is - the trigger on table MYTAB should document these object names where the lines fit.
    Please let me know your suggestions...

    SQL> create table t (no integer, dt timestamp, who_inserted varchar2(4000));
    
    Table created.
    
    SQL> create or replace procedure p
      2  as
      3  begin
      4    insert into t (no, dt) values (1, systimestamp);
      5  end;
      6  /
    
    Procedure created.
    
    SQL> show err
    No errors.
    
    SQL> create or replace trigger t_trig before insert on t for each row
      2  begin
      3     :new.who_inserted := dbms_utility.format_call_stack;
      4  end;
      5  /
    
    Trigger created.
    
    SQL> show err
    No errors.
    
    SQL> begin
      2    p;
      3  end;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from t;
    
            NO DT                             WHO_INSERTED
    ---------- ------------------------------ ----------------------------------------
             1 31-OCT-14 04.58.53.668465 AM   ----- PL/SQL Call Stack -----
                                                object      line  object
                                                handle    number  name
                                              3a7ddbea0         2  KARTHICK.T_TRIG
                                              3ac979f30         4  procedure KARTHICK.P
                                              3a822deb8         2  anonymous block
    
  • How the values to insert into the table with the command insertion

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



    Please help me its urgent

    Hello

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

    François

  • Insert into a table... with order by

    Oracle 10.2.0.3

    I want to insert into a table, records from another table ordered in a certain way. We want a specific order that we want the data grouped the disk.

    No idea why it does not work?
    create table test_a (
         id number primary key,
         value1 varchar2(20));
    
    insert into test_a (id, value1) values (1,'ccc');
    insert into test_a (id, value1) values (2,'bbb');
    insert into test_a (id, value1) values (3,'aaa');
         
    create table test_b (
         id number primary key,
         value1 varchar2(20));
    
    insert into test_b (id, value1) (select id, value1 from test_a order by value1)
                                                                   *
    ERROR at line 1:
    ORA-00907: missing right parenthesis     
    If I leave aside the order, it works fine...
    SQL> insert into test_b (id, value1) (select id, value1 from test_a);
    
    3 rows created.
    This does not work either:
    create table test_b as (select id, value1 from test_a order by value1)
                                                          *
    ERROR at line 1:
    ORA-00907: missing right parenthesis

    Lose the parenthesis.

    TUBBY_TUBBZ?create table test_b as select id, value1 from test_a order by value1;
    
    Table created.
    
    Elapsed: 00:00:00.02
    

    Or

    TUBBY_TUBBZ?
    insert into test_b select id, value1 from test_a order by value1;
    
    3 rows created.
    
    Elapsed: 00:00:00.01
    TUBBY_TUBBZ?
    
  • records by inserting into one another table

    Hi Masters

    I have to insert records from table to table b, which do not exist in table b. Please, help me in this record.

    create table test1 (eno number (2), ename varchar2 (10));

    Insert into test1 values(1,'abc');
    Insert into test1 values(2,'xyz');
    Insert into test1 values(3,'pqr');
    Insert into test1 values(4,'vara');

    create table test2 (eno number (2), ename varchar2 (10));

    Insert into test2 values(2,'xyz');
    Insert into test2 values(4,'vara');

    I tried like this...

    SQL > get the ap;
    1. INSERT ALL
    2. WHEN r_num = 1
    3 THEN IN VALUES test2 (eno, ename)
    4 OTHER INTO test2 VALUES (null, null)
    5. SELECT eno, ename
    6, ROW_NUMBER () OVER (PARTITION BY eno, ename)
    7 ORDER BY eNAME - or else
    8                             )  AS r_num
    9 * FROM test1
    SQL > /.

    4 lines were created.

    SQL > select * from test2;

    ENO ENAME
    ----- ----------
    2 xyz
    4 vara
    1 abc
    2 xyz
    3 pqr
    4 vara

    6 selected lines.

    the result above is not correct... Please advice.

    Concerning

    Evelyne

    Use MERGE:

    SQL > select * from test1;

    ENO ENAME
    ---------- ----------
    1 abc
    2 xyz
    3 pqr
    4 vara

    SQL > select * from test2;

    ENO ENAME
    ---------- ----------
    2 xyz
    4 vara

    SQL > fusion
    2 in test2
    3 using test1
    4 you (test1.eno = test2.eno and test1.ename = test2.ename)
    5 when not matched
    6. then insert
    7 values(test1.eno,test1.ename)
    8.

    2 lines merged.

    SQL > select * from test2;

    ENO ENAME
    ---------- ----------
    2 xyz
    4 vara
    3 pqr
    1 abc

    SQL >

    SY.

  • How to perform an addition of column values in an insert query that would insert in the 3rd column, and the values how to insert into another table.

    I have two tables (2) RESULT TAB (1)

    CREATE TABLE TAB

    (

    NUMBER OF SNO

    A NUMBER,

    B THE NUMBER.

    NUMBER OF THE SUM

    );

    CREATE AN ARRAY OF RESULT

    (

    NUMBER OF SNO

    NUMBER OF THE SUM

    )

    my doubt is:

    (1) I want to insert a table TAB, my question is how to insert a column to the SUM using the column A AND B... Here im adding two values of the column and store result in the AMOUNT column.

    SNO   A  SUM           

    1 100 150 250

    2 300 100 400

    I want to like this, it is possible with single insert query?


    (2) at the time of the insertion TAB of values that SNO, and the values of table TAB $ insert in the table of RESULTS... is it possible these two inserts at the same time?

    in fact, im using another this table.fro TAB and easy to understand I write like that, please solve this problem

    First, you post in the wrong forum as this one is only for Oracle's SQL developer tool. So you might ask your question in the general forum of SQL.

    Second, you might solve your problems with bind variable:

    Insert tab

    (sno, a, b, sum)

    values

    (: SNO,: A: B: A + B :))

    You should not use sum as column name because it is a reserved word.

    More you cannot insert into two different tables with a single SQL, but you can use PL/SQL to do this:

    Start

    insert into tab values (: SNO,: A: B: A + B :);)

    insert into result values (: SNO,: A + B :);)

    end;

    If you meet sno from a sequence, you could do something like this:

    Start

    insert into values tab (seq_sno.nextval,:,: B,: A +: B) return sno in: SNO.

    insert into result values (: SNO,: A + B :);)

    end;

    Hope that helps,

    dhalek

  • Maybe you are looking for