Cursor with IN CLAUSE in PACKAGE

Hi
Hope someone can help and I'm really not sure why Oracle makes it so difficult.
To simplify, I have a package that takes an associative table - tabStr = {a,b,c}
as input.Based on this, it build a string variable varStr which is of type 'a','b','c'
I need to return a ref cursor
OPEN out_refCur for select * from tab where col in (varStr)
If I hardcode - varStr than out_refCur return data.
But the above does not.
I'm open to using even tabStr but could not find any example.
Any inputs? Please ignore syntax .... since that not the issue.
Thanks in advance

Declare a nested table collection in the procedure. SQL can query these and not associative arrays. Loop through the associative array copying each value into a corresponding element in the collection. Use the collection in the query. Very rough example:
DECLARE
    TYPE aa IS TABLE OF INTEGER INDEX BY PLS_INTEGER;
    p_batch_numbers AA;  -- This would be your parameter array
    i PLS_INTEGER; -- := p_batch_numbers.FIRST;
    v_batch_numbers_coll INTEGER_TT := INTEGER_TT();  -- Type defined with CREATE TYPE
BEGIN
    -- Sample values:
    p_batch_numbers(1) := 7369;
    p_batch_numbers(2) := 7521;
    p_batch_numbers(3) := 7839;
    -- Copy values into queriable collection:
    i := p_batch_numbers.FIRST;
    WHILE i IS NOT NULL LOOP
        v_batch_numbers_coll.EXTEND;
        v_batch_numbers_coll(v_batch_numbers_coll.COUNT) := p_batch_numbers(i);
        i := p_batch_numbers.NEXT(i);
    END LOOP;
    -- Cursor that uses the collection:
    FOR r IN (
        SELECT empno, ename FROM emp
        WHERE  empno IN
               ( SELECT column_value
                 FROM   TABLE(v_batch_numbers_coll) )
    LOOP
        DBMS_OUTPUT.PUT_LINE(r.empno || ': ' || r.ename);
    END LOOP;
END;
/

Similar Messages

  • Cursor with IN clause

    Hi,
    i got problem when i tried to execute this
    declare
    cursor c1 is
    select distinct code_sdi, code_sdi_p, code_ana
    from plan_rules
    where code_cpe in (var.whr) and ana_from_flag='Y';
    begin
    open c1;
    loop
    fetch c1 into :PLAN_RULES.code_sdi, :PLAN_RULES.code_sdi_p, :PLAN_RULES.code_ana;
    exit when c1%notfound;
    next_record;
    end loop;
    close c1;
    end;
    problem is the clause in with variable var.whr (is declared in program entity as varchar2)..when i insert the same text that is stored in var.whr it works but with the variable it does not..
    pls help

    Clearly, SQL does not consider
    WHERE empno IN (p_empno_list)
    to be equivalent to
    WHERE empno IN (7369,7499,7839,7902)
    Think, if you had a value such as 'Salerno è la più bella citta del mondo' that represented a single address line(var.whr)
    You create a scalar collection type like this: (sure, other approch you could use)
    (this is example for number)
    CREATE TYPE INTEGER_TT AS TABLE OF INTEGER
    CREATE TYPE VARCHAR2_TT AS TABLE OF VARCHAR2(4000);
    DECLARE
    p_empno_list CONSTANT INTEGER_TT := INTEGER_TT(7369,7499,7839,7902);
    DECLARE
         p_empno_list CONSTANT INTEGER_TT := INTEGER_TT(7369,7499,7839,7902);
    BEGIN
         FOR r IN (
              SELECT empno, ename4
              FROM   emp
              WHERE  empno IN
                     ( SELECT column_value5
                       FROM   TABLE(p_empno_list) )
         LOOP
              DBMS_OUTPUT.PUT_LINE(RPAD(r.empno,9) || r.ename);
         END LOOP;
    END;Regards
    Other option could be Dinamyc-SQL and REF-CURSOR
    Message was edited by:
    RV

  • Cursor with in clause in not fetching any rows (happens rarely)

    Hi Experts,
    Applications: Oracle Apps 11.5.10.2
    Data base version: 11.2.0.1.0
    we are running concurrent programs (scheduled every day),
    we obsereved one of cursor is not fetching any records (happens rarely);
    please refer the cursor below.
    CURSOR LCU_GET_ADJ_JN_CAT_DET IS WITH LCU_GET_ROWS_DETAILS AS(
          SELECT <columns1, columns1_1, columns1_2>
            FROM (SELECT <columns2> from table1 <conditions>            
                   GROUP BY <columns>
                  UNION ALL
                  SELECT <columns3> from table2 <conditions>
                  GROUP BY <columns>)
           WHERE (columns1_1 <> 0 OR columns1_2 <> 0)
           GROUP BY <columns>)
          SELECT *
            FROM (SELECT ROW_DET.* FROM LCU_GET_ROWS_DETAILS ROW_DET),
                 (SELECT COUNT(1) TOTAL_RECORDS,
                         SUM(columns1_1) TOTAL_CLOSING_DEBIT,
                         SUM(columns1_2) TOTAL_CLOSING_CREDIT
                    FROM LCU_GET_ROWS_DETAILS ROW_SUM)
           ORDER BY <columns>;

    Please enable trace/debug and check the log files then.
    How To Get Level 12 Trace And FND Debug File For Concurrent Programs (Doc ID 726039.1)
    How to enable and retrieve FND debug log messages (Doc ID 433199.1)
    Thanks,
    Hussein

  • Difference Ref cursor with/with out using clause

    Hi everyone,
    When I am using dynamic sql with USING clause ,the results are not sorted in Ascending order.
    DECLARE
    TYPE emp_refcursor IS REF CURSOR;
    emp_rc emp_refcursor;
    TYPE v_emp_id IS TABLE OF number INDEX BY PLS_INTEGER;
    TYPE v_last_name IS TABLE OF varchar2(50) INDEX BY binary_integer;
    V_empno v_emp_id;
    v_ename v_last_name;
    p_deptno number := &U_DEPTNO;
    v_limit number := 10;
    v_ordcolumn varchar2(20) := 'employee_id';
    v_stmt varchar2(1000);
    BEGIN
    v_stmt :=
    'select employee_id,last_name from employees
    where department_id = :x order by :y ';
    dbms_output.put_line(v_stmt);
    OPEN emp_rc FOR v_stmt USING p_deptno,v_ordcolumn;
    LOOP
    FETCH emp_rc BULK COLLECT INTO v_empno,v_ename LIMIT v_limit;
    EXIT WHEN v_empno.count = 0;
    FOR I IN v_empno.first .. v_empno.last
    LOOP
    dbms_output.put_line(v_empno(i)||' '||v_ename(i));
    END LOOP;
    END LOOP;
    END;
    When I use dynamic sql with out USING cluase,results are sorted in Ascending order.
    DECLARE
    TYPE emp_refcursor IS REF CURSOR;
    emp_rc emp_refcursor;
    TYPE v_emp_id IS TABLE OF number INDEX BY PLS_INTEGER;
    TYPE v_last_name IS TABLE OF varchar2(50) INDEX BY binary_integer;
    V_empno v_emp_id;
    v_ename v_last_name;
    p_deptno number := &U_DEPTNO;
    v_limit number := 10;
    v_ordcolumn varchar2(20) := 'employee_id';
    v_stmt varchar2(1000);
    BEGIN
    v_stmt :=
    'select employee_id,last_name from employees
    where department_id = '||p_deptno ||
    ' order by '||v_ordcolumn;
    dbms_output.put_line(v_stmt);
    OPEN emp_rc FOR v_stmt;
    LOOP
    FETCH emp_rc BULK COLLECT INTO v_empno,v_ename LIMIT v_limit;
    EXIT WHEN v_empno.count = 0;
    FOR I IN v_empno.first .. v_empno.last
    LOOP
    dbms_output.put_line(v_empno(i)||' '||v_ename(i));
    END LOOP;
    END LOOP;
    END;
    P.S :---- department_id (used) = 50;
    Please can some one explain why this is happening like this.
    Thanks
    Raghu
    --------------------------------------------------------------------------------

    Hi sundar,
    I am new to oracle and learning/trying to get the same output by using differnt methods,rather than using FOR LOOP ,I tried to use ref cursor with dynamic sql.I am in a belief that ref cursor's with dynamic sql are faster than FOR LOOP,irrespective of the size of data.Can you correct me if I am wrong.
    Coming back to ur reply,how should my statement look like,when using ref cursor
    with USING claus to sort data by asc/desc order.
    Thanks in advance
    Raghu

  • Cursor with for update clause problem

    Hi all,
    We are having this problem with Oracle 8.1.7 where in we have a cursor with for update clause. The PL/SQL script used to work fine with Oracle 8.0.5 but is causing problems with Oracle 8.1.7. What the script is ending up doing in 8.1.7 is that it updates only one record instead of updating close to 60000 which it used to do in Oracle 8.0.5
    The script just hangs after updating one record. We have replicated the same problem.
    Has anyone seen this error before and attained resolution?
    Thanks

    Hello ,
    I have found the same / very close to the same problem. I tried the code below in Oracle 10.2.0.1 and got the following error after the first loop.
    ORA-01002: fetch out of sequence
    ORA-06512: at "DEMO_TEST_RESEARCH_PKG", line 18
    ORA-06512: at line 7
    After trying to debug it , i thought i would try it in Oracle 9.0.2.0.7.0 , and to my suprise it worked fine.
    Am i missing something ? Thanks in advance , ...
    I have included the code i was running ...
    PROCEDURE WhereCurrentOf(Param1 IN NUMBER) IS
    v_title_eng ISSUES.TITLE_ENG%TYPE;
    v_issue_id ISSUES.ISSUE_ID%TYPE;
    CURSOR issues_cur
    IS
    SELECT issue_id,title_eng
    FROM issues
    WHERE title_eng IS NULL
    FOR UPDATE OF title_eng;
    BEGIN
    FOR i IN issues_cur
    LOOP
    FETCH issues_cur INTO v_issue_id,v_title_eng;
    EXIT WHEN issues_cur%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(v_issue_id||' This was the english title before : '||v_title_eng);
    v_title_eng := 'This is my title';
    UPDATE issues
    SET title_eng = v_title_eng
    WHERE CURRENT OF issues_cur;
    DBMS_OUTPUT.PUT_LINE(v_issue_id||' This is the english title after : '||v_title_eng);
    END LOOP;
    END WhereCurrentOf;

  • Ref cursors - 'with' clause

    I am working with a procedure which is returning a ref-cursor to a Java Call. Inside the procedure I see a statment like
    Open t_results for
    with rfq_companies AS
    select statement1),
    rfq_hierarchies AS
    select statement2),
    rfq_relnhierarchies AS
    select statement 3);
    Can anybody explain such an usage for opening a ref cursor ('WITH' clause)?. What is the effect of using this and how Java will interpret this?

    The procedure is still returning a REF CURSOR, regardless of the way the SELECT statements is created. There is no effect as far as Java is concerned.
    Read more on the WITH clause:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#sthref9697
    in the section: Subquery Factoring

  • How to deal with--errors occurred, no packages were upgraded

    This has only occurred to me once before, I think.
    I was running a pacman -Syu today and it was trying to upgrade kernel2612-cko2-swsusp2 with the new kernel26cko package. The old cko was installed by grabbing the pkgbuild, making and then installing. Pacman automatically picked up that there was a new version to supercede it.
    Yet, I get a ton of "exists in filesystem" errors, which ends with "errors occurred, no packages were upgraded."
    Now, I've been searching about the best way to deal with such situations. The common approach from previous posts is to force it, with the -f argument. Typically, there is a clause though, that you should only force when the files are owned by a package that pacman knows of. That is, if pacman -Qo [file] doesn't return anything, you are safe to force.
    But, in this instance, the offending files are owned, and pacman knows about it. So, what's the way forward? Removing the old package manually? Manually re/moving the conflicting files?
    Cheers

    i think there may be a problem in the sane package from testing. i installed smaller chunks of kde (kde-common, kdebase, kdeadmin, etc.) and they all went fine, but when i tried to install kdegraphics, it gave me the error
    [root@arch jerry]# pacman -S kdegraphics
    Targets: libungif-4.1.3-2 imlib-1.9.15-2 libgphoto2-2.1.6-2 libieee1284-0.2.10-2
    sane-1.0.16-2 fribidi-0.10.5-2 gimp-print-4.2.7-3 ghostscript-7.07.1-5
    t1lib-5.1.0-1 kdegraphics-3.4.2-3
    Total Package Size: 23.6 MB
    Proceed with upgrade? [Y/n]
    checking package integrity... done.
    loading package data... done.
    checking for file conflicts...
    error: the following file conflicts were found:
    sane: /usr/var: exists in filesystem
    errors occurred, no packages were upgraded.
    should this be filed as a bug report? i did a fresh install and did not have kde installed to begin with, but im pretty sure this happened also when trying to upgrade

  • Cursor ORDER BY Clause Changing Row Count In BULK COLLECT ... FOR LOOP?

    Oracle 10g Enterprise Edition Release 10.2.0.4.0 running on Windows Server 2003
    Oracle Client 10.2.0.2.0 running on Windows 2000
    I have some PL/SQL code that's intended to update a column in a table based on a lookup from another table. I started out by testing it with the UPDATE statement commented out, just visually inspecting the DBMS_OUTPUT results to see if it was sane. During this testing I added/changed the cursor ORDER BY clause to make it easier to read the output, and saw some strange results. I've run the code 3 times with:
    1. no ORDER BY clause
    2. ORDER BY with two columns (neither indexed)
    3. ORDER BY with one column (not indexed)
    and get three different "rows updated" counts - in fact, when using the ORDER BY clauses it appears that the code is processing more rows than without either ORDER BY clause. I'm wondering why adding / changing an ORDER BY <non-indexed column> clause in a cursor would affect the row count?
    The code structure is:
    TYPE my_Table_t IS TABLE OF table1%ROWTYPE ;
    my_Table my_Table_t ;
    CURSOR my_Cursor IS SELECT * FROM table1 ; -- initial case - no ORDER BY clause
    -- ORDER BY table1.column1, table1.column2 ; -- neither column indexed
    -- ORDER BY table1.column2 ; -- column not indexed
    my_Loop_Count NUMBER := 0 ;
    OPEN my_Cursor ;
    LOOP
    FETCH my_Cursor BULK COLLECT INTO my_Table LIMIT 100 ;
    EXIT WHEN my_Table.COUNT = 0 ;
    FOR i IN 1..my_Table.COUNT LOOP
    my_New_Value := <call a pkg.funct to retrieve expected value from another table> ;
    EXIT WHEN my_New_Value IS NULL ;
    EXIT WHEN my_New_Value = <an undesirable value> ;
    IF my_New_Value <> my_Table(i).column3 THEN
    DBMS_OUTPUT.PUT_LINE( 'Changing ' || my_Table(i).column3 || ' to ' || my_New_Value ) ;
    UPDATE table1 SET column3 = my_New_Value WHERE column_pk = my_Table(i).column_pk ;
    my_Loop_Count := my_Loop_Count + 1 ;
    END IF ;
    END LOOP ;
    COMMIT ;
    END LOOP ;
    CLOSE my_Cursor ;
    DBMS_OUTPUT.PUT_LINE( 'Processed ' || my_Loop_Count || ' Rows ' ) ;

    Hello (and welcome),
    Your handling the inner cursor exit control is suspect, which will result in (seemingly) erratic record counts.
    Instead of:
    LOOP
    FETCH my_Cursor BULK COLLECT INTO my_Table LIMIT 100 ;
    EXIT WHEN my_Table.COUNT = 0 ;
    FOR i IN 1..my_Table.COUNT LOOP
    my_New_Value := <call a pkg.funct to retrieve expected value from another table> ;
    EXIT WHEN my_New_Value IS NULL ;
    EXIT WHEN my_New_Value = <an undesirable value> ;
    IF my_New_Value my_Table(i).column3 THEN
    DBMS_OUTPUT.PUT_LINE( 'Changing ' || my_Table(i).column3 || ' to ' || my_New_Value ) ;
    UPDATE table1 SET column3 = my_New_Value WHERE column_pk = my_Table(i).column_pk ;
    my_Loop_Count := my_Loop_Count + 1 ;
    END IF ;
    END LOOP ;
    COMMIT ;
    END LOOP ;Try this:
    LOOP
    FETCH my_Cursor BULK COLLECT INTO my_Table LIMIT 100 ;
    FOR i IN 1..my_Table.COUNT LOOP
    my_New_Value := <call a pkg.funct to retrieve expected value from another table> ;
    EXIT WHEN my_New_Value IS NULL ;
    EXIT WHEN my_New_Value = <an undesirable value> ;
    IF my_New_Value my_Table(i).column3 THEN
    DBMS_OUTPUT.PUT_LINE( 'Changing ' || my_Table(i).column3 || ' to ' || my_New_Value ) ;
    UPDATE table1 SET column3 = my_New_Value WHERE column_pk = my_Table(i).column_pk ;
    my_Loop_Count := my_Loop_Count + 1 ;
    END IF ;
    EXIT WHEN my_Cursor%NOTFOUND;
    END LOOP ;
    END LOOP ;
    COMMIT ;Which also takes the COMMIT outside of the LOOP -- try to never have a COMMIT inside of any LOOP.
    Additionally, not too sure about these:
    my_New_Value := <call a pkg.funct to retrieve expected value from another table> ;
    EXIT WHEN my_New_Value IS NULL ;
    EXIT WHEN my_New_Value = <an undesirable value> ;Any one of those EXITs will bypass your my_Loop_Count increment.
    Edited by: SeánMacGC on Jul 9, 2009 8:37 AM
    Had the cursor not found in the wrong place, now corrected.

  • For update cursor with nowait

    I have a 'for update' cursor defined with 'NOWAIT'. When soem of teh records that are supposed to be fetched by teh cursor are locked by another user for update..teh pl?SQL script returns
    "ORA-00054: resource busy and acquire with NOWAIT specified" error.
    If I declare teh cursor with out 'FOR UPDATE' or did NOT put 'NOWAIT' clause, teh script hangs waiting for teh records to be unlocked.
    If the user opens a record in the front end (web app) and does not close it.. i can not run the script. Is theer any way to ignore those records that are locked by other users and query only ones that are available as part of the select statement in the cursor.

    Optimistic locking implies, essentailly, that you never lock the row. Instead, if you want to update the row, you check all the other columns of the row to see whether they have changed. In other words, you'd do a straight SELECT here and then when you went to UPDATE the data, you'd do
    UPDATE <<change some column>>
    WHERE col1=<<old col1 value>>
       AND col2=<<old col2 value>>
       AND ...If the update changed 1 row, you're set. If it changed 0 rows, someone had changed the underlying row since you SELECTED it, so you'd have to handle that condition. If it returned an error indicating that someone else had locked the row, you could handle that situation as well. If you just continue on, however, be sure that you know how to identify that this row wasn't updated so you can try to do the update the next time (assuming that makes sense).
    If all your applications take the optimistic locking approach, you're pretty much guaranteed that no one else will have teh row locked, so you don't have to handle that state nearly as robustly.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • PL/SQL: Populating Cursor with List then do IF EXISTS against Table

    Here is my issue. The DB I work with is an Event Database (Network Events). I have a task to take a list of 2600 nodes and see if these nodes exist with in a set of events which would be found with a certain WHERE clause. On my first pass, I did the WHERE clause AND NODE in (List of 2600 nodes). Well you can only put 1000 items in an in list so I split it up into 3 reports and then did a UNION all between them. This used 15% of db resources and ran for hours and the dba group would like me to find a better way. They would prefer that I use PL/SQL.
    I'm new to pl/sql (but not to programming nor sql). So the first thing I did is just figure out how to get my list into an Varray, which I then switched to a table because I could not find any examples, after hours and hours of searching the web,
    of referencing a Varray with SQL syntax.
    ******** BEGIN CODE Sample 1 ***********
    DECLARE
    DECLARE
    TYPE NodeList IS TABLE OF VARCHAR2(255);
    Nodes NodeList := NodeList('node1', node2', [......list of 2597 nodes..], 'node2600')
    BEGIN
    dbms_output.enable(1000000);
    FOR i IN Nodes.FIRST .. Nodes.LAST
    LOOP
    DBMS_OUTPUT.PUT_LINE('Relevant Items: ' || Nodes(i));
    END LOOP;
    END
    ******** END CODE Sample 1 ***********
    The pseudocode I'm envisioning goes something like this:
    IF any of these nodes (2600 node list) ,
    exist in the nodes for this WHERE clause (which is pulling from the db event table),
    then print out the records (of the events in the db event table) that contain those nodes (i.e the nodes from the list).
    I think I found an example of doing this with 2 cursors but I cant find that example again. And, anyway, I cant figure out how to get my list into a cursor. I have many examples of how to fill a cursor via a select against a db.
    I tried this but it did not work:
    ******** BEGIN CODE Sample 2 ***********
    DECLARE
    DECLARE
    TYPE NodeList IS TABLE OF VARCHAR2(255);
    Nodes NodeList := NodeList('node1', node2', [......list of 2597 nodes..], 'node2600')
    CURSOR MOM_OVO_NODES IS
    SELECT Node
    FROM NodeList
    ORDER BY Node;
    BEGIN
    dbms_output.enable(1000000);
    FOR nodelist_rec IN MOM_OVO_NODES
    LOOP
    dbms_output.put_line('Relevant Nodes: '||nodelist_rec.node);
    END LOOP;
    END
    ******** END CODE Sample 2 ***********
    Is there a way to get this list into a cursor? Or am I thinking about the whole thing incorrectly?
    brad

    Every time I come to OTN thinking I finally have a reason to use PL/SQL, I find that I really only need SQL! I'm never going to get to learn PL/SQL! :)
    Thanks for the link. The information is well written.
    Unfortunately, I dont have the rights to create a GTT table. I get ORA-01031.
    I work for a very large organization where even the DBA's are so task individualized that many of them can only do very specific tasks. So I dont see myself getting rights to create even temporary tables. That would probably take and act of God.
    So, accepting that pl/sql is NOT the best practices solution here. I'd still like to , as an exercise for the student, understand how I can populate a cursor with a list. Why wont my example work? Since I could ONLY find examples of using SELECT to populate a cursor, I turned my VARRAY into a table. Then I learned that I could initialize the table in the DECLARE section. Then I put my cursor declaration after the table initialization. Still no luck. Then I saw casting as TABLE mentioned but got nowhere with that. IS there a way to get that list into a cursor? Its really bothering me.
    Also, since its a table, and, as far as I know, in referring to a table, one needs to reference a column, what is the syntax for naming the single column in my table?
    I AM reading the pl/sql books on Safari, and I do have the 10lb tome from Steven Feuerstein sitting next to me. <-- I'd page through it more often if I could find a reason to use PL/SQL. Actually, the DBA group has mandated that I write everything in PL/SQL for "performance" reasons. I dont actually adhere to that but there it is.
    Also, whats the protocol for giving credit for answers on threads like this where several people give relatively the same answer? Do I just give the earliest time stamp full credit or give them all a "helpful"?
    brad

  • Problems with Adobe Creative Cloud Packager

    Hello Community
    I have a problem with the Creative cloud packager.
    i can pakage fine but when i try to install the package on another mac it simply says installation failed after a few minutes, i can see it installs Adobe Bridge in the launchpad but nothing more.
    The package includes Photoshop , Bridge, Muse, Premiere, Illustrator, Indesign, After Effects,l Dreamweaver, incopy, lightroom,
    The install works fine if i try to install it on the mac i made the package with
    The mac im trying to install on is a imac 27 " 5K osx 10.10

    Hi KwKn,
    Does it work on the machine on which you are creating the package?
    Do you have any security software running on the machine?
    Also I would request you to go through the below link.
    Creative Cloud Help | Packager
    Regards,
    Anand

  • Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • I am trying to install iTunes on my PC, but I get this error: "There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor." Help!

    I am trying to install iTunes on my PC (using Windows 8.1), but I get this error: "There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor." The iTunes file (64-bit) I am trying to install, is named "iTunes64Setup.exe". What seems to be the problem? Help!

    Hey madnest,
    Thanks for the question. After reviewing your post, it sounds like you are having difficulty installing iTunes in Windows. I would recommend that you read this article, it may be able to help you resolve or isolate the issue.
    Issues installing iTunes or QuickTime for Windows
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Need to increase performance-bulk collect in cursor with limit and in the for loop inserting into the trigger table

    Hi all,
    I have a performance issue in the below code,where i am trying to insert the data from table_stg into target_tab and in parent_tab tables and then to child tables via cursor with bulk collect .the target_tab and parent_tab are huge tables and have a row wise trigger enabled on it .the trigger is mandatory . This timetaken for this block to execute is 5000 seconds.Now my requirement is to reduce it to 5 to 10 mins.
    can someone please guide me here.Its bit urgent .Awaiting for your response.
    declare
    vmax_Value NUMBER(5);
      vcnt number(10);
      id_val number(20);
      pc_id number(15);
      vtable_nm VARCHAR2(100);
      vstep_no  VARCHAR2(10);
      vsql_code VARCHAR2(10);
      vsql_errm varchar2(200);
      vtarget_starttime timestamp;
      limit_in number :=10000;
      idx           number(10);
              cursor stg_cursor is
             select
                   DESCRIPTION,
                   SORT_CODE,
                   ACCOUNT_NUMBER,
                     to_number(to_char(CORRESPONDENCE_DATE,'DD')) crr_day,
                     to_char(CORRESPONDENCE_DATE,'MONTH') crr_month,
                     to_number(substr(to_char(CORRESPONDENCE_DATE,'DD-MON-YYYY'),8,4)) crr_year,
                   PARTY_ID,
                   GUID,
                   PAPERLESS_REF_IND,
                   PRODUCT_TYPE,
                   PRODUCT_BRAND,
                   PRODUCT_HELD_ID,
                   NOTIFICATION_PREF,
                   UNREAD_CORRES_PERIOD,
                   EMAIL_ID,
                   MOBILE_NUMBER,
                   TITLE,
                   SURNAME,
                   POSTCODE,
                   EVENT_TYPE,
                   PRIORITY_IND,
                   SUBJECT,
                   EXT_PRD_ID_TX,
                   EXT_PRD_HLD_ID_TX,
                   EXT_SYS_ID,
                   EXT_PTY_ID_TX,
                   ACCOUNT_TYPE_CD,
                   COM_PFR_TYP_TX,
                   COM_PFR_OPT_TX,
                   COM_PFR_RSN_CD
             from  table_stg;
    type rec_type is table of stg_rec_type index by pls_integer;
    v_rt_all_cols rec_type;
    BEGIN
      vstep_no   := '0';
      vmax_value := 0;
      vtarget_starttime := systimestamp;
      id_val    := 0;
      pc_id     := 0;
      success_flag := 0;
              vstep_no  := '1';
              vtable_nm := 'before cursor';
        OPEN stg_cursor;
              vstep_no  := '2';
              vtable_nm := 'After cursor';
       LOOP
              vstep_no  := '3';
              vtable_nm := 'before fetch';
    --loop
        FETCH stg_cursor BULK COLLECT INTO v_rt_all_cols LIMIT limit_in;
                  vstep_no  := '4';
                  vtable_nm := 'after fetch';
    --EXIT WHEN v_rt_all_cols.COUNT = 0;
        EXIT WHEN stg_cursor%NOTFOUND;
    FOR i IN 1 .. v_rt_all_cols.COUNT
      LOOP
       dbms_output.put_line(upper(v_rt_all_cols(i).event_type));
        if (upper(v_rt_all_cols(i).event_type) = upper('System_enforced')) then
                  vstep_no  := '4.1';
                  vtable_nm := 'before seq sel';
              select PC_SEQ.nextval into pc_id from dual;
                  vstep_no  := '4.2';
                  vtable_nm := 'before insert corres';
              INSERT INTO target1_tab
                           (ID,
                            PARTY_ID,
                            PRODUCT_BRAND,
                            SORT_CODE,
                            ACCOUNT_NUMBER,
                            EXT_PRD_ID_TX,         
                            EXT_PRD_HLD_ID_TX,
                            EXT_SYS_ID,
                            EXT_PTY_ID_TX,
                            ACCOUNT_TYPE_CD,
                            COM_PFR_TYP_TX,
                            COM_PFR_OPT_TX,
                            COM_PFR_RSN_CD,
                            status)
             VALUES
                            (pc_id,
                             v_rt_all_cols(i).party_id,
                             decode(v_rt_all_cols(i).product_brand,'LTB',2,'HLX',1,'HAL',1,'BOS',3,'VER',4,0),
                             v_rt_all_cols(i).sort_code,
                             'XXXX'||substr(trim(v_rt_all_cols(i).ACCOUNT_NUMBER),length(trim(v_rt_all_cols(i).ACCOUNT_NUMBER))-3,4),
                             v_rt_all_cols(i).EXT_PRD_ID_TX,
                             v_rt_all_cols(i).EXT_PRD_HLD_ID_TX,
                             v_rt_all_cols(i).EXT_SYS_ID,
                             v_rt_all_cols(i).EXT_PTY_ID_TX,
                             v_rt_all_cols(i).ACCOUNT_TYPE_CD,
                             v_rt_all_cols(i).COM_PFR_TYP_TX,
                             v_rt_all_cols(i).COM_PFR_OPT_TX,
                             v_rt_all_cols(i).COM_PFR_RSN_CD,
                             NULL);
                  vstep_no  := '4.3';
                  vtable_nm := 'after insert corres';
        else
              select COM_SEQ.nextval into id_val from dual;
                  vstep_no  := '6';
                  vtable_nm := 'before insertcomm';
          if (upper(v_rt_all_cols(i).event_type) = upper('REMINDER')) then
                vstep_no  := '6.01';
                  vtable_nm := 'after if insertcomm';
              insert into parent_tab
                 (ID ,
                 CTEM_CODE,
                 CHA_CODE,            
                 CT_CODE,                           
                 CONTACT_POINT_ID,             
                 SOURCE,
                 RECEIVED_DATE,                             
                 SEND_DATE,
                 RETRY_COUNT)
              values
                 (id_val,
                  lower(v_rt_all_cols(i).event_type), 
                  decode(v_rt_all_cols(i).product_brand,'LTB',2,'HLX',1,'HAL',1,'BOS',3,'VER',4,0),
                  'Email',
                  v_rt_all_cols(i).email_id,
                  'IADAREMINDER',
                  systimestamp,
                  systimestamp,
                  0);  
         else
                vstep_no  := '6.02';
                  vtable_nm := 'after else insertcomm';
              insert into parent_tab
                 (ID ,
                 CTEM_CODE,
                 CHA_CODE,            
                 CT_CODE,                           
                 CONTACT_POINT_ID,             
                 SOURCE,
                 RECEIVED_DATE,                             
                 SEND_DATE,
                 RETRY_COUNT)
              values
                 (id_val,
                  lower(v_rt_all_cols(i).event_type), 
                  decode(v_rt_all_cols(i).product_brand,'LTB',2,'HLX',1,'HAL',1,'BOS',3,'VER',4,0),
                  'Email',
                  v_rt_all_cols(i).email_id,
                  'CORRESPONDENCE',
                  systimestamp,
                  systimestamp,
                  0); 
            END if; 
                  vstep_no  := '6.11';
                  vtable_nm := 'before chop';
             if (v_rt_all_cols(i).ACCOUNT_NUMBER is not null) then 
                      v_rt_all_cols(i).ACCOUNT_NUMBER := 'XXXX'||substr(trim(v_rt_all_cols(i).ACCOUNT_NUMBER),length(trim(v_rt_all_cols(i).ACCOUNT_NUMBER))-3,4);
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 'IB.Correspondence.AccountNumberMasked',
                 v_rt_all_cols(i).ACCOUNT_NUMBER);
             end if;
                  vstep_no  := '6.1';
                  vtable_nm := 'before stateday';
             if (v_rt_all_cols(i).crr_day is not null) then 
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 --'IB.Correspondence.Date.Day',
                 'IB.Crsp.Date.Day',
                 v_rt_all_cols(i).crr_day);
             end if;
                  vstep_no  := '6.2';
                  vtable_nm := 'before statemth';
             if (v_rt_all_cols(i).crr_month is not null) then 
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 --'IB.Correspondence.Date.Month',
                 'IB.Crsp.Date.Month',
                 v_rt_all_cols(i).crr_month);
             end if;
                  vstep_no  := '6.3';
                  vtable_nm := 'before stateyear';
             if (v_rt_all_cols(i).crr_year is not null) then 
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)
              values
                (id_val,
                 --'IB.Correspondence.Date.Year',
                 'IB.Crsp.Date.Year',
                 v_rt_all_cols(i).crr_year);
             end if;
                  vstep_no  := '7';
                  vtable_nm := 'before type';
               if (v_rt_all_cols(i).product_type is not null) then
                  insert into child_tab
                     (COM_ID,                                            
                     KEY,                                                                                                                                        
                     VALUE)
                  values
                    (id_val,
                     'IB.Product.ProductName',
                   v_rt_all_cols(i).product_type);
                end if;
                  vstep_no  := '9';
                  vtable_nm := 'before title';         
              if (trim(v_rt_all_cols(i).title) is not null) then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE )
              values
                (id_val,
                 'IB.Customer.Title',
                 trim(v_rt_all_cols(i).title));
              end if;
                  vstep_no  := '10';
                  vtable_nm := 'before surname';
              if (v_rt_all_cols(i).surname is not null) then
                insert into child_tab
                   (COM_ID,                                            
                   KEY,                                                                                                                                          
                   VALUE)
                values
                  (id_val,
                  'IB.Customer.LastName',
                  v_rt_all_cols(i).surname);
              end if;
                            vstep_no  := '12';
                            vtable_nm := 'before postcd';
              if (trim(v_rt_all_cols(i).POSTCODE) is not null) then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)                              
               values
                (id_val,
                 'IB.Customer.Addr.PostCodeMasked',
                  substr(replace(v_rt_all_cols(i).POSTCODE,' ',''),length(replace(v_rt_all_cols(i).POSTCODE,' ',''))-2,3));
              end if;
                            vstep_no  := '13';
                            vtable_nm := 'before subject';
              if (trim(v_rt_all_cols(i).SUBJECT) is not null) then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)                              
               values
                (id_val,
                 'IB.Correspondence.Subject',
                  v_rt_all_cols(i).subject);
              end if;
                            vstep_no  := '14';
                            vtable_nm := 'before inactivity';
              if (trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) is null or
                  trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) = '3' or
                  trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) = '6' or
                  trim(v_rt_all_cols(i).UNREAD_CORRES_PERIOD) = '9') then
              insert into child_tab
                 (COM_ID,                                            
                 KEY,                                                                                                                                            
                 VALUE)                              
               values
                (id_val,
                 'IB.Correspondence.Inactivity',
                  v_rt_all_cols(i).UNREAD_CORRES_PERIOD);
              end if;
                          vstep_no  := '14.1';
                          vtable_nm := 'after notfound';
        end if;
                          vstep_no  := '15';
                          vtable_nm := 'after notfound';
        END LOOP;
        end loop;
                          vstep_no  := '16';
                          vtable_nm := 'before closecur';
        CLOSE stg_cursor;
                          vstep_no  := '17';
                          vtable_nm := 'before commit';
        DELETE FROM table_stg;
      COMMIT;
                          vstep_no  := '18';
                          vtable_nm := 'after commit';
    EXCEPTION
    WHEN OTHERS THEN
      ROLLBACK;
      success_flag := 1;
      vsql_code := SQLCODE;
      vsql_errm := SUBSTR(sqlerrm,1,200);
      error_logging_pkg.inserterrorlog('samp',vsql_code,vsql_errm, vtable_nm,vstep_no);
      RAISE_APPLICATION_ERROR (-20011, 'samp '||vstep_no||' SQLERRM:'||SQLERRM);
    end;
    Thanks

    Its bit urgent
    NO - it is NOT urgent. Not to us.
    If you have an urgent problem you need to hire a consultant.
    I have a performance issue in the below code,
    Maybe you do and maybe you don't. How are we to really know? You haven't posted ANYTHING indicating that a performance issue exists. Please read the FAQ for how to post a tuning request and the info you need to provide. First and foremost you have to post SOMETHING that actually shows that a performance issue exists. Troubleshooting requires FACTS not just a subjective opinion.
    where i am trying to insert the data from table_stg into target_tab and in parent_tab tables and then to child tables via cursor with bulk collect .the target_tab and parent_tab are huge tables and have a row wise trigger enabled on it .the trigger is mandatory . This timetaken for this block to execute is 5000 seconds.Now my requirement is to reduce it to 5 to 10 mins.
    Personally I think 5000 seconds (about 1 hr 20 minutes) is very fast for processing 800 trillion rows of data into parent and child tables. Why do you think that is slow?
    Your code has several major flaws that need to be corrected before you can even determine what, if anything, needs to be tuned.
    This code has the EXIT statement at the beginning of the loop instead of at the end
        FETCH stg_cursor BULK COLLECT INTO v_rt_all_cols LIMIT limit_in;
                  vstep_no  := '4';
                  vtable_nm := 'after fetch';
    --EXIT WHEN v_rt_all_cols.COUNT = 0;
        EXIT WHEN stg_cursor%NOTFOUND;
    The correct place for the %NOTFOUND test when using BULK COLLECT is at the END of the loop; that is, the last statement in the loop.
    You can use a COUNT test at the start of the loop but ironically you have commented it out and have now done it wrong. Either move the NOTFOUND test to the end of the loop or remove it and uncomment the COUNT test.
    WHEN OTHERS THEN
      ROLLBACK;
    That basically says you don't even care what problem occurs or whether the problem is for a single record of your 10,000 in the collection. You pretty much just throw away any stack trace and substitute your own message.
    Your code also has NO exception handling for any of the individual steps or blocks of code.
    The code you posted also begs the question of why you are using NAME=VALUE pairs for child data rows? Why aren't you using a standard relational table for this data?
    As others have noted you are using slow-by-slow (row by row processing). Let's assume that PL/SQL, the bulk collect and row-by-row is actually necessary.
    Then you should be constructing the parent and child records into collections and then inserting them in BULK using FORALL.
    1. Create a collection for the new parent rows
    2. Create a collection for the new child rows
    3. For each set of LIMIT source row data
      a. empty the parent and child collections
      b. populate those collections with new parent/child data
      c. bulk insert the parent collection into the parent table
      d. bulk insert the child collection into the child table
    And unless you really want to either load EVERYTHING or abandon everything you should use bulk exception handling so that the clean data gets processed and only the dirty data gets rejected.

  • I keep getting the following error message when I try to update my itunes, "There is a problem with this windows installer package. Aprogram run as part of the set up did not finish as expected.  Contact your support personnel or package vendor."

    I keep getting the following error message when I try to update my itunes, "There is a problem with this windows installer package. Aprogram run as part of the set up did not finish as expected.  Contact your support personnel or package vendor."

    Yes, I had found a similar solution also.  I'm running XP Pro, SP3.  I went Control Panels/ Add-Remove programmes/apple software update/ change/ repair.  Then run the 10.5 exe.
    While the programme updated from version 8 of iTunes, my new iTunes is now a mess.  Not all of my music was in the same folder previously but it all showed up on iTunes.  Now many albums have been left out, some have only a few tracks and some have two copies of some tracks as well as having other tracks missing.  I haven't begun to work on that.

