LOOP DOUBT INSIDE  PACKAGE

CREATE PACKAGE EMP_PKG AS
CURSOR EMP_CUR IS
SELECT EMPNO,DEPTNO,SAL,HIREDATE
FROM EMP
WHERE DEPTNO=30;
PROCEDURE P_EMP;
PROCEDURE P_GET_SAL(V_EMPNO NUMBER);
PROCEDURE P_GET_LOC(V_EMPNO NUMBER);
Now inside my Package Body
INSIDE THE MAINPROCEDURE P_EMP
I WILL BE CALLING THE BELOW TWO PROCEDURES
PROCEDURE P_EMP
BEGIN
FOR I IN EMP_CUR LOOP
P_GET_SAL(I.EMPNO);-- DO I NEED TO LOOP AGAIN IN P_GET_SAL PROC?
P_GET_LOC(I.DEPTNO);
END LOOP;
END;
NOW WHAT IAM DOING IS
in my P_GET_SAL Procedure is
PROCEDURE P_GET_SAL(V_EMPNO NUMBER)
V_SAL EMP.SAL%TYPE;
BEGIN
FOR I IN EMP_CUR LOOP
SELECT SAL INTO V_SAL FROM EMP
WHERE EMPNO=I.EMPNO --DOUBT HERE
END;
I WANT TO KNOW WHETHER I NEED TO LOOP AGAIN
HERE OR INSTEAD OF THAT
PROCEDURE P_GET_SAL(V_EMPNO NUMBER)
V_SAL EMP.SAL%TYPE;
BEGIN
SELECT SAL INTO V_SAL FROM EMP
WHERE EMPNO =V_EMPNO;
END;
SINCE iam calling V_EMPNO WITH CURSOR FROM MY
MAINPROCEDURE ..
WILL THE PROCEDURE USES THE CURSOR VALUES
AND LOOP ITSELF FOR EVERY EMPLOYEE TO
GET THE SALALRY ?
PLEASE LET ME KNOW SINCE MY PACKAGE IS MORE THAN 3000
LINES I cant proceed unless its confirmed i can
do so ..

Hi all,
Thanks for Looking into my Problem
I Got answer by MySelf ..i dont need to loop again my sub procedures
if i try to do that iam getting the error
ERROR at line 1:
ORA-06511: PL/SQL: cursor already open
Thank you all once again ..

