Problems using trigger cursor query and post.

Hello

I use a block non-base of data/model to query records in a database block. My form has a point text 'report No.' that will be used to enter a valid number of reports. Based on the number of this report, I hit a button to search (also from the same block of data non-base) to view records that have this "report No.' in the database block. I think I need to use a cursor in a post for this request but I am not able to operate :( Help, please! I really need this point that nobody is helping me to work:(la figure)

My search button - button the trigger:
DECLARE
NUMBER OF CHOICES;
BEGIN
IF: DUMMY_BLK. NWTFR IS NULL THEN
ALERTS. STOP_ALERT ("Start Date is required", choice);
RAISE FORM_TRIGGER_FAILURE;
END IF;
go_block ('T_VESSEL_BLK');
execute_query;
END;

My post_query:

DECLARE
cursor vessel_cur is
SELECT VES_RPTNO, VES_SENDER, VES_SENDER_MBOX, VES_INTCTRL_REF, VES_NAME, VES_VOYNO, VES_ARRDT
SHIP
WHERE VES_RPTNO =: DUMMY_BLK. NWTFR;
var_mot vessel_cur % ROWTYPE;
BEGIN
Open vessel_cur;
LOOP
extract the vessel_cur in var_mot;
EXIT WHEN vessel_cur % NOTFOUND;
END LOOP;
close vessel_cur;
END;

instead of execute_query you do now

Why do you offer me something like that? Replacing the standard behavior that you use forms must be well thought out, because you have to manage a large number of possible problems. You can easily get the desired using the standard logic behavior:

-Create an item number IT_COUNT in a control block, assign 'calculation mode' to 'Summary', 'Synthesis function' to 'Count' "Down block" and your DB-bloc and "just point' a null-element not contained in this block. Last series the block 'Interrogate all folders' to 'Yes' in your databaseblock. Now, in your code, you can just checkl the value of this element of count, as

...
EXECUTE_QUERY;
IF :BL_CONTROL.IT_COUNT=0 THEN
  error
END IF;

Tags: Oracle Development