Maybe you are looking for

  • How can I crop a pdf document?

    Sorry for such an elementary question.  Here's a typical situation: I scanned a part of our local newspaper'e editorial page and saved it using Acrobat X.  The document includes a cartoon--which is the part I want--and other text that I don't want. 

  • Lync 2013 Clients prompting repeatedly for credentials for calendar data from outlook

    Our Exchange server had crashed recently (nothing major) and a reboot of the CAS server resolved the issues. However since then all our domain computers with Lync 2013 clients are prompting for credentials for calendar data from outlook. We would but

  • CD/DVD Burning Question

    I'm trying to burn an MP3 disc and I seem to be having an issue. I'm using Memorex CD discs. When I burn an MP3 disc and try to play it in my car, my car can't read the disc or it might read it but doesnt play correctly. When I use my Toshiba laptop

  • SAP-XI, permission of the instance.properties file changes unexpectedly

    Hi forum, I have XI installed in HP-UX, the permission of the instance.properties file (/usr/sap/<SID>/<instance name>/j2ee/cluster/instance.properties) in my XI system (installed in HP-UX), changes automatically, and hence the server starts giving p

  • Loading web links from Outlook to Safari error

    When I click on a link in an email, Outlook returns an error message: General Failure: The URL "http:// "whatever" The system cannot find the file specified It doesn't return this error with Mozilla or any other browser.