Similar Messages

  • How to disable spotlight searches inside packages

    Hi,
    I tagged all my files inside my document folder, now I'd like to create and save a smart folder searching for all the untagged files, just in case I create or move a file to that folder without tagging it first.
    The problem is that I have several files, which are packages with other files in them (created with Scrivener, Devonthink, OmniOutliner...). These other files aren't tagged (and I don't need nor want to tag them) so they are showed in my spotlight search.
    I can't exclude the folders containing these files in spotlight preference, since there are a lot of them and I often create new files of these kinds.
    I would like to tell spotlight not to search inside packages. Is that possible?
    thanks in advance,
    pietro

    You can't remove it so as it is fixed in the OS of the phone.

  • Getting the metadata of procedures defined inside packages...

    Dear All,
    i want to extract the metadata for procedures and functions in my db.
    i am using the DBMS_METADATA.GET_DDL(ObjectType,ObjectName) to get the metadata of certain objects (PROCEDURES,FUNCTIONS and PACKAGE_BODY)
    however this method is not quiet usefull when my target is to get the metadata for a single procedure/function defined inside package's body', where i dont need
    the whole package body to be returned only the specific Procedure/ Function defined in it...
    it seems that the Package Body is defined as one object regardless of how many Procedures / Functions are defined in it...
    isnt there any place/repository that stores the procedures and functions defined inside a package body along with their metadata explicitly one bye one , so i can
    extract them and search them one bye one...
    Thank you
    Basem Sayej...

    The whole point about defining procedures inside package bodies is that they are private. They are only exposed to those who have the necessary privileges to view the body's source code.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Bug: Export to QT with a looping video inside

    Hi,
    I posted on this exact same problem about a year ago for Keynote 2.x (or was it 1.x ?). The problem (feature, bug?) was and still is:
    I have a self running Keynote presentation (3.0.1). Inside this presentation are in some places looping QT movies. When I export the entire presentation to QT, the looping videos inside only run once (i.e. do not loop).
    As this did not get fixed in 3.0, either:
    a) this is a feature, not a bug
    b) no one from apple reads this list
    Regards,
    Gert

    Welcome back to the discussions, Gert.
    a) it's not a feature or a bug.
    When you export to QuickTime, you are taking all of the media and laying it out linearly. Since a loop isn't linear (start, play, end, back to beginning, play, end, etc), it gets removed.
    COULD Apple do this? Yes, but it would also mean that the exported movie would now be in an extra number of files and past experience indicates that this might be more confusing to the consumer (export a presentation with a background movie track and you'll see a "soundtrack" file).
    b) well someone has to read and moderate it to make sure we're not getting out of line, but this is a user to user discussion board first and foremost.

  • Packages inside packages

    I am trying to learn servlets. I am trying to get this simple servlets to work with a little encryption package I wrote. The Encryption file is inside the history folder.
    Here is the servlet:
    package history;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import Encryption.*;
    public class SignUp extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
             response.setContentType("text/html");
             PrintWriter out = response.getWriter();
             String title = "Reading Three Request Parameters";
                  String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " + "Transitional//EN\">\n";
             String name, pass1, pass2, encrypted;
             Encrypt encrypt = new Encrypt(); [red]//error is here[/red}
             name = request.getParameter("param1");
             pass1 = request.getParameter("param2");
             pass2 = request.getParameter("param3");
             if(!pass1.equals(pass2))
              out.println(docType + "<HTML>\n" +
                    "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
                    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
                    "<H1 ALIGN=\"CENTER\">" + title + "</H1>\n" +
                    "<UL>\n" + "ERROR" + "</UL>\n" +
                    "</BODY></HTML>");
             else
                  encrypted = encrypt.encode(name, pass1);
                  out.println(docType +
                    "<HTML>\n" +
                    "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
                    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
                    "<H1 ALIGN=\"CENTER\">" + title + "</H1>\n" +
                    "<UL>\n" +
                    "  <LI><B>param1</B>: "
                    + request.getParameter("param1") + "\n" +
                    "  <LI><B>param2</B>: "
                    + request.getParameter("param2") + "\n" +
                    "  <LI><B>param3</B>: "
                    + request.getParameter("param3") + "\n" +
                    + encrypted + "\n" +
                    "</UL>\n" +
                    "</BODY></HTML>");
    }This is the error:
    history/SignUp.java:6: package Encryption does not exist
    import Encryption.*;
    ^
    history/SignUp.java:26: cannot resolve symbol
    symbol : class Encrypt
    location: class history.SignUp
    Encrypt encrypt = new Encrypt();
    ^
    history/SignUp.java:26: cannot resolve symbol
    symbol : class Encrypt
    location: class history.SignUp
    Encrypt encrypt = new Encrypt();
    ^
    3 errors
    I tried this:
    import history.Ecryption.*;
    But got a different error:
    history/SignUp.java:26: cannot access history.Encryption.Encrypt
    bad class file: .\history\Encryption\Encrypt.class
    class file contains wrong class: Encryption.Encrypt
    Please remove or make sure it appears in the correct subdirectory of the classpa
    th.
    Encrypt encrypt = new Encrypt();
    ^
    1 error
    Any advice will be greatly appreciated.

    My guess is that in the Encrypt class, you probably have this:
    package Encryption;
    If it's to be under "history", then it should be:
    package history.Encryption;
    There's no such thing as sub packages, or packages inside packages. The directories the files are stored in are within that directory structure cuz that's how directories are, but packages are not parent/subpackage relationships. "history" and "history.Encryption" would be totally separate packages. This is why you can't do "import history.*" and get all the classes in "history.Encryption" as wel.
    Then your import in your servlet would be:
    import history.Encryption.*;

  • Error in using plsql record type inside packages

    Dear Friends,
    Using Ora9iR2 on Windows 2000 Server. I am trying to declare a record type and a nested table of that record type in the package body and the initialise that in the package body then insert records into that. But I receive error msg.
    CREATE OR REPLACE PACKAGE sample1 AS
    TYPE rcur IS REF CURSOR;
    TYPE emp_record IS RECORD
    (empname VARCHAR2(20),
    job VARCHAR2(10),
    salary NUMBER);
    TYPE emp_result IS TABLE OF emp_record;
    PROCEDURE emp_test ( i_empno emp.empno%TYPE);
    END sample1;
    -- Package Body
    CREATE OR REPLACE PACKAGE BODY sample1 AS
    PROCEDURE emp_test ( i_empno IN emp.empno%TYPE)AS
    c1 rcur;
    eresult emp_result := emp_result();
    v_empname VARCHAR2(20);
    v_job VARCHAR2(10);
    v_sal NUMBER;
    BEGIN
    OPEN c1 FOR SELECT ename,job,sal FROM emp WHERE empno = i_empno;
    LOOP FETCH c1 INTO v_empname,v_job,v_sal;
    EXIT WHEN c1%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(v_empname||' , '||v_job||' , '||v_sal);
    eresult := emp_result(v_empname,v_job,v_sal); showing error
    END LOOP;
    CLOSE c1;
    END emp_test;
    END sample1;
    While executing the procedure with out the line eresult := emp_result(v_empname,v_job,v_sal); the procedure executes fine.
    SQL> execute sample1.emp_test(7900);
    JAMES , CLERK , 950
    PL/SQL procedure successfully completed.
    With that line, i have error
    SQL> execute sample1.emp_test(7900);
    BEGIN sample1.emp_test(7900); END;
    ERROR at line 1:
    ORA-04068: existing state of packages has been discarded
    ORA-04063: package body "KUMAR.SAMPLE1" has errors
    ORA-06508: PL/SQL: could not find program unit being called
    ORA-06512: at line 1
    While executing in PL/SQL Developer, it says the wrong number or types of arguments call to ;EMP_RESULT'.
    Please guide me where I am wrong.
    Kumar

    I got invalide data type error.I think the datatype in the CAST() clause must be a SQL Type i.e. one created with a CREATE TYPE command in the database. emp_result is only a PL/SQL datatype.
    But I dont know why it is saying error
    eresult(eresult.count) := emp_result(v_empname,v_job,v_sal); eresult is a table of records. It is therefore expecting a record. records don't seem to be created in the same way that user defined types are.
    The concept of handling records like this is new to 9i and they are still smoothing out the bumps. Things are a lot better in 9.2 than in 9.0.1 if it's any consolation. There is a particular gap in the documentation, which is what's tripping you up at the moment: the difference between TYPE AS RECORD and other types, also the difference between VARRAY, NESTED TABLE and REF CURSOR. To be honest, it's all kind of hazy for me at the moment: I always need to run some code before I make any pronouncements on this topic.
    Good luck, APC

  • Using loop in dbms_advisor Package

    Dears,,
    I used dbms_advisor package as following below
    dbms_advisor.create_object
    task_name => name,
    object_type => 'TABLE',
    attr1 => 'HR',
    attr2 => 'Employees',
    attr3 => NULL,
    attr4 => NULL,
    attr5 => NULL,
    object_id => obj_id
    what i need is to use loop to retrieve all tables at once then use them one by one in the script above without inserting table name myself.
    In another meaning (See the following):
    * loop to retrieve all tables
    * dbms_advisor.create_object
    task_name => name,
    object_type => 'TABLE',
    attr1 => 'HR',
    attr2 => 'TAB', Which TAB retrieved from loop one by one by itself
    attr3 => NULL,
    attr4 => NULL,
    attr5 => NULL,
    object_id => obj_id
    * end loop;
    How can i make this please?
    Thanks & Regards,,
    Edited by: . . Oracle DBA . . on Apr 10, 2011 5:56 AM

    . . Oracle DBA . . wrote:
    How can i make this please?
    begin
        for v_rec in (select owner,table_name from dba_tables) loop
          dbms_advisor.create_object(
                                     task_name => v_rec.owner || '_' || v_rec.table_name,
                                     object_type => 'TABLE',
                                     attr1 => v_rec.owner,
                                     attr2 => v_rec.table_name,
                                     attr3 => NULL,
                                     attr4 => NULL,
                                     attr5 => NULL,
                                     object_id => obj_id
        end loop;
    end;
    /SY.

  • Handling errors on looping through a package

    Here is my issue:
    I am tyring to call a package in a loop to index rows into oracle text index 10g. When called by the app, sometimes its valid that data will be gone by the time its indexed and the package errors out and writes to a table my ora error of no data found.
    This works fine until:
    The application is calling my package and seems to have timing issues on creation of the index item compared to the call so for the interim (not permanent) I wanted to call my package and pass it every number that was in one table and missing from another.
    This logic is easy and I got it to work splendidly in minutes as an print out in a cursor in a procedure I was going to call every so often with a job... but (there's always a but) it errors out with my no data found error and kills the entire loop and I don't get to finish processing the rogue numbers.
    I know this is a hack... please forgive this. I just need an idea of how one might loop and call this procedure and pass it the numbers individually... not in a list like my cursor. The syntax itself I can probably slice and dice my way through its the concept I am missing...
    Thanks in advance for your time and knowledge,
    Va

    Assuming that you are calling the stored procedure and passing it values from the cursor, and that it a select statement in the stored procedure that raises no_data_found, then Justin's code should allow you to keep going with the other records from the cursor.
    By "handling" the no_data_found exception within the loop (even if that handling is do nothing), it goes away and your code will continue with the next statement. As a quick demo:
    SQL> SELECT * FROM t;
            ID S
             1 A
             2 B
             1 C
    SQL> DECLARE
      2     l_dummy VARCHAR2(1);
      3  BEGIN
      4     FOR r IN (SELECT id, sorter FROM t
      5               ORDER BY sorter) LOOP
      6        BEGIN
      7           SELECT dummy INTO l_dummy
      8           FROM dual
      9           WHERE 1 = r.id;
    10           DBMS_OUTPUT.Put_Line('Success with '||r.sorter);
    11        EXCEPTION WHEN NO_DATA_FOUND THEN
    12           DBMS_OUTPUT.Put_Line('No data with '||r.sorter);
    13        END;
    14     END LOOP;
    15  END;
    16  /
    Success with A
    No data with B
    Success with C
    PL/SQL procedure successfully completed.Here, my select from dual is equivalent to your procedure call.
    HTH
    John

  • Doubts on packages

    hi gurus
    i'm new to sap bw and new to sdn ,and i heard that sdn is a place where we can clarify our doubts very clearly
    i'm very much confusion abt info packages
    1)  suppose if u have full loads infopackage  , and then i want to change full load infopackage into delta ,is that necessary that i want to create seperate infopackage for for delta ,r can i create in the same package ...And wat are the option we do when we create infopackage ,give me really time scenario
    2) i heard that loadin data from MM is entirely differnet from SD,PP can i know where can i get this difference if u has any note on the extraction
    regards
    ram

    hi to alll
    thanx  to all for replying
    pushpa  my question that is that we have to create int delta on full infopackage r else  creating another infopackage  which  we give int and create for delta for that infopackage
    i'm still confused reagrding this   full,int ,delta package
    i'll appriciate if you explain me clear regarding this infopackage
    regards
    ram

  • Toad- See functions inside packages.

    I use Toad for my Oracle data bases. So here i have oracle packages which i can see by clicking 'Packages' button in Toad. I have functions in those packages but i can't see those functions. When i scroll over to 'Functions' button its all empty. I get "insufficient privileges" note if i am locked to it but that not the case i am assuming. How do i see the code in for a particular function inside a package. Help me. Thanks in advance.

    >
    I use Toad for my Oracle data bases. So here i have oracle packages which i can see by clicking 'Packages' button in Toad. I have functions in those packages but i can't see those functions. When i scroll over to 'Functions' button its all empty. I get "insufficient privileges" note if i am locked to it but that not the case i am assuming. How do i see the code in for a particular function inside a package.
    >
    You don't. You can see the entire package code by expanding the package body in the navigation tree. Then you can select your function in the tree and double-click it and in the editor you will be positioned at that function.
    The functions and procedure tabs are for standalone objects.

  • Sy-tabix in loop : Doubt

    LOOP AT i_lfa1 INTO wa_lfa1 WHERE werks = space.       
       wf_tabix = sy-tabix.                                 
       APPEND wa_lfa1 TO i_lfa1_werks.                      
       DELETE i_lfa1 index wf_tabix.                        
    ENDLOOP.                                               
    in the above code the sy-tabix is always 2.
    what i want to know is if there is a where clause , should we not use the sy-tabix for deletion.

    >
    Keshav.T wrote:
    > May be ill  get something from sap help.
    Hello Keshav,
    As a matter of fact , I always do
    SAP says:
    If you delete the current line or lines in front of the current line, the internal loop counter is decreased by one with each deleted line. In the case of loops on index tables or if using a sorted key, this affects sy-tabix in the subsequent loop pass, and sy-tabix is decreased accordingly
    @Dzed: Hail SAP Help !!! Anyways this was common sense & i dont think SAP processor is dumb
    Cheers,
    Suhas
    Edited by: Suhas Saha on Jan 28, 2010 6:46 PM

  • Doubts in packages........

    package in.trial.use;
    public class sample
    public static void main()
    when i run this program, it gives the following error
    " Exception in thread "main" java.lang.NoClassDefFoundError: in/trial/use/sample"
    i am running this program from in/trial/use directory... i am confused. this directory has some other classes and in my sample.java program i am trying to access some public fields in that. Can you tell me where i am wrong?

    The package is simply not in your classpath. Make sure that if you have abc/in/trial/use, that abc is listed in your classpath. Or move to abc and run java -cp . in.trial.use.sample

  • [SOLVED]Search inside packages for future actions

    Hi!
    I have had some troubles when I downloaded a lot of fonts and used makefontpkg script for making installation packages for them. The problem was that all files created by makepkg was automatically moved to the predefined folder and got mixed with other packages there. Then, I decided to make a new folder for them and for an easy way to move all of the font install packages I made a script.
    Here is just an example of it:
    #!/bin/bash
    for InFile in *.xz ;
    do GetDescription=$(tar -xOf $InFile .PKGINFO | grep 'pkgdesc = ' | grep font | awk '{print $1}' );
    if [ "x"$GetDescription != "x" ] ;
    then
    echo This $InFile package contains "font" in the description;
    ### mv $InFile ./FontInstallPackages
    fi;
    done;
    I hope this will be useful for someone
    Last edited by Andy_Crowd (2014-04-09 19:42:00)

    I would suggest neither the caption nor the description. They each have their own purpose and overloading them is not necessary.
    Personally, I prefer explicitly building the references of the controls I want into an array and passing that array to a subVI. See here for a simple example:
    That example uses the OpenG VI internally, but you can easily replace it with the NI VI if you flatten the variant to a string. The same concept can apply to saving to a DB. This RCF plugin allows quickly building an array of references for selected controls.
    Another option which is more elegant than using the description is assigning a tag to each control you want to edit. This is more elegant, but requires building an edit time tool which will allow you to edit tags on controls, since the only way of accessing them today is through a reference to the object which has the tag. You can build such a tool, but it requires a bit of know-how. This VI (basically a floating tool which allows you to manipulate selection on the VI you're currently editing) will get you some of the way there and also show you where the tag VIs are.
    Try to take over the world!
    Attachments:
    Floating Tool.vi ‏13 KB

  • Anonymous PL/SQL vs procedure inside package

    It's probably quite simple problem but I'm not able to figure it out.
    If I make an anonymous PL/SQL block
    declare
    l_counter number(4);
    begin
    SELECT *
    into l_counter
    FROM (SELECT count(*)
    FROM SYS.all_objects
    WHERE owner IN ('USER1', 'USER2')
    AND object_type IN ('TABLE', 'VIEW')
    minus
    SELECT count(*)
    FROM SYS.dba_tab_privs
    WHERE grantee = 'TESTERS');
    DBMS_OUTPUT.PUT_LINE(l_counter);
    end;
    then it works. The result is 2 which is correct because select statement returns 2 rows.
    If I make procedure with the same code
    create or replace PROCEDURE grant_privileges2
    IS
    l_counter NUMBER (4);
    BEGIN
    SELECT COUNT (*)
    INTO l_counter
    FROM (SELECT owner, object_name
    FROM SYS.all_objects
    WHERE owner IN ('USER1', 'USER2')
    AND object_type IN ('TABLE', 'VIEW')
    MINUS
    SELECT owner, table_name
    FROM SYS.dba_tab_privs
    WHERE grantee = 'TESTERS);
    DBMS_OUTPUT.put_line (l_counter);
    END;
    result is 0 which is not correct becuase select statement is the same as in anonymous pl/sql and it has to return 2 rows.
    What I'm doing wrong?

    If the queries are the same then it works for me...
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2  l_counter number(4);
      3  begin
      4  SELECT *
      5  into l_counter
      6  FROM (SELECT count(*)
      7  FROM SYS.all_objects
      8  WHERE owner IN ('CRISP_ADMIN', 'CRISP_INTELL')
      9  AND object_type IN ('TABLE', 'VIEW')
    10  minus
    11  SELECT count(*)
    12  FROM SYS.dba_tab_privs
    13  WHERE grantee = 'SYSTEM');
    14  DBMS_OUTPUT.PUT_LINE(l_counter);
    15* end;
    SQL> /
    431
    PL/SQL procedure successfully completed.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure mytest is
      2  l_counter number(4);
      3  begin
      4  SELECT *
      5  into l_counter
      6  FROM (SELECT count(*)
      7  FROM SYS.all_objects
      8  WHERE owner IN ('CRISP_ADMIN', 'CRISP_INTELL')
      9  AND object_type IN ('TABLE', 'VIEW')
    10  minus
    11  SELECT count(*)
    12  FROM SYS.dba_tab_privs
    13  WHERE grantee = 'SYSTEM');
    14  DBMS_OUTPUT.PUT_LINE(l_counter);
    15* end;
    SQL> /
    Procedure created.
    SQL> exec mytest;
    431
    PL/SQL procedure successfully completed.

  • Display invalid pattern name while calling the procedure inside the package

    Hi ,
    I'am trying to call a package which is having procedure ,from JDBC in which one of the return type is Varray from the procedure.When i'am calling the procedure inside the package
    from java showing invalid name pattern name.Just i'am placing the code snippet for package and calling java through package.
    Package body
    create or replace package body Rewards_Summary_Package as
    PROCEDURE Rewards_Summary_Procedure
    (v_Tot_Earned_Points OUT NUMBER, v_TOT_REDEEMED OUT NUMBER, v_TOT_PTS_EXP OUT NUMBER,
    v_TOT_AVAILABLE OUT NUMBER, v_TIER_NAME OUT VARCHAR2,VA OUT t_varray,V_PR_CON_ID IN VARCHAR2) AS
    v_ACCRUALED_VAL NUMBER := 0;
    v_USED_VAL NUMBER := 0;
    /*v_TOT_ACCRUALED_VAL NUMBER := 0;
    v_TOT_USED_VAL NUMBER := 0;
    V_PR_TIER_ID VARCHAR2(30);
    V_PR_CON_ID VARCHAR2(30);
    V_EXPIRY_DT DATE;
    v_month varchar2(30);
    v_date date;
    v_next_month_date date;
    v_TIER_NAME VARCHAR2(50);
    v_TOT_AVAILABLE NUMBER := 0;
    v_EARNED NUMBER := 0;
    v_TOT_EARNED NUMBER := 0;
    v_TOT_REDEEMED NUMBER := 0;
    v_TOT_EXPIRED NUMBER := 0;
    v_EARNED_TOTAL NUMBER := 0;
    v_TOT_EXPIRED_MONTH NUMBER := 0;
    v_TOT_PTS_EXP NUMBER := 0;
    v_TOT_RDMD_CANCELLED NUMBER :=0;
    v_TOT_EARNED_POINTS NUMBER :=0;*/
    v_FIRST_DT DATE;
    v_LAST_DT DATE;
    v_MEMBER_ID VARCHAR2(30);
    V_EXPIRED_VAL Number;
    v_TOT_PRDPTS_RDMD NUMBER := 0;
    v_TOT_PTS_RDMD NUMBER := 0;
    v_CAN_ACCRUAL_POINTS NUMBER := 0;
    BEGIN
    /*TotalRwdPoints and Tier Name*/
    SELECT TR.NAME,MEM.POINT_TYPE_A_VAL,MEM.ROW_ID INTO v_TIER_NAME,v_TOT_AVAILABLE,v_MEMBER_ID
    FROM SIEBEL.S_LOY_MEMBER MEM, SIEBEL.S_LOY_TIER TR WHERE MEM.PR_DOM_TIER_ID=TR.ROW_ID
    AND MEM.PR_CON_ID=V_PR_CON_ID;
    vTotPrdPtsRdmd
    SELECT NVL(SUM(A.VALUE),0) INTO v_TOT_PRDPTS_RDMD from SIEBEL.S_LOY_RDM_ITM A,SIEBEL.S_LOY_ATTRDEFN B
    WHERE A.MEMBER_ID = v_MEMBER_ID AND A.ATTRB_DEFN_ID = B.ROW_ID AND b.INTERNAL_NAME = 'Point 1 Value' AND A.TYPE_CD='Product'
    AND A.TXN_ID IS NOT NULL;
    vTotPtsRdmd
    SELECT NVL(SUM(A.VALUE),0) INTO v_TOT_PTS_RDMD from SIEBEL.S_LOY_RDM_ITM A,SIEBEL.S_LOY_ATTRDEFN B
    WHERE A.MEMBER_ID = v_MEMBER_ID AND A.ATTRB_DEFN_ID = B.ROW_ID AND b.INTERNAL_NAME = 'Point 1 Value' AND (A.TYPE_CD='Product' or A.TYPE_CD='Transfer')
    AND A.TXN_ID IS NOT NULL;
    vTotRewardPtExp
    SELECT NVL(SUM(A.VALUE),0) INTO v_TOT_PTS_EXP FROM SIEBEL.S_LOY_RDM_ITM A,SIEBEL.S_LOY_ATTRDEFN B
    WHERE A.MEMBER_ID = v_MEMBER_ID AND A.ATTRB_DEFN_ID = B.ROW_ID AND b.INTERNAL_NAME = 'Point 1 Value' AND A.TYPE_CD='Expired'
    AND a.TXN_ID IS NULL;
    vCanAccrualPoints
    SELECT NVL(SUM(A.ACCRUALED_VALUE),0) INTO v_CAN_ACCRUAL_POINTS from SIEBEL.S_LOY_ACRL_ITM A,SIEBEL.S_LOY_ATTRDEFN B
    WHERE A.MEMBER_ID = v_MEMBER_ID AND A.ATTRIB_DEFN_ID = B.ROW_ID AND b.INTERNAL_NAME = 'Point 1 Value' AND A.TYPE_CD='Cancellation';
    v_Tot_Earned_Points := v_TOT_AVAILABLE+v_TOT_PRDPTS_RDMD+v_TOT_PTS_EXP-v_CAN_ACCRUAL_POINTS;
    v_TOT_REDEEMED := v_TOT_PTS_RDMD-v_CAN_ACCRUAL_POINTS;
    DBMS_OUTPUT.PUT_LINE(' Total Earned: '|| v_Tot_Earned_Points || ' Total Redeemed: '|| v_TOT_REDEEMED || ' Total Expired: '|| v_TOT_PTS_EXP
    || ' Balance Points: '|| v_TOT_AVAILABLE || ' Tier Name: '|| v_TIER_NAME);
    select trunc(sysdate,'MONTH') INTO v_FIRST_DT from dual;
    va:= t_varray(Null,Null,Null,Null,Null,Null);
    FOR a in 1 .. 6 LOOP
    select trunc(last_day(v_FIRST_DT)) INTO v_LAST_DT from dual;
    SELECT SUM(AI.ACCRUALED_VALUE),SUM(AI.USED_VALUE) INTO v_ACCRUALED_VAL,v_USED_VAL from SIEBEL.S_LOY_ACRL_ITM AI,SIEBEL.S_LOY_ATTRDEFN A
    WHERE AI.MEMBER_ID = v_MEMBER_ID AND A.ROW_ID = AI.ATTRIB_DEFN_ID AND A.INTERNAL_NAME = 'Point 1 Value'
    AND trunc(AI.EXPIRATION_DT) >= v_FIRST_DT AND trunc(AI.EXPIRATION_DT) <= v_LAST_DT;
    V_EXPIRED_VAL := NVL(v_ACCRUALED_VAL-v_USED_VAL,0);
    va(a):=V_EXPIRED_VAL;
    v_FIRST_DT := add_months(v_FIRST_DT,1);
    End loop;
    END;
    end;
    Package declaration
    create or replace package Rewards_Summary_Package as
    TYPE t_varray IS VARRAY(6) OF NUMBER;
    PROCEDURE Rewards_Summary_Procedure
    (v_Tot_Earned_Points OUT NUMBER, v_TOT_REDEEMED OUT NUMBER, v_TOT_PTS_EXP OUT NUMBER,
    v_TOT_AVAILABLE OUT NUMBER, v_TIER_NAME OUT VARCHAR2,VA OUT t_varray,V_PR_CON_ID IN VARCHAR2);
    end;
    java code
    I had tried using java types and Oracle types
    conn=SiebelServiceDatasource.getConnection(SSBConstants.REWARDS_PROP_LOG_SUFIX);
    // ArrayDescriptor.TYPE_VARRAY
    ocstmt=(OracleCallableStatement)conn.prepareCall(" {call REWARDS_SUMMARY_PACKAGE.REWARDS_SUMMARY_PROCEDURE(?,?,?,?,?,?,?)}");
    //ocstmt=(OracleCallableStatement)conn.prepareCall(" call Test_Array(?,?)");
    ocstmt.registerOutParameter(1,OracleTypes.INTEGER);
    ocstmt.registerOutParameter(2,OracleTypes.INTEGER);//1-616BH
    ocstmt.registerOutParameter(3,OracleTypes.INTEGER);
    ocstmt.registerOutParameter(4,OracleTypes.INTEGER);
    ocstmt.registerOutParameter(5,OracleTypes.VARCHAR);
    ocstmt.registerOutParameter(6,OracleTypes.ARRAY,"SIEBEL.T_VARRAY");
    ocstmt.setString(7,contactSiebelRowId);
    ocstmt.execute();
    Showing the following invalid name pattern SIEBEL.T_VARRAY
    Please help
    Thanks in advance
    Kiran

    create or replace package Rewards_Summary_Package as
        TYPE t_varray IS VARRAY(6) OF NUMBER;
    end;You've declared your type inside the package. You need to declare it as a SQL type, which is not part of a PL/SQL package.

Maybe you are looking for