Similar Questions

  • Problems using the mask layer and B & W in filter/fit option.

    I used to use the layer mask + black and white filter/adjustment. + using the eraser to do some simple setting highlight, but then after the first photo that I did today, it stopped working.

    I was wondering if anyone knew how to solve this problem, maybe I've touched a keyboard shortcut / cmnd that off, he'll do layers and layers of filter, turn the photo b & w, but when I go to delete, it does nothing.

    Thanks in advance!

    Eric Fields.

    Post edited by: EricRFields

    It would be easier if you use the Brush tool to paint on the layer mask.

    Paint with black to reveal the color and white to hide the color of the layer below.

    You can use the X key to move from one black and white as foreground color in the Toolbox.

  • JDev 12.1.3: Aliases used in of query and ViewCriteria ViewObject there ARE criteria do not match

    JDEV: 12.1.3

    Java (TM) Platform 1.7.0_51

    Oracle IDE 12.1.3.0.41.140521.1008

    I get the error, explained in the below link (Bug #20419037)

    https://Java.NET/jira/browse/ADFEMG-261

    It seems that this bug has been resolved.

    How can I get the correction of this problem to the 12.1.3 JDev Summit.

    Could you please let me know.

    Thank you

    Vishnu Gillella

    It's as told in https://java.net/jira/browse/ADFEMG-261

    You must file an SR with support.oracle.com and request a patch for the mentioned bug number. Then you download the patch from Oracle.

    Nobody on this forum can provide the patch (even it it was) because he did not share the work.

    Only other way for you is to test workaround or use 12.2.1.

    Timo

  • Problems using rpc between Flex and CF

    Hello
    I have a problem to send objects between Flex and Coldfusion using the gateway of the AUTHORITY of the new Version of Coldfusion.
    The transfer of CFCS to Flex works, but I can't send a complex object to a CFC.

    The Error Message is:
    faultCode:Client.Message.Encoding faultString:' cannot create class of type 'flex. HotlineSystem.bin.cf.Category'. ' faultDetail: 'Type' flex. HotlineSystem.bin.cf.Category' not found. »

    Im going totally nuts... the transfer of CF to Flex works very well, the mapping between category.cfc and category.as work of ist. But if I try to send a Flex object category to my CFC is not.

    I hope someone can help.

    Thank you!

    CFC function:
    < cffunction "insertCategory" access = "public" returntype = name = "Sub" output = "false" >
    < cfargument = "category" type name = 'flex. HotlineSystem.bin.cf.Category"required ="true">

    < cfquery name = "insertCategory" datasource = "hotline_system" >
    INSERT INTO category (category_idCategory, name)
    VALUES (#category.getCategory_IdCategory () #, ' #trim (category.getName ()) #')
    < / cfquery >


    Category.CFC:

    < cfproperty displayname = 'Category' alias = 'flex. Index HotlineSystem.bin.cf.Category"=" I model a single category ">
    < name cfcomponent = "idCategory" type = "numeric" default = "0" >
    < name cfcomponent = "category_idCategory" type = "numeric" default = "0" >
    < name cfcomponent = "name" type = "string" default = "" >

    < cfscript >
    Initialize the SWC with the default property values.
    variables.idCategory = 0;
    variables.category_idCategory = 0;
    variables. Name = "";
    < / cfscript >

    < name cffunction = "init" output = "false" returntype = "flex. HotlineSystem.bin.cf.Category">
    < cfreturn this >
    < / cffunction >

    < name cffunction output = "getIdCategory" = "false" access = "public" returntype = "any" >
    < variable cfreturn. IdCategory >
    < / cffunction >

    < name cffunction output = "setIdCategory" = "false" access = "public" returntype = "Cancel" >
    < name cfargument = "val" required = "true" >
    < cfif (IsNumeric (arguments.val)) or (arguments.val EQ "") >
    < cfset variables. IdCategory = arguments.val >
    < cfelse >
    < cfthrow message = "' #arguments.val #' is not a valid numeric" / >
    < / cfif >
    < / cffunction >

    < name cffunction output = "getCategory_idCategory" = "false" access = "public" returntype = "any" >
    < variable cfreturn. Category_idCategory >
    < / cffunction >

    < name cffunction output = "setCategory_idCategory" = "false" access = "public" returntype = "Cancel" >
    < name cfargument = "val" required = "true" >
    < cfif (IsNumeric (arguments.val)) or (arguments.val EQ "") >
    < cfset variables. Category_idCategory = arguments.val >
    < cfelse >
    < cfthrow message = "' #arguments.val #' is not a valid numeric" / >
    < / cfif >
    < / cffunction >

    < name cffunction = output "getName" = "false" access = "public" returntype = "any" >
    < variable cfreturn. Name >
    < / cffunction >

    < name cffunction = output "setName" = "false" access = "public" returntype = "Cancel" >
    < name cfargument = "val" required = "true" >
    < cfset variables. Name = arguments.val >
    < / cffunction >
    < / cfproperty >

    Category.As:

    package classes
    {
    [Bindable]
    [RemoteClass (alias = "flex. HotlineSystem.bin.cf.Category")]
    dynamic public class
    {
    public var idCategory:int;
    public var category_idCategory:int;
    public var name: String;

    public void category() {}

    }

    public void fill(idCategory:int,_category_idCategory:int,_name:String):void {}
    this.idCategory = idCategory;
    This.category_idCategory = category_idCategory;
    myIdName = name;
    }


    public function getIdCategory (): int {}
    Return this.idCategory;
    }

    public function setIdCategory (): void {}
    this.idCategory = idCategory;
    }

    public function getCategory_IdCategory (): int {}
    Return this.category_idCategory;
    }

    public void setCategory_IdCategory(category_idCategory:int):void {}
    This.category_idCategory = category_idCategory;
    }

    public void setName(name:String):void {}
    myIdName = name;
    }

    public function getName (): String {}
    Return myIdName;
    }
    }
    }

    Problem solved:
    Apparently, it is not possible to transfer an object from a class action script for coldfusion.

    The solution is to encapsulate the object (in my example category) in a table.

    Strange... but it works.

    Best regards

  • WRT600N advanced routing problems / use as Access Point and switch

    Firmware 1.01.36 build 4 The WRT600N is connected to an existing LAN and is really only used as a Wireless N access point. There is nothing plugged into the WAN port; only the LAN port. I have NAT disabled. All traffic from a client connected to the WRT600N wireless going very well for the gateway and the Internet router. The customer experience is very good. However, there are a few minor issues as follows.

    1] Setup > Advanced Routing tab has only the following options; to do this, * not * have a picker 'Mode '. NAT, static routing and dynamic routing (RIP).    IS this NORMAL, OR should HAVE a MODE (e.g. switch) AS REFERRED to IN THE HELP FILES?

    [2] even if a connection wireless or wired to the WRT600N works very well, the WRT600N himself is unable to connect to the internet. It cannot connect to NTP to set the time and I can't ping past the gateway router using the ping of the WRT600N diagnostic utility. I ping the gateway 192.168.1.4 port inside, but I can't use the diagnostic the WRT600N ping ping utility something beyond this gateway port. The routing of the WRT600N table is below. THE GATEWAY SHOULD NOT BE 192/168.1.4? HOWEVER THE WRT600N DON'T ME LETS NOT CHANGE IT.

    Destination LAN IP Subnet Mask gateway interface

    192.168.1.0 255.255.255.0 192.168.1.71 LAN & Wireless

    127.0.0.0 255.0.0.0 * LAN & Wireless

    Topic 1. Linksys, used to have a mode option to switch between the modes 'Bridge' and 'router '. The latest routers call it now better NAT power. Gateway mode means THAT NAT is enabled. Router mode means THAT NAT is disabled. The help files are probably a little bit over. But the option is still the same.

    Re 2. It's normal if you use it as only access point (i.e. do not use the WAN port). The router always takes into account that the internet connection via the WAN port, i.e. it will always use the default gateway on the WAN port. If nothing is connected to the WAN port on the router itself has no default gateway and therefore has no access to the internet. Generally, you are not able to establish the default route in either advanced routing page. It is a known limit of these routers if you do not use as a router.

  • Problem using a conditional branch and routing table

    Hello world

    I need to check the indicator of payload of my entry, depends on that I have to call one another operational branch for each conditional branch.

    For example: if my flag is 'E', then I have to call 2 different business services still have 2 different business services.
    If I use the routing table, I can't call operational management in it.


    I tried to skip logic and I get the following error: [BranchNode1] one branch conditional node specifies an invalid xpath: an error has been reported to compile the XPath: except for XQuery



    Can someone help me.

    Ok. With little understanding of your scenario, I guess you will call the same set of services on the basis of the IF and ELSE, but their internal processing would be different.

    What you can do is-

    Proxy main - if-> Proxy (local transport WSDL based)--> operational connection
    | - other---> Proxy B (WSDL based transport)--> operational connection

    To develop-

    Main proxy's proxy that would receive applications from the outside world. Using conditional branches, route the incoming request to either A proxy or A of the b. Proxy Proxy and Proxy B will be based on the same WSDL (WSDL according to type of proxy) and their transport must be selected as 'local' to keep them invisible to the outside world. Proxy now A and B of Proxy, you can have operational branch and provide the implementation you want.

    Kind regards
    Anuj

  • Documaker: How to use this trigger to overflow and XPath.

    Hello

    My first question, please help me!
    I create a form as follows.
    A page is set to overflow with group.
    ______________________
    Page (Body)
    Group
    * Trigger manual Mask (Count) of research:! / xxx/data/RiskInfo/risk
    Section header
    Section-A
    * Trigger manual search Mask(True/false):! / xxx/data/RiskInfo/risk [*] [Code = 'A']
    Section-B
    * Trigger manual search Mask(True/false):! / xxx/data/RiskInfo/risk [*] [Code = 'B']
    End group
    ______________________

    The XML code example is as follows.
    .....
    < RiskInfo >
    < risk >
    < code > < code > A
    < name > XXX < / name >
    < / risk >
    < risk >
    B < code > < code >
    < name > YYY < / name >
    < / risk >
    < / RiskInfo >
    .....
    ______________________

    Overflow is no problem.
    But the Section A and Section B triggers are not worked.
    This setting of relaxation Section has poster-twice.
    I understand that [*] is false, because it is working OK if I replace [*] [1] or [2].
    But I do not understand the correct method...

    Probably, I think I need to use the OverFlowSymbol.
    Where should I put the OverFlowSymbol? This thought does not?

    Please teach me the method works this trigger to overflow and XPath.

    Thank you

    You should be able to use the overflow user @subform in your xpath to define the correct index based on the current subform.

    You can try something like:

    ! /XXX/data/RiskInfo/risk[**@subform**]/name

    You can find more information on handling overflow with XML in the DMStudio user guide (Appendix B are provided in subsection 12.1 Rel) and function of the @subform in the section Sub user forms of the document.

  • problem with the CURSOR and WITH clause

    Hi guys,.

    I have never created a package before. I try to run it, but I get:
    ORA-06550: line 8, column 16:
    PLS-00382: expression is of the wrong type
    ORA-06550: line 8, column 3:
    PL/SQL: Statement ignored

    I know that my problem is in the next section

    OPEN FOR V_io_cursor

    with GOT_R_NUM like)


    Is the above correct?

    When I copy paste the "heart" of the query, it works very well. I really have a problem with the CURSOR and the declaration.

    Here's the code in its entirety. I know that the code is much more then he returned, but ignore this overload that was to do some tests to make sure that I can achieve any query request.

    CREATE OR REPLACE
    PKG_SPF_NATIONALREPORTS PACKAGE BODY IS

    PROCEDURE GET_NATIONAL_TOTAL_RESULTS (P_SelectFields IN varchar2, P_SUMFields IN varchar2, io_cursor IN OUT C_RESULTS)
    IS
    v_io_cursor C_RESULTS;

    BEGIN

    OPEN FOR V_io_cursor

    with GOT_R_NUM like)
    SELECT
    -START P_SelectFields
    r.cli_served,
    r.EIER,
    -END P_SelectFields
    r.RC,
    r.Year_ID,
    r.period_id,
    r.agreement_type_ind,
    CONTRACT_NUMBER. CONTRACT_NUMBER_TEXT,
    YEARS.year_desc,
    RC_CODE.rc_code_id,
    RC_CODE.rc_code,
    AHRDA HOLDERS. AHRDA_ID,
    AHRDA HOLDERS. REGION_ID,
    AHRDA HOLDERS. PROVINCE_ID,
    AGREEMENT_TYPE. AGREEMENT_TYPE_ID,
    AGREEMENT_TYPE. AGREEMENT_TYPE_DESC_EN,
    ROW_NUMBER() over (partition R.YEAR_ID, R.CONTRACT_Number_Text
    order by
    P.PERIOD_desc
    (/ / DESC NULLS LAST) AS r_num
    RESULT r
    JOIN period p ON r.period_id = p.period_id
    JOIN CONTRACT_NUMBER ON r.contract_number_text = CONTRACT_NUMBER. CONTRACT_NUMBER_TEXT
    JOIN RC_CODE ON contract_number.rc_code_id = rc_code.rc_code_id
    JOIN AHRDA holders ON ahrda.ahrda_id = rc_code.ahrda_id
    JOIN AGREEMENT_TYPE WE AHRDAS. AGREEMENT_TYPE_ID = AGREEMENT_TYPE. AGREEMENT_TYPE_id
    JOIN the YEARS WE r.year_id = YEARS.year_id
    )
    SELECT year_desc
    -START P_SUMFields
    SUM (cli_served) AS sum_cli_served
    The SUM (eier) AS sum_eier
    -END P_SUMFields
    OF got_r_num
    GROUP BY year_desc
    ORDER BY year_desc
    ;

    io_cursor: = v_io_cursor;

    END GET_NATIONAL_TOTAL_RESULTS;

    Agree - all this talk of loops FOR is completely irrelvant.
    A refcursor is usually the exact mechanism to return a result set.

    What is C_RESULTS?

    Just use SYS_REFCURSOR.

    No need for local variable.

    OUT why? Not just walk OUT?

    PROCEDURE GET_NATIONAL_TOTAL_RESULTS
    (P_SelectFields IN varchar2, P_SUMFields IN varchar2, io_cursor OUT SYS_REFCURSOR)
    IS
    BEGIN
     OPEN io_cursor FOR ...
    END;
    
  • Since the installation of Mac Mavericks all my friends with Macs and I have problems with the cursor disappears, that in Firefox, Safari is very good...

    I stopped using Firefox as nothing I've done has corrected this problem. I tried to close Firefox and restart it, I erased all my Add-ons and then added adblock back (it's the only one), but it still does not work. I deleted files so that I have more space - I can't think of anything that works. I talked to four of my friends with Macs and they are all having the same problem with Firefox since the Mavericks.

    Cursor disappears huh? It's quite strange. All of the compatibility of the Mavericks can be followed in [Bug 883824]

    Try this work around:

    1. Go to Firefox > Preferences > advanced > general
    2. Always check "use the cursor keys to navigate through the pages.
    3. Press OK.

    Or try the Mac preferences noted here: https://discussions.apple.com/message/23542890#24471966

  • Problem when using SOAP requests with HTTP POST function

    Hello!

    Using the vi of HTTP POST to send SOAP requests to a device, I encountered a problem.

    Take care of the HTTP header for you HTTP POST vi and defines the type of 'content' as "Content-Type: application/x-www-formulaires-urlencoded. Who is considered to be 'non-soap' requests by some Web servers.

    Standards W3C says in this case, you should be content-type: "application/soap + xml".

    Link to the page to W3C standard: http://www.w3.org/TR/soap12-part0/#L26866

    That is possible to update this feature in a future release so that programmers can choose (or type) the necessary content type?

    Have you tried "Add header" to change?

    http://zone.NI.com/reference/en-XX/help/371361L-01/lvcomm/http_client_addheader/

  • How to use a parameter query to select and display the data in the table of the façade

    Hiiiiii

    I am using Access 2007 database
    I want to select the specific data in the database using control of the chain as 'select product, size, weight of ProductInfo where barcode (chain control) =?'  and also display the same table of façade.

    I use the connected database toolkit.
    I saw the example of the parameterized insert, but it did not help to use parameterized select query, as well as to display data of parameterized select query.

    I looked for example on parameterized select query, but I don't have any.
    So pls guide me how to do this. I would like to know the other method (if any) that the use of parameter query to perform the same thing.
    If possble pls share a vi reference.
    Thank you!!!

    HII szewczak
    Thanks for the reply
    but I did not getsolution in one of your shared links
    My problem is solved. There is no need to use the parameter query to select control values
    In my case I want to display data from database where bar code is even entered by the user
    I use the data function DB TOOL CHOOSE and create the condition of chain based on concatenation of strings

  • After that I used movie maker and try to post it on facebook, it is said that I have need a Visual server that is sharing media of Neptune or Mydeo, how can I by pass them and post another way?

    ITI said after that I made my movie with windows movie maker and try to publish it after that I backed up, to publish on the web, it tells me that I need a video host to publish on the web, and it is either share media Neptune or Mydeo, I want to display on my page facebook, how can I work around these video hosting web sites?

    Hey Danny,

    I suggest you to refer to the help article and check if it helps.

    Download & watch videos

    http://www.Facebook.com/help/video

    If the problem persists after the query in Face book support forum for better support.
    www.Facebook.com/help/

    It will be useful.

  • NOR USB6210, problem to trigger on a PowerPlay with measurement and automation

    Hello

    I use Labview version NIDAqmx 8.7 driver version 8.5.1,, Measurement & Automation explorer 4.4.1 and a device OR USB6210.

    I create a task with Measurement & Automation to make an acquisition of voltage on the AI0 channel.

    I want to use the function of digital triggering with the channel PFI0. I connect a signal square on the AI0, and PFI0 channels. I put the edge on the RISE, for example. When I make several acquisitions, and I notice on the curve that the USB6210 device does not fire correctly, sometimes used trigger edge is on the RISE and sometimes FALL.

    Could you help me? Is it a driver problem?...

    Thanks in advance, Daniel.

    OK, nice to hear that everything works as expected.

    Good luck,

  • When to use the cursor for loop and the cursor (open, fetch, close)

    Hello world
    I have a small doubt about when to use the cursor for loop and when to use the cursor for loop and the cursor (open, fetch, close).
    Well, I'm not the difference between implicit and explicit cursor. So please tell me how I got to know, what to use and when?




    Kind regards
    BS2012

    Published by: BS2012 on January 29, 2013 12:15

    All SQLs are analyzed, stored and executed as cursors. Thus, you will always use a cursor.

    The problem is that languages, such as PL/SQL, provide different interfaces to interact with the SQL cursor. As the ref, the slider interface, the interface DBMS_SQL slider interface and so on.

    Each of these interfaces offers different features. For example, using the interface DBMS_SQL allows binding dynamics and dynamic recovery. The Ref Cursor interface allows your code PL/SQL pass a handle to a reference pointing to the SQL cursor, to an external client. Etc.

    The fundamental reason for the use of an explicit cursor interface is mainly that you own and manage bulk made extraction output provided by PL/SQL cursor.

    With a cursor FOR , the motor loop of PL/SQL optimize the loop by extracting block a 100 lines both. However, you cannot access this collection in bulk directly inside the loop.

    With an explicit cursor interface, you specify the size of the extraction in bulk via the clause LIMIT , and you set the variable of collection to use. This allows you to use the collection directly variable inside the loop.

    However, the need to do - code manually in bulk collection - rarely occur in the daily programs in PL/SQL. A line of treatment is both slow and not well fits. And even if your bulk code collects lines, these lines must still be processed one at a time in your code. It is much more efficient and scalable rather write SQL code, and make the engine SQL the line of treatment for you.

  • Procedure failed when using bulk collect clause and works with the cursor

    Hi all

    I use "BULK collect into" clause in my procedure and it is a failure after 21 minutes and gives the error "end of file communication channel.
    After that this error comes when I tried to connect the database it gives following error.

    ORA-01034 - Oracle is not available.
    ORA - 27101-shared memory realm does not exist.
    SVR4 error: 2: no such file or directory.

    When I use the cursor instead of the COLLECTION in BULK IN the clause, it runs successfully.

    Following the code works with the slider.
    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, 'BILLABLE CLIENT. "
    138803, "CONTRACTED"
    "138804, ' BILLABLE IN-HOUSE."
    NULL, ' '
    ) Billable.
    BL.bldg_name_cc 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."
    141522, "NEGLIGENCE."
    141523, "ACCIDENTAL."
    141524, "MECHANICAL FAILURE."
    141525, "CONTROL."
    141526, "VANDAL."
    141527, 'STANDARD ',.
    141528, "WORK PROJECT",.
    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, "AVAILABILITY OF THE HAND ŒUVRE."
    139952, "WORK DEFERRED-HI PRI."
    139953, "APPROVAL OF WIND TURBINES."
    139954, "FUNDING."
    139955, "ACCESS DENIED."
    139956, "WTG MATERIAL."
    NULL, ' '
    ) AS deferral_reason,
    JT.jt_description as description,
    JT.jt_date_resched_ecd IN the development of the young child,
    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 OPEN CORRECTION."
    138835, "OPEN REQUEST CUSTOMER."
    138836, "CORRECTIVE MAINTENANCE",.
    138837, "BOOKING CONFERENCE ROOM."
    138838, "PROJECT INITIATED REQUEST."
    138839, "PLANNED PREVENTATIVE MAINTENANCE."
    138840, "COULD START FREE APPLICATION."
    NULL, ' '
    ) AS originator_type,
    "" AS payment_terms, priority_text AS priority_code,
    swoty.sworktype_text AS problem_type,
    Prop.property_name_cc as a property,
    JT.jt_cost_quote_total AS quote_total,
    par.levels_name IN the region,
    DECODE (jt.jt_repdef_id,
    141534, 'ADJUSTED SETTING. "
    141535, "THE TRAINING OF THE END,"
    141536, "NEW REQUEST"
    141537, "NO INVESTIGATION OF REPAIR."
    141538 "REPLACED PARTS."
    141539, 'REPLACE EQUIPMEN.
    1000699, "NEW REQUEST"
    NULL, ' '
    ) AS repair_definitions,
    JT.jt_repairdesc AS MARKED_COR,
    JT.jt_requestor AS applicant, ' ' 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,
    "" LIKE response_time, rm.room_name_cc 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, ' ' shift, as.
    ' ' AS skill,.
    DECODE (jt.jt_bigstatus_id,
    138813, «NEWS»,
    138814 "PENDING."
    138815, 'OPEN ',.
    138816, "END."
    138817, 'CLOSED ',.
    138818, "CANCELLED."
    NULL, ' '
    ) The STATUS,
    Lev.levels_name IN the subregion, ' ' IN the 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, «NEWS»,
    138814 "PENDING."
    138815, 'OPEN ',.
    138816, "END."
    138817, 'CLOSED ',.
    138818, "CANCELLED."
    NULL, ' '
    ) AS wr_status,
    ctrY.country_name as a country
    OF citi.jobticket jt,.
    Citi.Property prop,
    Citi.Bldg bl,
    Citi.bldg_levels bldglvl,
    civil LEVEL lev,
    civil by LEVELS.
    (SELECT crstools.stragg (peo_name) facility_manager,
    bldgcon_bldg_id
    OF citi.bldg_contacts, citi.people
    WHERE bldgcon_peo_id = peo_id
    AND IN bldgcon_contype_id (40181, 10142)
    FMG GROUP BY bldgcon_bldg_id),
    Citi.floors, fl,
    Citi.Room rm,
    Citi.general_ledger gl,
    the Citi.legal_entity
    Citi.cost_center_codes cc,
    Citi.Equipment eqp,
    Citi.workType woty,
    Citi.subworktype swoty,
    Citi.work_order wo,
    Jtwo Citi.jt_workers,
    Citi.Priority,
    Ctry Citi.Country,
    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
    run immediately 'truncate table crstools.drt_bom_work_kiosk;
    Select sysdate in double ld_curr_time;
    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
    DPE
    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
    MARKED_COR
    APPLICANT
    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
    MAJ
    SKILLS
    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
    BILLABLE cur_rec.
    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, DEVELOPMENT OF THE YOUNG CHILD
    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, MARKED_COR
    cur_rec, APPLICANT
    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, UPDATE
    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
    while 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 big collect in would adopt.

    Please help me why this is happening.


    Thanks and greetings
    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 change the data inserted so that you could not encapsulate the changes in a query, but you do an insert in right in the table of your cursor. A much more effective way would be to use the following changes I made to your code sample:

    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 is the link for infor the [Oracle Direct - Path INSERT | http://download.oracle.com/docs/cd/B10501_01/server.920/a96524/c21dlins.htm#10778].

    Also, if you are really wanting to use a CURSOR for LOOP COLLECTION in BULK, I suggest you read the article by Steven Feuerstein [PL/SQL practices: GEM VRAC | http://www.oracle.com/technology/oramag/oracle/08-mar/o28plsql.html].

    I hope this helps.
    Craig...

    If my response or response from another person was helpful, please mark accordingly

Maybe you are looking for

  • How can I completely remove bookmark toolbar favicons?

    I added the following code to my file userChrome.css, but favicons appear again when I download files (documents, photos, etc.). How can I get rid of the favicons completely, so that they reappear after a download?Thank you! */ /* Bookmarks Toolbar -

  • can not download the game

    I can't download a game.  Said, my windows user account does not allow. I was a member of the site of the game for years and I do not know why I can not download all of a sudden.  Please help, thanks

  • All of a sudden I have two flashing lights on my keyboard the SHIFT key and press the end/pg.

    I met a problem to wake up my laptop (Pavilion dv7-1270us) this morning.  Initially, he doesn't wake up and had to do a hard reboot.  Now I have two flashing lights on the keyboard - the caps lock light and one on the end/pg key on the numeric keypad

  • Cannot import Lightroom catalog created on my PC to my Mac

    I have CC Lightroom installed on my PC and my Mac. Recently upgraded to the use of the stand-alone version of the CC version.The PC and Mac have installed according to Creative Cloud Manager version "later."I have a number of books of marriage create

  • Add layers to the hierarchy

    I have a puppet that half done.  I want to add arms, ears and a horn.  How can I add layers to the hierarchy and import work into these layers?