Bulk / Collection copy/paste in Workbench 3.1.2

I have a use case that would benefit from having a copy/paste function at the Collection level.  Either copy an entire collection to a new collection or select many items from within a collection to copy/paste into another collection.
I know there the copy/paste for single items but with hundreds of items, this method not viable.
Thanks

I was able to get the thesaurus working by just adding the entries in the Workbench. There was a problem with the IFCR Utility which was the reason why the Thesaurus entries were not being published to the Live Dgraphs. Once that was fixed, the thesaurus worked correctly.
But Keyword Redirects had more effort as our site was using presentation API. The keyword directs configured in the workbench are not being returned as Supplement Objects, but rather as a content XML. So we needed to handle the XML content which contains the redirect url.
If you have set up your application correctly, then you should be able to see the redirects in jspref atleast.

Similar Messages

  • Bulk collect and varrays

    Oracle 9.2.0.6
    anyway to bulk collect into a varray where the index is part what is returned by the bulk collect?
    declare
    type tv is varray(5) of int;
         tvList tv := tv(0,0,0,0,0);
    begin
    select l,v bulk collect into tvList
         from
         (select 1 as l,2 as v from dual
         union
         select 2,3 from dual);
    end;
    also tried:
    declare
    type tv is varray(5) of int;
         tvList tv := tv(0,0,0,0,0);
    begin
    select l,v bulk collect into tvList(l)
         from
         (select 1 as l,2 as v from dual
         union
         select 2,3 from dual);
    end;
    neither worked.
    Thanks

    You can't do that; bulk collect only copies into consecutive entries, indexed by an integer.
    If you use varrays, all the return values must fit in the varray's declared size. Elements are inserted starting at index 1, overwriting any existing elements.
    See http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14261/tuning.htm#sthref2213
    The workaround is to
    - bilk collect into an associative array indexed by binary/pls integer
    - after the bulk collect, copy the data into your varray
    - do this in batches using BULK COLLECT ... LIMIT ,,,
    Sounds painful, but the bulk collect can really save time on context switching between PL/SQL and SQL.
    HTH
    Regards Nigel

  • How can I share this link Tell Congress to stop bulk collection of our personal information. there is no easy way to do this other then copy the entire link

    I want to share the link and post the:
    Tell Congress:
    It’s Time to Stop Mass Surveillance
    Mass surveillance threatens people’s privacy and security online.
    Tell Congress to stop bulk collection of our personal information.
    there is no easy way to post this or forward without sending the entire page link and nobody will touch those if something like a preview doesn't show up, just looks like a bunch of unsafe links to most people, you need to have a share button on this if you really want us to share it

    Heres the link to "Take action" http://mzl.la/1CgTnKg. In the future if you want to copy links, right click the address bar, and the whole link should be selected, then click "Copy" in the menu that comes up.
    Have a great day!!
    Jon

  • How to import multiple XML files into one inDesign document without copy/paste ?

    I use InDesign CS6, and I have several XML files with the same structure. Only the data are different.
    I created  an Indesign layout with some tagged placeholder frames on merge mode, for automated layout.
    Today for each XML file I have to create a new InDesign document to import the XML. Everything works fine. Then in order to have all Indesign layouts one after the other into a single Indesign layout, I have to use the copy/paste function.
    I mean for example, copy the contents of all documents to the first one. Or add pages of other documents to the first one, then delete spaces between each page.
    So my question is the following:
    How to repeat this process without copy/paste function, knowing that the
    number of XML files could be unknown.
    Thank you very much for your answer.

    Yes, effectively I would like to catalogue the files into one collection so i can save as one PDF and Print as one.:)
    I know I could save each AI as a pdf them then merge the pdf's together in acrobat, but I have nearly 100 files so would feel more comfortable seeing them all together before print / saving.
    My concern is that if I insert them in Ai, will the file resolution reduce? and will the ai still be editable and would it update the indesign file?
    Thanks for the quick reply

  • Word crash with sharepoint document and copy-pasting image from paint

    Initially I've posted this to another forum but there the rec was to post it here as well.
    I have a very annoying issue occurring in specific circumstances (but unfortunately for me that is my daily work), it happens when a document is stored on a SharePoint server. When I copy-paste an image from ms paint into word, often I get the message 'word
    has encountered an error' but then I can continue, but every 5-10 times Word crashes completely.
    When the error (not the crash) occurs, there is this nothing-saying error message stated below. Think of it.. my ‘floppy disk’ is not full, I have 8 GB of ram and I’ve all the permissions I require. The virus scanner is Symantec Endpoint
    Protection.
    All systems are in a world-wide enterprise environment (>20.000 users) – So I guess from that side everything is configured OK.
    There is a problem saving the file.
    Usually this is because the disk or floppy disk is too small for the file or is full, RAM memory is low, or there is a permission problem with the drive the file is being saved to.
    If the amount of disk space for a paging file is low, save the file to another drive. If the RAM memory is low, increase available RAM. If permissions to the drive do not allow you to save to that drive, save the file to another drive or request
    permissions from the administrator to save files to the drive.
    Note   This error can also occur if the computer is running a version of antivirus software that is incompatible with the Microsoft Office or must be updated.

    Hi,
    What is the version of Word?
    Sometimes the Preview Pane in Windows File Explorer may conflict with Word, thus the error message appears. If you have enabled the Preview Pane in File Explorer, disable it to check the result. For example, in Windows 8.1, Open File Explorer, click
    View tab on the top -> Panes -> Click Preview Pane to enable or disable it.
    If the issue persists, I suggest you collect the event logs to find the cause of the crash:
    Press Win + R, type "eventvwr" in the blank box, press Enter to open Event Viewer. Browse to Windows Logs -> Application, check if there is any error about the crash.
    You can send the event logs to our email address and we can help analyze the problem:
    [email protected]
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Procedure failed while using bulk collect into clause and works with cursor

    hi all,
    I am using "BULK collect into" clause in my procedure and it is failing after 21 minutes and gives the error "end of file communication channel".
    after this error comes when i tried to connect database it is giving following error.
    ORA -01034 - Oracle not available.
    ORA- 27101 - shared memory realm does not exist.
    svr4- error :2 : No such file or directory.
    when i use cursor instead of BULK COLLECT INTO clause it is running successful.
    Following code is working with cursor.
    procedure work_kiosk_full(an_jobid in number ,ac_sqlcode out varchar2 ,ac_sqlerrm out varchar2) is
    ld_curr_time Date;
    cursor cur_work_kiosk is
    select distinct jt.jt_id AS jt_id,
    NVL ((ROUND ((jt_date_completed - jt_date_requested) * 24, 2)
    0
    ) AS actual_hrs_to_complete,
    NVL ((ROUND ((jt_date_responded - jt_date_requested) * 24, 2)
    0
    ) AS actual_hrs_to_respond,
    peo1.peo_name AS agent_name,
    peo1.peo_user_name AS asagent_soe_id,
    le.lglent_desc AS ap_system,
    ' ' AS assign_work_request_comment,
    DECODE (jt.jt_bill_id,
    138802, 'CLIENT BILLABLE',
    138803, 'CONTRACTED',
    138804, 'INTERNAL BILLABLE',
    NULL, ' '
    ) AS billable,
    bl.bldg_name_cc AS building, bl.bldg_id_ls AS building_id,
    DECODE (bl.bldg_active_cc,
    'Y', 'ACTIVE',
    'INACTIVE'
    ) AS building_status,
    DECODE (jt.jt_wrk_cause_id,
    141521, 'STANDARD WEAR AND TEAR',
    141522, 'NEGLIGENCE',
    141523, 'ACCIDENTAL',
    141524, 'MECHANICAL MALFUNCTION',
    141525, 'OVERSIGHT',
    141526, 'VANDAL',
    141527, 'STANDARD',
    141528, 'PROJECT WORK',
    6058229, 'TEST',
    NULL, ' '
    ) AS cause_type,
    ' ' AS comments, peo3.peo_name AS completed_by,
    jt.jt_requestor_email AS contact_email,
    jt.jt_requestor_name_first
    || ' '
    || jt.jt_requestor_name_last AS contact_name,
    jt.jt_requestor_phone AS contact_phone,
    cc.cstctrcd_apcode AS corp_code,
    cc.cstctrcd_code AS cost_center,
    jt.jt_date_closed AS date_closed,
    jt.jt_date_completed AS date_completed,
    jt.jt_date_requested AS date_requested,
    jt.jt_date_responded AS date_responded,
    jt.jt_date_response_ecd AS date_response_ecd,
    jt.jt_date_scheduled AS date_scheduled,
    DECODE (jt.jt_def_id,
    139949, 'WTG VENDOR RESPONSE',
    139950, 'WAITING ON PARTS',
    139951, 'LABOR AVAILABILITY',
    139952, 'DEFERRED- HI PRI WORK',
    139953, 'WTG APPROVAL',
    139954, 'FUNDING REQUIRED',
    139955, 'ACCESS DENIED',
    139956, 'WTG MATERIAL',
    NULL, ' '
    ) AS deferral_reason,
    jt.jt_description AS description,
    jt.jt_date_resched_ecd AS ecd,
    fmg.facility_manager AS facility_manager,
    fl.floors_text AS FLOOR, gl.genled_desc AS general_ledger,
    ' ' AS kiosk_date_requested, ' ' AS kiosk_dispatch_confirmed,
    ' ' AS kiosk_dispatched,
    eqp.equip_customer_code AS linked_equipment_alias,
    eqp.equip_id AS linked_equipment_id,
    eqp.equip_text AS linked_equipment_name,
    DECODE (jt_originator_type_id,
    1000, 'PROJECT MOVE REQUEST',
    138834, 'CUSTOMER INITIATED CORRECTION',
    138835, 'CUSTOMER INITIATED REQUEST',
    138836, 'CORRECTIVE MAINTENANCE',
    138837, 'CONFERENCE ROOM BOOKING',
    138838, 'PROJECT INITIATED REQUEST',
    138839, 'PLANNED PREVENTIVE MAINTENANCE',
    138840, 'SELF INITATED REQUEST',
    NULL, ' '
    ) AS originator_type,
    ' ' AS payment_terms, priority_text AS priority_code,
    swoty.sworktype_text AS problem_type,
    prop.property_name_cc AS property,
    jt.jt_cost_quote_total AS quote_total,
    par.levels_name AS region,
    DECODE (jt.jt_repdef_id,
    141534, 'ADJUSTED SETTING',
    141535, 'TRAINING FOR END',
    141536, 'NEW REQUEST',
    141537, 'NO REPAIR REQUIR',
    141538, 'REPLACED PARTS',
    141539, 'REPLACE EQUIPMEN',
    1000699, 'NEW REQUEST',
    NULL, ' '
    ) AS repair_definitions,
    jt.jt_repairdesc AS repair_description,
    jt.jt_requestor AS requestor, ' ' AS requestor_cost_center,
    jt.jt_requestor_email AS requestor_email,
    jt.jt_requestor_name_first AS requestor_name,
    jt.jt_requestor_phone AS requestor_phone,
    ' ' AS response_time, rm.room_name_cc AS room,
    p1.peo_provider_code1 AS service_provider,
    p1.peo_address_1 AS service_provider_address,
    peocity.city_text service_provider_city,
    p1.peo_provider_code1 AS service_provider_code,
    peocity.city_country_name AS service_provider_country,
    peocur.currency_text AS service_provider_currency,
    p1.peo_name AS service_provider_description,
    p1.peo_dispatch_method AS serv_prov_dispatc_hmethod,
    p1.peo_rate_double AS serv_prov_double_time_rate,
    p1.peo_email AS service_provider_email,
    p1.peo_emergency_phone AS serv_prov_emergency_phone,
    p1.peo_fax AS service_provider_fax_number,
    p1.peo_home_phone AS service_provider_home_phone,
    p1.peo_rate_hourly AS service_provider_hourly_rate,
    p1.peo_title AS service_provider_job_title,
    p1.peo_method_id AS service_provider_method,
    p1.peo_cell_phone AS service_provider_mobile_phone,
    p1.peo_pager AS service_provider_pager,
    p1.peo_rate_differential AS service_provider_rates,
    p1.peo_rate_differential AS ser_prov_shift_differential,
    peocity.city_state_prov_text AS serv_prov_state_province,
    DECODE (p1.peo_active,
    'Y', 'ACTIVE',
    'INACTIVE'
    ) AS service_provider_status,
    p1.peo_url AS serv_prov_web_site_address,
    p1.peo_phone AS service_provider_work_phone,
    p1.peo_postal_code AS serv_prov_zip_postal_code, ' ' AS shift,
    ' ' AS skill,
    DECODE (jt.jt_bigstatus_id,
    138813, 'NEW',
    138814, 'PENDING',
    138815, 'OPEN',
    138816, 'COMPLETED',
    138817, 'CLOSED',
    138818, 'CANCELLED',
    NULL, ' '
    ) AS status,
    lev.levels_name AS subregion, ' ' AS trade,
    p1.peo_ls_interface_code1 AS vendor_id,
    p1.peo_fax AS vendor_purchasing_fax,
    p1.peo_vendor_site_code AS vendor_sitecode,
    jt.jt_id AS vendor_ticket, p1.peo_name AS vendor_companyname,
    jt.jt_requestor_vip AS vip, wo.wo_id AS work_order_no,
    jt.jt_id AS work_request,
    jt.jt_class_id AS work_request_class,
    woty.worktype_text AS work_type, ' ' AS wr_cost,
    jt.jt_description AS wr_description,
    ' ' AS wr_dispatch_method,
    DECODE (jt.jt_bigstatus_id,
    138813, 'NEW',
    138814, 'PENDING',
    138815, 'OPEN',
    138816, 'COMPLETED',
    138817, 'CLOSED',
    138818, 'CANCELLED',
    NULL, ' '
    ) AS wr_status,
    ctry.country_name AS country
    FROM citi.jobticket jt,
    citi.property prop,
    citi.bldg bl,
    citi.bldg_levels bldglvl,
    citi.LEVELS lev,
    citi.LEVELS par,
    (SELECT crstools.stragg (peo_name) facility_manager,
    bldgcon_bldg_id
    FROM citi.bldg_contacts, citi.people
    WHERE bldgcon_peo_id = peo_id
    AND bldgcon_contype_id IN (40181, 10142)
    GROUP BY bldgcon_bldg_id) fmg,
    citi.floors fl,
    citi.room rm,
    citi.general_ledger gl,
    citi.legal_entity le,
    citi.cost_center_codes cc,
    citi.equipment eqp,
    citi.worktype woty,
    citi.subworktype swoty,
    citi.work_order wo,
    citi.jt_workers jtwo,
    citi.priority,
    citi.country ctry,
    citi.people p1,
    citi.people peo3,
    citi.people peo1,
    citi.city peocity,
    citi.currency peocur
    WHERE jt.jt_bldg_id = bl.bldg_id
    AND bl.bldg_id = bldglvl.bldg_levels_bldg_id
    AND bldglvl.bldg_levels_levels_id = lev.levels_id
    AND lev.levels_parent = par.levels_id(+)
    AND prop.property_id = bl.bldg_property_id
    AND bl.bldg_active_ls <> 'N'
    AND jt.jt_floors_id = fl.floors_id(+)
    AND jt.jt_room_id = rm.room_id(+)
    AND jt.jt_bldg_id = fmg.bldgcon_bldg_id(+)
    AND jt.jt_genled_id = gl.genled_id(+)
    AND gl.genled_lglent_id = le.lglent_id(+)
    AND jt.jt_cstctrcd_id = cc.cstctrcd_id(+)
    AND jt.jt_equip_id = eqp.equip_id(+)
    AND jt.jt_id = jtwo.jtw_jt_id(+)
    AND jt.jt_worktype_id = woty.worktype_id(+)
    AND jt.jt_sworktype_id = swoty.sworktype_id(+)
    AND jt.jt_wo_id = wo.wo_id
    AND jt.jt_priority_id = priority_id(+)
    --AND jt.jt_date_requested >= ADD_MONTHS (SYSDATE, -12)
    AND jt.jt_last_update >= ADD_MONTHS (ld_curr_time, -12)
    AND bl.bldg_country_id = ctry.country_id
    AND jtwo.jtw_peo_id = p1.peo_id(+)
    AND p1.peo_city_id = peocity.city_id(+)
    AND jt.jt_completed_by_peo_id = peo3.peo_id(+)
    AND p1.peo_rate_currency_id = peocur.currency_id(+)
    AND jt.jt_agent_peo_id = peo1.peo_id(+);
    BEGIN
    execute immediate 'truncate table crstools.drt_bom_work_kiosk';
    select sysdate into ld_curr_time from dual;
    FOR cur_rec in cur_work_kiosk LOOP
    IF MOD(cur_work_kiosk%rowcount,10000 ) = 0 then
    COMMIT;
    END IF;
    INSERT INTO crstools.drt_bom_work_kiosk
    ( JT_ID
    ,ACTUAL_HRS_TO_COMPLETE
    ,ACTUAL_HRS_TO_RESPOND
    ,AGENT_NAME
    ,ASAGENT_SOE_ID
    ,AP_SYSTEM
    ,ASSIGN_WORK_REQUEST_COMMENT
    ,BILLABLE
    ,BUILDING
    ,BUILDING_ID
    ,BUILDING_STATUS
    ,CAUSE_TYPE
    ,COMMENTS
    ,COMPLETED_BY
    ,CONTACT_EMAIL
    ,CONTACT_NAME
    ,CONTACT_PHONE
    ,CORP_CODE
    ,COST_CENTER
    ,DATE_CLOSED
    ,DATE_COMPLETED
    ,DATE_REQUESTED
    ,DATE_RESPONDED
    ,DATE_RESPONSE_ECD
    ,DATE_SCHEDULED
    ,DEFERRAL_REASON
    ,DESCRIPTION
    ,ECD
    ,FACILITY_MANAGER
    ,FLOOR
    ,GENERAL_LEDGER
    ,KIOSK_DATE_REQUESTED
    ,KIOSK_DISPATCH_CONFIRMED
    ,KIOSK_DISPATCHED
    ,LINKED_EQUIPMENT_ALIAS
    ,LINKED_EQUIPMENT_ID
    ,LINKED_EQUIPMENT_NAME
    ,ORIGINATOR_TYPE
    ,PAYMENT_TERMS
    ,PRIORITY_CODE
    ,PROBLEM_TYPE
    ,PROPERTY
    ,QUOTE_TOTAL
    ,REGION
    ,REPAIR_DEFINITIONS
    ,REPAIR_DESCRIPTION
    ,REQUESTOR
    ,REQUESTOR_COST_CENTER
    ,REQUESTOR_EMAIL
    ,REQUESTOR_NAME
    ,REQUESTOR_PHONE
    ,RESPONSE_TIME
    ,ROOM
    ,SERVICE_PROVIDER
    ,SERVICE_PROVIDER_ADDRESS
    ,SERVICE_PROVIDER_CITY
    ,SERVICE_PROVIDER_CODE
    ,SERVICE_PROVIDER_COUNTRY
    ,SERVICE_PROVIDER_CURRENCY
    ,SERVICE_PROVIDER_DESCRIPTION
    ,SERV_PROV_DISPATC_HMETHOD
    ,SERV_PROV_DOUBLE_TIME_RATE
    ,SERVICE_PROVIDER_EMAIL
    ,SERV_PROV_EMERGENCY_PHONE
    ,SERVICE_PROVIDER_FAX_NUMBER
    ,SERVICE_PROVIDER_HOME_PHONE
    ,SERVICE_PROVIDER_HOURLY_RATE
    ,SERVICE_PROVIDER_JOB_TITLE
    ,SERVICE_PROVIDER_METHOD
    ,SERVICE_PROVIDER_MOBILE_PHONE
    ,SERVICE_PROVIDER_PAGER
    ,SERVICE_PROVIDER_RATES
    ,SER_PROV_SHIFT_DIFFERENTIAL
    ,SERV_PROV_STATE_PROVINCE
    ,SERVICE_PROVIDER_STATUS
    ,SERV_PROV_WEB_SITE_ADDRESS
    ,SERVICE_PROVIDER_WORK_PHONE
    ,SERV_PROV_ZIP_POSTAL_CODE
    ,SHIFT
    ,SKILL
    ,STATUS
    ,SUBREGION
    ,TRADE
    ,VENDOR_ID
    ,VENDOR_PURCHASING_FAX
    ,VENDOR_SITECODE
    ,VENDOR_TICKET
    ,VENDOR_COMPANYNAME
    ,VIP
    ,WORK_ORDER_NO
    ,WORK_REQUEST
    ,WORK_REQUEST_CLASS
    ,WORK_TYPE
    ,WR_COST
    ,WR_DESCRIPTION
    ,WR_DISPATCH_METHOD
    ,WR_STATUS
    ,COUNTRY
    ,CREATE_DATE
    VALUES
    (cur_rec.jt_id
    ,cur_rec.ACTUAL_HRS_TO_COMPLETE
    ,cur_rec.ACTUAL_HRS_TO_RESPOND
    ,cur_rec.AGENT_NAME
    ,cur_rec.ASAGENT_SOE_ID
    ,cur_rec.AP_SYSTEM
    ,cur_rec.ASSIGN_WORK_REQUEST_COMMENT
    ,cur_rec.BILLABLE
    ,cur_rec.BUILDING
    ,cur_rec.BUILDING_ID
    ,cur_rec.BUILDING_STATUS
    ,cur_rec.CAUSE_TYPE
    ,cur_rec.COMMENTS
    ,cur_rec.COMPLETED_BY
    ,cur_rec.CONTACT_EMAIL
    ,cur_rec.CONTACT_NAME
    ,cur_rec.CONTACT_PHONE
    ,cur_rec.CORP_CODE
    ,cur_rec.COST_CENTER
    ,cur_rec.DATE_CLOSED
    ,cur_rec.DATE_COMPLETED
    ,cur_rec.DATE_REQUESTED
    ,cur_rec.DATE_RESPONDED
    ,cur_rec.DATE_RESPONSE_ECD
    ,cur_rec.DATE_SCHEDULED
    ,cur_rec.DEFERRAL_REASON
    ,cur_rec.DESCRIPTION
    ,cur_rec.ECD
    ,cur_rec.FACILITY_MANAGER
    ,cur_rec.FLOOR
    ,cur_rec.GENERAL_LEDGER
    ,cur_rec.KIOSK_DATE_REQUESTED
    ,cur_rec.KIOSK_DISPATCH_CONFIRMED
    ,cur_rec.KIOSK_DISPATCHED
    ,cur_rec.LINKED_EQUIPMENT_ALIAS
    ,cur_rec.LINKED_EQUIPMENT_ID
    ,cur_rec.LINKED_EQUIPMENT_NAME
    ,cur_rec.ORIGINATOR_TYPE
    ,cur_rec.PAYMENT_TERMS
    ,cur_rec.PRIORITY_CODE
    ,cur_rec.PROBLEM_TYPE
    ,cur_rec.PROPERTY
    ,cur_rec.QUOTE_TOTAL
    ,cur_rec.REGION
    ,cur_rec.REPAIR_DEFINITIONS
    ,cur_rec.REPAIR_DESCRIPTION
    ,cur_rec.REQUESTOR
    ,cur_rec.REQUESTOR_COST_CENTER
    ,cur_rec.REQUESTOR_EMAIL
    ,cur_rec.REQUESTOR_NAME
    ,cur_rec.REQUESTOR_PHONE
    ,cur_rec.RESPONSE_TIME
    ,cur_rec.ROOM
    ,cur_rec.SERVICE_PROVIDER
    ,cur_rec.SERVICE_PROVIDER_ADDRESS
    ,cur_rec.SERVICE_PROVIDER_CITY
    ,cur_rec.SERVICE_PROVIDER_CODE
    ,cur_rec.SERVICE_PROVIDER_COUNTRY
    ,cur_rec.SERVICE_PROVIDER_CURRENCY
    ,cur_rec.SERVICE_PROVIDER_DESCRIPTION
    ,cur_rec.SERV_PROV_DISPATC_HMETHOD
    ,cur_rec.SERV_PROV_DOUBLE_TIME_RATE
    ,cur_rec.SERVICE_PROVIDER_EMAIL
    ,cur_rec.SERV_PROV_EMERGENCY_PHONE
    ,cur_rec.SERVICE_PROVIDER_FAX_NUMBER
    ,cur_rec.SERVICE_PROVIDER_HOME_PHONE
    ,cur_rec.SERVICE_PROVIDER_HOURLY_RATE
    ,cur_rec.SERVICE_PROVIDER_JOB_TITLE
    ,cur_rec.SERVICE_PROVIDER_METHOD
    ,cur_rec.SERVICE_PROVIDER_MOBILE_PHONE
    ,cur_rec.SERVICE_PROVIDER_PAGER
    ,cur_rec.SERVICE_PROVIDER_RATES
    ,cur_rec.SER_PROV_SHIFT_DIFFERENTIAL
    ,cur_rec.SERV_PROV_STATE_PROVINCE
    ,cur_rec.SERVICE_PROVIDER_STATUS
    ,cur_rec.SERV_PROV_WEB_SITE_ADDRESS
    ,cur_rec.SERVICE_PROVIDER_WORK_PHONE
    ,cur_rec.SERV_PROV_ZIP_POSTAL_CODE
    ,cur_rec.SHIFT
    ,cur_rec.SKILL
    ,cur_rec.STATUS
    ,cur_rec.SUBREGION
    ,cur_rec.TRADE
    ,cur_rec.VENDOR_ID
    ,cur_rec.VENDOR_PURCHASING_FAX
    ,cur_rec.VENDOR_SITECODE
    ,cur_rec.VENDOR_TICKET
    ,cur_rec.VENDOR_COMPANYNAME
    ,cur_rec.VIP
    ,cur_rec.WORK_ORDER_NO
    ,cur_rec.WORK_REQUEST
    ,cur_rec.WORK_REQUEST_CLASS
    ,cur_rec.WORK_TYPE
    ,cur_rec.WR_COST
    ,cur_rec.WR_DESCRIPTION
    ,cur_rec.WR_DISPATCH_METHOD
    ,cur_rec.WR_STATUS
    ,cur_rec.COUNTRY
    ,ld_curr_time
    END LOOP;
    COMMIT;
    exception
    when others then
    rollback;
    dbms_output.put_line('SQLCODE :'||sqlcode ||' Error :'||sqlerrm);
    end work_kiosk_full;
    Note : total record inserted 849000.
    The same code does not work with bulk collect into caluse.
    Please help me out why this is happening.
    Thanks & regards
    shyam~

    Shyam,
    I agree with Billy.
    Why are you not using an INSERT..SELECT ?
    Also, what are you trying to achieve by
    - incremental commits?
    - copying data from one table to another (using expensive I/O)?
    - using dynamic DML?
    Most of these approaches are typically wrong - and not recommended for scalable and performant Oracle applications.I could see you using a CURSOR FOR LOOP if you were changing the data being inserted in such a way that you couldn't encapsulate the changes in a query, but you are doing a straight insert into the table from your Cursor. A much more efficient way would be to use the following modifications I made to your code example:
    PROCEDURE WORK_KIOSK_FULL(AN_JOBID   IN NUMBER,
                              AC_SQLCODE OUT VARCHAR2,
                              AC_SQLERRM OUT VARCHAR2) IS
    BEGIN
       EXECUTE IMMEDIATE 'truncate table crstools.drt_bom_work_kiosk';
       /* Note:  The APPEND hint forces a Direct Path INSERT (see Link below code sample) and is combined with the NOLOGGING Hint */
       /*        To dramtically increase performance.  The Direct Path INSERT inserts records above the High-Water Mark on the table. */
       INSERT /*+ APPEND NOLOGGING */ INTO CRSTOOLS.DRT_BOM_WORK_KIOSK
          (JT_ID
          ,ACTUAL_HRS_TO_COMPLETE
          ,ACTUAL_HRS_TO_RESPOND
          ,AGENT_NAME
          ,ASAGENT_SOE_ID
          ,AP_SYSTEM
    --      ,ASSIGN_WORK_REQUEST_COMMENT     /* I commented out this COLUMN because it doesn't make sense to me to insert */
          ,BILLABLE                          /* a couple of space characters into a table.   If the intent is to leave the column NULL */
          ,BUILDING                          /* don't include it in your INSERT statement and it will be NULL.  If there is a valid reason */
          ,BUILDING_ID                       /* for inserting the spaces, then remove the "line comments" from the insert and select statments */
          ,BUILDING_STATUS
          ,CAUSE_TYPE
    --      ,COMMENTS
          ,COMPLETED_BY
          ,CONTACT_EMAIL
          ,CONTACT_NAME
          ,CONTACT_PHONE
          ,CORP_CODE
          ,COST_CENTER
          ,DATE_CLOSED
          ,DATE_COMPLETED
          ,DATE_REQUESTED
          ,DATE_RESPONDED
          ,DATE_RESPONSE_ECD
          ,DATE_SCHEDULED
          ,DEFERRAL_REASON
          ,DESCRIPTION
          ,ECD
          ,FACILITY_MANAGER
          ,FLOOR
          ,GENERAL_LEDGER
    --      ,KIOSK_DATE_REQUESTED
    --      ,KIOSK_DISPATCH_CONFIRMED
    --      ,KIOSK_DISPATCHED
          ,LINKED_EQUIPMENT_ALIAS
          ,LINKED_EQUIPMENT_ID
          ,LINKED_EQUIPMENT_NAME
          ,ORIGINATOR_TYPE
    --      ,PAYMENT_TERMS
          ,PRIORITY_CODE
          ,PROBLEM_TYPE
          ,PROPERTY
          ,QUOTE_TOTAL
          ,REGION
          ,REPAIR_DEFINITIONS
          ,REPAIR_DESCRIPTION
          ,REQUESTOR
    --      ,REQUESTOR_COST_CENTER
          ,REQUESTOR_EMAIL
          ,REQUESTOR_NAME
          ,REQUESTOR_PHONE
    --      ,RESPONSE_TIME
          ,ROOM
          ,SERVICE_PROVIDER
          ,SERVICE_PROVIDER_ADDRESS
          ,SERVICE_PROVIDER_CITY
          ,SERVICE_PROVIDER_CODE
          ,SERVICE_PROVIDER_COUNTRY
          ,SERVICE_PROVIDER_CURRENCY
          ,SERVICE_PROVIDER_DESCRIPTION
          ,SERV_PROV_DISPATC_HMETHOD
          ,SERV_PROV_DOUBLE_TIME_RATE
          ,SERVICE_PROVIDER_EMAIL
          ,SERV_PROV_EMERGENCY_PHONE
          ,SERVICE_PROVIDER_FAX_NUMBER
          ,SERVICE_PROVIDER_HOME_PHONE
          ,SERVICE_PROVIDER_HOURLY_RATE
          ,SERVICE_PROVIDER_JOB_TITLE
          ,SERVICE_PROVIDER_METHOD
          ,SERVICE_PROVIDER_MOBILE_PHONE
          ,SERVICE_PROVIDER_PAGER
          ,SERVICE_PROVIDER_RATES
          ,SER_PROV_SHIFT_DIFFERENTIAL
          ,SERV_PROV_STATE_PROVINCE
          ,SERVICE_PROVIDER_STATUS
          ,SERV_PROV_WEB_SITE_ADDRESS
          ,SERVICE_PROVIDER_WORK_PHONE
          ,SERV_PROV_ZIP_POSTAL_CODE
    --      ,SHIFT
    --      ,SKILL
          ,STATUS
          ,SUBREGION
    --      ,TRADE
          ,VENDOR_ID
          ,VENDOR_PURCHASING_FAX
          ,VENDOR_SITECODE
          ,VENDOR_TICKET
          ,VENDOR_COMPANYNAME
          ,VIP
          ,WORK_ORDER_NO
          ,WORK_REQUEST
          ,WORK_REQUEST_CLASS
          ,WORK_TYPE
    --      ,WR_COST
          ,WR_DESCRIPTION
    --      ,WR_DISPATCH_METHOD
          ,WR_STATUS
          ,COUNTRY
          ,CREATE_DATE
       VALUES
          (SELECT DISTINCT
              JT.JT_ID AS JT_ID
             ,NVL((ROUND((JT_DATE_COMPLETED - JT_DATE_REQUESTED) * 24,2)),0) AS ACTUAL_HRS_TO_COMPLETE
             ,NVL((ROUND((JT_DATE_RESPONDED - JT_DATE_REQUESTED) * 24,2)),0) AS ACTUAL_HRS_TO_RESPOND
             ,PEO1.PEO_NAME AS AGENT_NAME
             ,PEO1.PEO_USER_NAME AS ASAGENT_SOE_ID
             ,LE.LGLENT_DESC AS AP_SYSTEM
    --         ,' ' AS ASSIGN_WORK_REQUEST_COMMENT
             ,DECODE(JT.JT_BILL_ID,138802,'CLIENT BILLABLE'
                                  ,138803,'CONTRACTED'
                                  ,138804,'INTERNAL BILLABLE',NULL,' ') AS BILLABLE
             ,BL.BLDG_NAME_CC AS BUILDING
             ,BL.BLDG_ID_LS AS BUILDING_ID
             ,DECODE(BL.BLDG_ACTIVE_CC, 'Y', 'ACTIVE', 'INACTIVE') AS BUILDING_STATUS
             ,DECODE(JT.JT_WRK_CAUSE_ID,141521,'STANDARD WEAR AND TEAR'
                                       ,141522,'NEGLIGENCE'
                                       ,141523,'ACCIDENTAL'
                                       ,141524,'MECHANICAL MALFUNCTION'
                                       ,141525,'OVERSIGHT'
                                       ,141526,'VANDAL'
                                       ,141527,'STANDARD'
                                       ,141528,'PROJECT WORK'
                                       ,6058229,'TEST',NULL,' ') AS CAUSE_TYPE
    --         ,' ' AS COMMENTS
             ,PEO3.PEO_NAME AS COMPLETED_BY
             ,JT.JT_REQUESTOR_EMAIL AS CONTACT_EMAIL
             ,JT.JT_REQUESTOR_NAME_FIRST || ' ' ||JT.JT_REQUESTOR_NAME_LAST AS CONTACT_NAME
             ,JT.JT_REQUESTOR_PHONE AS CONTACT_PHONE
             ,CC.CSTCTRCD_APCODE AS CORP_CODE
             ,CC.CSTCTRCD_CODE AS COST_CENTER
             ,JT.JT_DATE_CLOSED AS DATE_CLOSED
             ,JT.JT_DATE_COMPLETED AS DATE_COMPLETED
             ,JT.JT_DATE_REQUESTED AS DATE_REQUESTED
             ,JT.JT_DATE_RESPONDED AS DATE_RESPONDED
             ,JT.JT_DATE_RESPONSE_ECD AS DATE_RESPONSE_ECD
             ,JT.JT_DATE_SCHEDULED AS DATE_SCHEDULED
             ,DECODE(JT.JT_DEF_ID,139949,'WTG VENDOR RESPONSE'
                                 ,139950,'WAITING ON PARTS'
                                 ,139951,'LABOR AVAILABILITY'
                                 ,139952,'DEFERRED- HI PRI WORK'
                                 ,139953,'WTG APPROVAL'
                                 ,139954,'FUNDING REQUIRED'
                                 ,139955,'ACCESS DENIED'
                                 ,139956,'WTG MATERIAL',NULL,' ') AS DEFERRAL_REASON
             ,JT.JT_DESCRIPTION AS DESCRIPTION
             ,JT.JT_DATE_RESCHED_ECD AS ECD
             ,FMG.FACILITY_MANAGER AS FACILITY_MANAGER
             ,FL.FLOORS_TEXT AS FLOOR
             ,GL.GENLED_DESC AS GENERAL_LEDGER
    --         ,' ' AS KIOSK_DATE_REQUESTED
    --         ,' ' AS KIOSK_DISPATCH_CONFIRMED
    --         ,' ' AS KIOSK_DISPATCHED
             ,EQP.EQUIP_CUSTOMER_CODE AS LINKED_EQUIPMENT_ALIAS
             ,EQP.EQUIP_ID AS LINKED_EQUIPMENT_ID
             ,EQP.EQUIP_TEXT AS LINKED_EQUIPMENT_NAME
             ,DECODE(JT_ORIGINATOR_TYPE_ID,1000,'PROJECT MOVE REQUEST'
                                          ,138834,'CUSTOMER INITIATED CORRECTION'
                                          ,138835,'CUSTOMER INITIATED REQUEST'
                                          ,138836,'CORRECTIVE MAINTENANCE'
                                          ,138837,'CONFERENCE ROOM BOOKING'
                                          ,138838,'PROJECT INITIATED REQUEST'
                                          ,138839,'PLANNED PREVENTIVE MAINTENANCE'
                                          ,138840,'SELF INITATED REQUEST',NULL,' ') AS ORIGINATOR_TYPE
    --         ,' ' AS PAYMENT_TERMS
             ,PRIORITY_TEXT AS PRIORITY_CODE
             ,SWOTY.SWORKTYPE_TEXT AS PROBLEM_TYPE
             ,PROP.PROPERTY_NAME_CC AS PROPERTY
             ,JT.JT_COST_QUOTE_TOTAL AS QUOTE_TOTAL
             ,PAR.LEVELS_NAME AS REGION
             ,DECODE(JT.JT_REPDEF_ID,141534,'ADJUSTED SETTING'
                                    ,141535,'TRAINING FOR END'
                                    ,141536,'NEW REQUEST'
                                    ,141537,'NO REPAIR REQUIR'
                                    ,141538,'REPLACED PARTS'
                                    ,141539,'REPLACE EQUIPMEN'
                                    ,1000699,'NEW REQUEST',NULL,' ') AS REPAIR_DEFINITIONS
             ,JT.JT_REPAIRDESC AS REPAIR_DESCRIPTION
             ,JT.JT_REQUESTOR AS REQUESTOR
    --         ,' ' AS REQUESTOR_COST_CENTER
             ,JT.JT_REQUESTOR_EMAIL AS REQUESTOR_EMAIL
             ,JT.JT_REQUESTOR_NAME_FIRST AS REQUESTOR_NAME
             ,JT.JT_REQUESTOR_PHONE AS REQUESTOR_PHONE
    --         ,' ' AS RESPONSE_TIME
             ,RM.ROOM_NAME_CC AS ROOM
             ,P1.PEO_PROVIDER_CODE1 AS SERVICE_PROVIDER
             ,P1.PEO_ADDRESS_1 AS SERVICE_PROVIDER_ADDRESS
             ,PEOCITY.CITY_TEXT SERVICE_PROVIDER_CITY
             ,P1.PEO_PROVIDER_CODE1 AS SERVICE_PROVIDER_CODE
             ,PEOCITY.CITY_COUNTRY_NAME AS SERVICE_PROVIDER_COUNTRY
             ,PEOCUR.CURRENCY_TEXT AS SERVICE_PROVIDER_CURRENCY
             ,P1.PEO_NAME AS SERVICE_PROVIDER_DESCRIPTION
             ,P1.PEO_DISPATCH_METHOD AS SERV_PROV_DISPATC_HMETHOD
             ,P1.PEO_RATE_DOUBLE AS SERV_PROV_DOUBLE_TIME_RATE
             ,P1.PEO_EMAIL AS SERVICE_PROVIDER_EMAIL
             ,P1.PEO_EMERGENCY_PHONE AS SERV_PROV_EMERGENCY_PHONE
             ,P1.PEO_FAX AS SERVICE_PROVIDER_FAX_NUMBER
             ,P1.PEO_HOME_PHONE AS SERVICE_PROVIDER_HOME_PHONE
             ,P1.PEO_RATE_HOURLY AS SERVICE_PROVIDER_HOURLY_RATE
             ,P1.PEO_TITLE AS SERVICE_PROVIDER_JOB_TITLE
             ,P1.PEO_METHOD_ID AS SERVICE_PROVIDER_METHOD
             ,P1.PEO_CELL_PHONE AS SERVICE_PROVIDER_MOBILE_PHONE
             ,P1.PEO_PAGER AS SERVICE_PROVIDER_PAGER
             ,P1.PEO_RATE_DIFFERENTIAL AS SERVICE_PROVIDER_RATES
             ,P1.PEO_RATE_DIFFERENTIAL AS SER_PROV_SHIFT_DIFFERENTIAL
             ,PEOCITY.CITY_STATE_PROV_TEXT AS SERV_PROV_STATE_PROVINCE
             ,DECODE(P1.PEO_ACTIVE, 'Y', 'ACTIVE', 'INACTIVE') AS SERVICE_PROVIDER_STATUS
             ,P1.PEO_URL AS SERV_PROV_WEB_SITE_ADDRESS
             ,P1.PEO_PHONE AS SERVICE_PROVIDER_WORK_PHONE
             ,P1.PEO_POSTAL_CODE AS SERV_PROV_ZIP_POSTAL_CODE
    --         ,' ' AS SHIFT
    --         ,' ' AS SKILL
             ,DECODE(JT.JT_BIGSTATUS_ID,138813,'NEW'
                                       ,138814,'PENDING'
                                       ,138815,'OPEN'
                                       ,138816,'COMPLETED'
                                       ,138817,'CLOSED'
                                       ,138818,'CANCELLED',NULL,' ') AS STATUS
             ,LEV.LEVELS_NAME AS SUBREGION
    --         ,' ' AS TRADE
             ,P1.PEO_LS_INTERFACE_CODE1 AS VENDOR_ID
             ,P1.PEO_FAX AS VENDOR_PURCHASING_FAX
             ,P1.PEO_VENDOR_SITE_CODE AS VENDOR_SITECODE
             ,JT.JT_ID AS VENDOR_TICKET
             ,P1.PEO_NAME AS VENDOR_COMPANYNAME
             ,JT.JT_REQUESTOR_VIP AS VIP
             ,WO.WO_ID AS WORK_ORDER_NO
             ,JT.JT_ID AS WORK_REQUEST
             ,JT.JT_CLASS_ID AS WORK_REQUEST_CLASS
             ,WOTY.WORKTYPE_TEXT AS WORK_TYPE
    --         ,' ' AS WR_COST
             ,JT.JT_DESCRIPTION AS WR_DESCRIPTION
    --         ,' ' AS WR_DISPATCH_METHOD
             ,DECODE(JT.JT_BIGSTATUS_ID,138813,'NEW'
                                       ,138814,'PENDING'
                                       ,138815,'OPEN'
                                       ,138816,'COMPLETED'
                                       ,138817,'CLOSED'
                                       ,138818,'CANCELLED',NULL,' ') AS WR_STATUS
             ,CTRY.COUNTRY_NAME AS COUNTRY
             ,SYSDATE --LD_CURR_TIME
         FROM CITI.JOBTICKET JT,
              CITI.PROPERTY PROP,
              CITI.BLDG BL,
              CITI.BLDG_LEVELS BLDGLVL,
              CITI.LEVELS LEV,
              CITI.LEVELS PAR,
              (SELECT CRSTOOLS.STRAGG(PEO_NAME) FACILITY_MANAGER,
                      BLDGCON_BLDG_ID
                 FROM CITI.BLDG_CONTACTS, CITI.PEOPLE
                WHERE BLDGCON_PEO_ID = PEO_ID
                  AND BLDGCON_CONTYPE_ID IN (40181, 10142)
                GROUP BY BLDGCON_BLDG_ID) FMG,
              CITI.FLOORS FL,
              CITI.ROOM RM,
              CITI.GENERAL_LEDGER GL,
              CITI.LEGAL_ENTITY LE,
              CITI.COST_CENTER_CODES CC,
              CITI.EQUIPMENT EQP,
              CITI.WORKTYPE WOTY,
              CITI.SUBWORKTYPE SWOTY,
              CITI.WORK_ORDER WO,
              CITI.JT_WORKERS JTWO,
              CITI.PRIORITY,
              CITI.COUNTRY CTRY,
              CITI.PEOPLE P1,
              CITI.PEOPLE PEO3,
              CITI.PEOPLE PEO1,
              CITI.CITY PEOCITY,
              CITI.CURRENCY PEOCUR
        WHERE JT.JT_BLDG_ID = BL.BLDG_ID
          AND BL.BLDG_ID = BLDGLVL.BLDG_LEVELS_BLDG_ID
          AND BLDGLVL.BLDG_LEVELS_LEVELS_ID = LEV.LEVELS_ID
          AND LEV.LEVELS_PARENT = PAR.LEVELS_ID(+)
          AND PROP.PROPERTY_ID = BL.BLDG_PROPERTY_ID
          AND BL.BLDG_ACTIVE_LS = 'N'
          AND JT.JT_FLOORS_ID = FL.FLOORS_ID(+)
          AND JT.JT_ROOM_ID = RM.ROOM_ID(+)
          AND JT.JT_BLDG_ID = FMG.BLDGCON_BLDG_ID(+)
          AND JT.JT_GENLED_ID = GL.GENLED_ID(+)
          AND GL.GENLED_LGLENT_ID = LE.LGLENT_ID(+)
          AND JT.JT_CSTCTRCD_ID = CC.CSTCTRCD_ID(+)
          AND JT.JT_EQUIP_ID = EQP.EQUIP_ID(+)
          AND JT.JT_ID = JTWO.JTW_JT_ID(+)
          AND JT.JT_WORKTYPE_ID = WOTY.WORKTYPE_ID(+)
          AND JT.JT_SWORKTYPE_ID = SWOTY.SWORKTYPE_ID(+)
          AND JT.JT_WO_ID = WO.WO_ID
          AND JT.JT_PRIORITY_ID = PRIORITY_ID(+)
             --AND jt.jt_date_requested >= ADD_MONTHS (SYSDATE, -12)
          AND JT.JT_LAST_UPDATE >= ADD_MONTHS(LD_CURR_TIME, -12)
          AND BL.BLDG_COUNTRY_ID = CTRY.COUNTRY_ID
          AND JTWO.JTW_PEO_ID = P1.PEO_ID(+)
          AND P1.PEO_CITY_ID = PEOCITY.CITY_ID(+)
          AND JT.JT_COMPLETED_BY_PEO_ID = PEO3.PEO_ID(+)
          AND P1.PEO_RATE_CURRENCY_ID = PEOCUR.CURRENCY_ID(+)
          AND JT.JT_AGENT_PEO_ID = PEO1.PEO_ID(+)
       COMMIT;
    EXCEPTION
       WHEN OTHERS THEN
          ROLLBACK;
          DBMS_OUTPUT.PUT_LINE('SQLCODE :' || SQLCODE || ' Error :' || SQLERRM);
    END WORK_KIOSK_FULL;Here's the link for infor on the [Oracle Direct-Path INSERT |http://download.oracle.com/docs/cd/B10501_01/server.920/a96524/c21dlins.htm#10778].
    Also, if you are truly intent on using a CURSOR FOR LOOP with the BULK COLLECT, I suggest you read Steven Feuerstein's article [PL/SQL Practices: On BULK COLLECT |http://www.oracle.com/technology/oramag/oracle/08-mar/o28plsql.html].
    Hope this helps.
    Craig...
    If my response or the response of another was helpful, please mark it accordingly

  • I can no longer copy/paste artwork after v10.5.1

    The bulk of my library are teaching cd's from the same author. For most iTunes cannot find any info so I have been able to copy/paste the album artwork. Suddenly in v 10.5.1 I can no longer copy artwork.

    I have discovered a work around.
    Select an album that does have artwork you want to copy.
    Drill down to the track level and select a track.
    File > Get Info and select the 'Artwork' tab.
    Select the artwork and Command-c to copy.
    Now back to the iTunes grid display and select an album and right-click in the artwork viewer and paste.

  • Bulk collect into statement

    Hello All,
    I am trying to copy data using database link.
    I am using Oracle 11g on Windows.
    I check data in source table and it exists. When I execute below block it successfully executes but return no data in target database.
    SET SERVEROUTPUT ON
    DECLARE
      TYPE t_bulk_collect_test_1 IS TABLE OF NT_PROP%ROWTYPE;
      l_tab1 t_bulk_collect_test_1;
      CURSOR c_data1 IS
        SELECT *
        FROM NT_PROP@dp_copy;
    BEGIN
      OPEN c_data1;
      LOOP
        FETCH c_data1
        BULK COLLECT INTO l_tab1 LIMIT 10000;
        commit;
      EXIT WHEN l_tab1.count = 0;
      END LOOP;
      CLOSE c_data1;
    END;
    Could someone please let me know what is the eror in this code.
    Thanks in advance

    I think you are expecting BULK INSERT using FORALL. Please see below example.
    See below link also
    http://www.oracle-base.com/articles/9i/bulk-binds-and-record-processing-9i.php#save_exceptions
    DECLARE
      TYPE t_bulk_collect_test_1 IS TABLE OF NT_PROP%ROWTYPE;
      l_tab1 t_bulk_collect_test_1;
      CURSOR c_data1 IS
        SELECT *
        FROM NT_PROP@dp_copy;
        ex_dml_errors EXCEPTION;
         PRAGMA EXCEPTION_INIT(ex_dml_errors, -24381);
    BEGIN
      OPEN c_data1;
      LOOP
        FETCH c_data1
        BULK COLLECT INTO l_tab1 LIMIT 10000;
        BEGIN
          forall i in l_tab1.first..l_tab1.count  save exceptions
           insert into target_tab values l_tab1(i);
        EXCEPTION
              WHEN ex_dml_errors THEN
              l_error_count := SQL%BULK_EXCEPTIONS.count;
              DBMS_OUTPUT.put_line('Number of failures: ' || l_error_count);
          FOR i IN 1 .. l_error_count LOOP
            DBMS_OUTPUT.put_line('Error: ' || i ||
              ' Array Index: ' || SQL%BULK_EXCEPTIONS(i).error_index ||
              ' Message: ' || SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
          END LOOP;
        END;
      EXIT WHEN l_tab1.count = 0;
      END LOOP;
      CLOSE c_data1;
    END;
    Cheers,
    Suri

  • Bulk Collect with FORALL not working - Not enough values error

    Hi,
    I am trying to copy data from one table to another which are having different number of columns. I am doing the following. But it threw not enough values error.
    Table A has more than 10 millions of records. So I am using bulk collect instead of using insert into select from.
    TABLE A (has more columns - like 25)
    c1 Number
    c2 number
    c3 varchar2
    c4 varchar2
    c25 varchar2
    TABLE B (has less columns - like 7)
    c1 Number
    c2 number
    c3 varchar2
    c4 varchar2
    c5 number
    c7 date
    c10 varchar2
    declare
    TYPE c IS REF CURSOR;
    v_c c;
    v_Sql VARCHAR2(2000);
    TYPE array is table of B%ROWTYPE;
    l_data array;
    begin
    v_Sql := 'SELECT c1, c2, c3, c4, c5, c7, c10 FROM A ORDER BY c1';
    OPEN v_c FOR v_Sql;
    LOOP
    FETCH v_c BULK COLLECT INTO ldata LIMIT 100000;
    FORALL i in 1 .. ldata.count
    INSERT
    INTO B
    VALUES ldata(i);
    END LOOP;
    COMMIT;
    exception
    WHEN OTHERS THEN
    ROLLBACK;
    dbms_output.put_line('Exception Occurred' || SQLERRM);
    END;
    When I execute this, I am getting
    PL/SQL: ORA-00947: not enough values
    Any suggestions please. Thanks in advance.

    Table A has more than 10 millions of records. So I am using bulk collect instead of using insert into select from.That doesn't make sense to me. An INSERT ... SELECT is going to be more efficient, more maintainable, easier to write, and easier to understand.
    INSERT INTO b( c1, c2, c3, c4, c5, c7, c10 )
      SELECT c1, c2, c3, c4, c5, c7, c10
        FROM a;is going to be faster, use fewer resources, be far less error-prone, and have a far more obvious purpose when some maintenance programmer comes along than any PL/SQL block that does the same thing.
    If you insist on using PL/SQL, what version of Oracle are you using? You should be able to do something like
    DECLARE
      TYPE b_tbl IS TABLE OF b%rowtype;
      l_array b_tbl;
      CURSOR a_cursor
          IS SELECT c1, c2, c3, c4, c5, c7, c10 FROM A;
    BEGIN
      OPEN a_cursor;
      LOOP
        FETCH a_cursor
         BULK COLLECT INTO l_array
        LIMIT 10000;
        EXIT WHEN l_array.COUNT = 0;
        FORALL i IN l_array.FIRST .. l_array.LAST
          INSERT INTO b
            VALUES l_array(i);
      END LOOP;
      COMMIT;
    END;That at least eliminates the infinite loop and the unnecessary dynamic SQL. If you're using older versions of Oracle (it's always helpful to post that information up front), the code may need to be a bit more complex.
    Justin
    Edited by: Justin Cave on Jan 19, 2011 5:46 PM

  • How to use Bulk Collect and Forall

    Hi all,
    We are on Oracle 10g. I have a requirement to read from table A and then for each record in table A, find matching rows in table B and then write the identified information in table B to the target table (table C). In the past, I had used two ‘cursor for loops’ to achieve that. To make the new procedure, more efficient, I would like to learn to use ‘bulk collect’ and ‘forall’.
    Here is what I have so far:
    DECLARE
    TYPE employee_array IS TABLE OF EMPLOYEES%ROWTYPE;
    employee_data  employee_array;
    TYPE job_history_array IS TABLE OF JOB_HISTORY%ROWTYPE;
    Job_history_data   job_history_array;
    BatchSize CONSTANT POSITIVE := 5;
    -- Read from File A
    CURSOR c_get_employees IS
             SELECT  Employee_id,
                       first_name,
                       last_name,
                       hire_date,
                       job_id
              FROM EMPLOYEES;
    -- Read from File B based on employee ID in File A
    CURSOR c_get_job_history (p_employee_id number) IS
             select start_date,
                      end_date,
                      job_id,
                      department_id
             FROM JOB_HISTORY
             WHERE employee_id = p_employee_id;
    BEGIN
        OPEN c_get_employees;
        LOOP
            FETCH c_get_employees BULK COLLECT INTO employee_data.employee_id.LAST,
                                                                              employee_data.first_name.LAST,
                                                                              employee_data.last_name.LAST,
                                                                              employee_data.hire_date.LAST,
                                                                              employee_data.job_id.LAST
             LIMIT BatchSize;
            FORALL i in 1.. employee_data.COUNT
                    Open c_get_job_history (employee_data(i).employee_id);
                    FETCH c_get_job_history BULKCOLLECT INTO job_history_array LIMIT BatchSize;
                             FORALL k in 1.. Job_history_data.COUNT LOOP
                                            -- insert into FILE C
                                              INSERT INTO MY_TEST(employee_id, first_name, last_name, hire_date, job_id)
                                                                values (job_history_array(k).employee_id, job_history_array(k).first_name,
                                                                          job_history_array(k).last_name, job_history_array(k).hire_date,
                                                                          job_history_array(k).job_id);
                                             EXIT WHEN job_ history_data.count < BatchSize                        
                             END LOOP;                          
                             CLOSE c_get_job_history;                          
                     EXIT WHEN employee_data.COUNT < BatchSize;
           END LOOP;
            COMMIT;
            CLOSE c_get_employees;
    END;
                     When I run this script, I get
    [Error] Execution (47: 17): ORA-06550: line 47, column 17:
    PLS-00103: Encountered the symbol "OPEN" when expecting one of the following:
       . ( * @ % & - + / at mod remainder rem select update with
       <an exponent (**)> delete insert || execute multiset save
       merge
    ORA-06550: line 48, column 17:
    PLS-00103: Encountered the symbol "FETCH" when expecting one of the following:
       begin function package pragma procedure subtype type use
       <an identifier> <a double-quoted delimited-identifier> form
       current cursorWhat is the best way to code this? Once, I learn how to do this, I apply the knowledge to the real application in which file A would have around 200 rows and file B would have hundreds of thousands of rows.
    Thank you for your guidance,
    Seyed

    Hello BlueShadow,
    Following your advice, I modified a stored procedure that initially was using two cursor for loops to read from tables A and B to write to table C to use instead something like your suggestion listed below:
    INSERT INTO tableC
    SELECT …
    FROM tableA JOIN tableB on (join condition).I tried this change on a procedure writing to tableC with keys disabled. I will try this against the real table that has primary key and indexes and report the result later.
    Thank you very much,
    Seyed

  • Bulk Collect in DBMS_SQL package

    Dear all,
    just wondering if DBMS_SQL can do "bulk collect into", since I cannot find such procedure that does it. Also what can I do is copying the DBMS_SQL cursor to a ref cursor then I can do the "bulk collect into". Is this the only way when the current cursor is using DBMS_SQL?
    best regards,
    Val

    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_sql.htm#ARPLS68203

  • Need help in Bulk collect

    Hi All,
    I need a help to create a bulk statement. Please find the scenario below
    I would like to copy a table A from table B using bulk collect also the table A has more records (1Million). Before doing this I need to either truncate the table B or drop the table to load the data from table A.
    Please provide me the correct statement to achieve this request. Thanks in advance!!
    Regards,
    Boovan.

    disabling any indexes on the target should be looked at first. If there are none then look at the above.
    When you do a direct path load the indexes are build after loading.The point is that the direct path load does not avoid the undo due to the indexes.
    In this example on a table with no indexes the undo used goes from 216kb to 16kb using append.
    When an index is added the undo used goes up from 216kb to 704kb an increase of 488kb for a standard insert.
    For the direct path insert the undo goes up from 16kb to 440kb so almost the full amount of undo due to the index.
    So the presence of a single index can have a much greater impact on the amount of undo required than the use of a direct path load and that undo may not be avoided by the use of a direct path load unless the index is disabled beforehand.
    Also note the tiny amounts of undo we are talking about for 50k rows.
    SQL> create table t as select * from all_objects where 0 = 1;
    Table created.
    SQL> insert into t select * from all_objects;
    56108 rows created.
    SQL> select
      2      used_ublk undo_used_blk,
      3      used_ublk * blk_size_kb undo_used_kb,
      4      log_io logical_io,
      5      cr_get consistent_gets
      6  from
      7      v$transaction, v$session s,
      8      (select distinct sid from v$mystat) m,
      9      (select to_number(value)/1024 blk_size_kb
    10          from v$parameter where name='db_block_size')
    11  where
    12      m.sid       =   s.sid
    13  and ses_addr    =   saddr;
    UNDO_USED_BLK UNDO_USED_KB LOGICAL_IO CONSISTENT_GETS
               27          216      13893         1042736
    SQL> rollback;
    Rollback complete.
    SQL> insert /*+ append */ into t select * from all_objects;
    56108 rows created.
    SQL> select
      2      used_ublk undo_used_blk,
      3      used_ublk * blk_size_kb undo_used_kb,
      4      log_io logical_io,
      5      cr_get consistent_gets
      6  from
      7      v$transaction, v$session s,
      8      (select distinct sid from v$mystat) m,
      9      (select to_number(value)/1024 blk_size_kb
    10          from v$parameter where name='db_block_size')
    11  where
    12      m.sid       =   s.sid
    13  and ses_addr    =   saddr;
    UNDO_USED_BLK UNDO_USED_KB LOGICAL_IO CONSISTENT_GETS
                2           16       1307         1041151
    SQL> rollback;
    Rollback complete.
    SQL> create unique index t_idx on t (object_id);
    Index created.
    SQL> insert into t select * from all_objects;
    56109 rows created.
    SQL> select
      2      used_ublk undo_used_blk,
      3      used_ublk * blk_size_kb undo_used_kb,
      4      log_io logical_io,
      5      cr_get consistent_gets
      6  from
      7      v$transaction, v$session s,
      8      (select distinct sid from v$mystat) m,
      9      (select to_number(value)/1024 blk_size_kb
    10          from v$parameter where name='db_block_size')
    11  where
    12      m.sid       =   s.sid
    13  and ses_addr    =   saddr;
    UNDO_USED_BLK UNDO_USED_KB LOGICAL_IO CONSISTENT_GETS
               88          704      20908         1043193
    SQL> rollback;
    Rollback complete.
    SQL> insert /*+ append */ into t select * from all_objects;
    56109 rows created.
    SQL> select
      2      used_ublk undo_used_blk,
      3      used_ublk * blk_size_kb undo_used_kb,
      4      log_io logical_io,
      5      cr_get consistent_gets
      6  from
      7      v$transaction, v$session s,
      8      (select distinct sid from v$mystat) m,
      9      (select to_number(value)/1024 blk_size_kb
    10          from v$parameter where name='db_block_size')
    11  where
    12      m.sid       =   s.sid
    13  and ses_addr    =   saddr;
    UNDO_USED_BLK UNDO_USED_KB LOGICAL_IO CONSISTENT_GETS
               57          456       2310         1041047

  • Some general ?'s re: urxvt, copy/paste, etc.

    I started using urxvt, and I just checked the manpage and what I believe is the section on keybindings was quite confusing for me. I am used to gnome-terminal's ctrl+alt+c/v for copy/paste, and just want to double check a few things.
    1. In urxvt, highlight with either left/right mouse and which kb button/shortcut will copy? And what is the paste command in urxvt (above gnome-terminal combo doesn't work I just realized).
    2. Doing it this way, I can only paste with middle mouse button, ctrl+v in FF for example doesn't paste it, and I am confused about why?
    3. Can someone give me a fairly basic command/rundown for configuring/viewing keybindings in urxvt? I have checked the manpage like I said and it was a bit baffling.
    Thanks folks I really want to learn it, appreciate any help to get me in the right direction with some basics

    colbert wrote:Is it just separate clipboards and that's how it is?
    Yes. As a matter of fact, clipboard managers such as Glipper allow for collection of copied items based on whether the items come from the Primary selection (highlight & middleclick) or the Clipboard (CTL+C & CTL+V, etc.).
    See my post here:
    http://bbs.archlinux.org/viewtopic.php? … 26#p279226
    (especially the link at the bottom) for more detailed info about the copy and paste implementation in X11.
    By the way, I recently began using rxvt-unicode, and two things that I find require some adjustment are the use of the Primary selection for copy / paste (without the option for using the Clipboard) and no drag and drop support.
    Because of urxvt's use of the Primary clipboard, I had to enable that feature in Glipper (which I normally have disabled), and it certainly leads to a lot of junk filling up Glipper's copy / paste list. Every time you highlight something whether you intended to copy and paste it or not, the item ends up in the list making it more difficult to cull out the items you really intended to re-use for copy & paste operations.
    I guess everything has its pros and cons, and I'm still on the fence about whether the pros of urxvt outweigh the cons. I'm leaning towards keeping it for now.
    Edit: grammar
    Last edited by MrWeatherbee (2008-01-21 21:42:32)

  • I can't seem to copy & paste while I am using Firefox; but I can with Internet Explorer. What am I doing wrong? I guess I just don't understand how to do it.

    I am working in Ancestry.com. If I am in Internet Explorer, I can copy a picture & then paste it in my pictures, on my computer. If I am using Firefox, I don't understand which things to do to copy & then paste a picture, like I can in Internet Explorer. I prefer to use Firefox, but need to be able to use this copy & paste feature, often. I just downloaded Firefox, & started using it, again, yesterday. I just got a new computer in June.

    When you run out of keyboard short cuts, enter the addtional names in the name field in the keyword editor. That will start a new Keyword Collection. You can apply the addtional keywords to multiple cllips on the event browser. Or you can drag the clips into the Collection in the Event Library.
    Russ

  • Bulk Collect Limiting data problem

    Hi all,
    i am using a cursor for migrating data form one table to another.
    i say:
    fetch c_mycur bulk collect into r_myrow limit 10000;
    exit when c_mycur%notfound;
    forall i in r_myrow.first .. r_myrow.last
    insert into table2 values r_myrow(i);
    But there is a missout point that:
    Table1 has 400234 data but it copies 400000 to the table2.
    I want it to do full copy.How can i correct this???
    Thanks...

    Dear all..
    Sory i just want to share about bulk collect limiting problem, because i also get the same problem when using it. Actually before I just want to check the performance between bulk collect with explicit cursor and implicit cursor. below is my testing :
    SQL> ed
    Wrote file afiedt.buf
    1 DECLARE
    2 CURSOR c_server IS
    3 SELECT * FROM TRAN_DATA;
    4 TYPE transerver IS TABLE OF c_server%ROWTYPE;
    5 cur_server transerver;
    6 TYPE mytran IS TABLE OF TRAN_DATA%ROWTYPE;
    7 c_tran mytran;
    8 START_TIME NUMBER;
    9 END_TIME NUMBER;
    10 L_count NUMBER;
    11 BEGIN
    12 EXECUTE IMMEDIATE 'TRUNCATE TABLE TRAN_DATA_SERVERS';
    13 START_TIME := DBMS_UTILITY.GET_tIME;
    14 OPEN c_server;
    15 LOOP
    16 FETCH c_server BULK COLLECT INTO cur_server LIMIT 100;
    [b] 17 EXIT WHEN c_server%NOTFOUND;
    18 FORALL i IN cur_server.FIRST..cur_server.LAST
    19 INSERT INTO tran_data_servers VALUES cur_Server(i);
    20 END LOOP;
    21 CLOSE c_server;
    22 SELECT count(*) INTO l_count FROM tran_data_servers;
    23 DBMS_OUTPUT.PUT_LINE('row processing = '||L_cOUNT);
    24 END_TIME := DBMS_UTILITY.GET_tIME;
    25 DBMS_OUTPUT.PUT_LINE('TIME FOR CURSOR BULK FOR ALL = '||TO_CHAR(END_TIME-START_TIME));
    26 EXECUTE IMMEDIATE 'TRUNCATE TABLE array_TRAN_DATA';
    27 START_TIME := DBMS_UTILITY.GET_tIME;
    28 SELECT * BULK COLLECT INTO c_tran FROM TRAN_DATA;
    29 FORALL i IN c_tran.FIRST..c_tran.LAST
    30 INSERT INTO array_tran_data VALUES c_tran(i);
    31 END_TIME := DBMS_UTILITY.GET_tIME;
    32 L_count:= null;
    33 SELECT count(*) INTO l_count FROM array_tran_data;
    34 DBMS_OUTPUT.PUT_LINE('row processing = '||L_cOUNT);
    35 DBMS_OUTPUT.PUT_LINE('select into BULK FOR ALL = '||TO_CHAR(END_TIME-START_TIME));
    36* END;
    37 /
    row processing = 287400
    TIME FOR CURSOR BULK FOR ALL = 789
    row processing = 287417
    select into BULK FOR ALL = 811
    PL/SQL procedure successfully completed.
    SQL> ed
    Wrote file afiedt.buf
    1 DECLARE
    2 CURSOR c_server IS
    3 SELECT * FROM TRAN_DATA;
    4 TYPE transerver IS TABLE OF c_server%ROWTYPE;
    5 cur_server transerver;
    6 TYPE mytran IS TABLE OF TRAN_DATA%ROWTYPE;
    7 c_tran mytran;
    8 START_TIME NUMBER;
    9 END_TIME NUMBER;
    10 L_count NUMBER;
    11 BEGIN
    12 EXECUTE IMMEDIATE 'TRUNCATE TABLE TRAN_DATA_SERVERS';
    13 START_TIME := DBMS_UTILITY.GET_tIME;
    14 OPEN c_server;
    15 LOOP
    16 FETCH c_server BULK COLLECT INTO cur_server LIMIT 100;
    17 FORALL i IN cur_server.FIRST..cur_server.LAST
    18 INSERT INTO tran_data_servers VALUES cur_Server(i);
    [b]19 EXIT WHEN c_server%NOTFOUND;
    20 END LOOP;
    21 CLOSE c_server;
    22 SELECT count(*) INTO l_count FROM tran_data_servers;
    23 DBMS_OUTPUT.PUT_LINE('row processing = '||L_cOUNT);
    24 END_TIME := DBMS_UTILITY.GET_tIME;
    25 DBMS_OUTPUT.PUT_LINE('TIME FOR CURSOR BULK FOR ALL = '||TO_CHAR(END_TIME-START_TIME));
    26 EXECUTE IMMEDIATE 'TRUNCATE TABLE array_TRAN_DATA';
    27 START_TIME := DBMS_UTILITY.GET_tIME;
    28 SELECT * BULK COLLECT INTO c_tran FROM TRAN_DATA;
    29 FORALL i IN c_tran.FIRST..c_tran.LAST
    30 INSERT INTO array_tran_data VALUES c_tran(i);
    31 END_TIME := DBMS_UTILITY.GET_tIME;
    32 L_count:= null;
    33 SELECT count(*) INTO l_count FROM array_tran_data;
    34 DBMS_OUTPUT.PUT_LINE('row processing = '||L_cOUNT);
    35 DBMS_OUTPUT.PUT_LINE('select into BULK FOR ALL = '||TO_CHAR(END_TIME-START_TIME));
    36* END;
    SQL> /
    row processing = 287417
    TIME FOR CURSOR BULK FOR ALL = 558
    row processing = 287417
    select into BULK FOR ALL = 624
    PL/SQL procedure successfully completed.
    As you can see if we put the EXIT WHEN c_server%NOTFOUND; before the forall statement then not all the row will processing, but if we put EXIT WHEN c_server%NOTFOUND; after the forall statement it's will processing all rows. So maybe the solutions just put the EXIT WHEN c_server%NOTFOUND; after the forall statement. As you can see also there's the different bulk collect with implicit and explicit cursor, i think using explicit with limit will be more faster.
    Thank you
    Thanks

Maybe you are looking for

  • Broken voice memos after sync -- any hope for recovery?

    Dear all, I finally found where all my memos that I did not find in the Voice Memos playlist went. They were in the Unknown Album folder of Unknown Artist, being m4a files that iTunes could not analyze. These files appear to be really corrupted, as n

  • New to action script 3 and am really confused

    Hello and thank you in advance for helping if you can. I have a website banner that I made in flash. Everything works great and the last thing I need to do is add some script to it. One code is simple the stop action. So I added a new layer, called i

  • Deleting attachments from SAP documents (FB02)

    I am in need to control the action of 'deleting/removing' attachments from documents, when entered via FB02. I believe the authorization object for attached documents is S_BDS_DS. Does anyone how to 'enable' or 'disable' this activity ? --- When run

  • PROJECT WISE CUSTOMER OUTSTANDING

    Dear PS Experts Our company is a project based co. We have recently implemented SAP but to our utter dismay the implementation partner has not understood the project based concept & implemented SAP. Now for the last one year , we are managing the thi

  • Event triggering

    Hi guys, I created events in sm64. These events should start a process chain. However when I trigger them manually I do not get the event in the event history nor does my process chain start. Do I have to activate any other stuff for events? Thanks i