To call Java Procedure inside Forms6i

How do i call a java procedure (Stored either in Oracle8i database or application server )from Oracle Forms6i trigger / procedure.If this possible please let me know.
Your help in this regard would be appreciated

For java procedures in the database (stored java procedures) you just call the pl/sql wrapper function that was created for the java function.
To call java functions on the application server you can use the java importer utility available with forms6i patch2 and above.

Similar Messages

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

  • Call Stored Procedure inside a db trigger

    Is that possible to call stored procedure inside a db trigger ?
    I User this code:
    Create Or Replace Trigger Sale.Send_Auto_Email_Trg
    After Insert
    On Sale.Sale_Technical_Support
    --Referencing New As New Old As Old
    For Each Row
    Declare
    Pragma Autonomous_Transaction;
    vn_count         Number := 0;
    vn_msg           Number;
    vv_exec          Varchar2(5000);
    Begin
      If Inserting And :New.Ticket_Status = 2 Then
       Begin
        Begin
         Select Count(*)
           Into vn_count
           From Sale_Technical_Support
          Where Sending_Flag = 1
            And Support_Type = 2;
        Exception When No_Data_Found Then
         vn_count := 0;
        End;
        If vn_count >= 1 And :New.Problem_Desc Is Not Null Then
         Technical_Support_Mailing('[email protected]',  -- To
                                   '[email protected]',
                                   '[email protected]',  -- Bcc
                                   '[email protected]',  -- From
                                   'رموز وصلاحيات',
                                   2);                                                                                          
        End If;
       End;
      End If;
    End;
    /No errors but the procedure doesn't executed !!!!!

    1) If you are using autonomous transactions for anything other that writing log data that you want to preserve even if the triggering transaction fails, you're probably doing something wrong. There is no reason to use an autonomous transaction here.
    2) You don't want to send email from a trigger. You don't want to do anything non-transactional in a trigger. Oracle will, for example, rollback and re-execute parts of a statement for write consistency. If you send email in a trigger, you may get multiple emails for a single update. You may also get emails for updates that were never committed. And if the email server happens to be down, your transactions will fail.
    3) If you use an autonomous transaction, the trigger will have a completely different transaction context from the parent. So when you query the table within the trigger, you won't be able to see any of the uncommitted changes including the changes that caused the trigger to fire. My guess is that you are assuming that the row that you inserted is visible to the trigger.
    Justin

  • Calling a Procedure inside a Function

    How to call procedure within the function. please help

    I called the procedure as u said but it is firing.. please help me out.. here is the code.
    This code is to generate the SEquence ids.
    *********** Procedure ***************
    create or replace procedure ExecImmd
    is
    Begin
         EXECUTE IMMEDIATE 'DROP SEQUENCE emplseqid';
         EXECUTE IMMEDIATE 'CREATE SEQUENCE emplseqid START WITH 1001 INCREMENT BY 1';
    END;
    CREATE OR REPLACE FUNCTION GenCustId RETURN VARCHAR2
    IS
    VEMPID VARCHAR2(6);
    ISEQID NUMBER(5);
    P1 VARCHAR2(10);
    P2 VARCHAR2(10);
    BIND2 VARCHAR2(10);
    BEGIN
         SELECT MAX(SUBSTR(EMPID,1,2)) INTO P1 FROM EMPL;     
         SELECT EMPLSEQID.NEXTVAL INTO ISEQID FROM DUAL;
         IF ASCII(SUBSTR(P1,2,1)) < ASCII('Z') THEN
              IF ISEQID <= 9999 THEN
              bind2 := SUBSTR(P1,1,2) || ISEQID;
              ELSE
              /* here i am calling a procedure.
              ExecImmd();
              SELECT EMPLSEQID.NEXTVAL INTO ISEQID FROM DUAL;
              bind2 := SUBSTR(P1,1,1) || CHR(ASCII(SUBSTR(P1,2,1))+1) || ISEQID;
              END IF;
         ELSE
              if p1 is null then
                   bind2 := 'AA' || ISEQID;          
              else
                   IF ISEQID <= 9999 THEN
                   bind2 := SUBSTR(P1,1,2) || ISEQID;
                   Else
                   bind2 := CHR(ASCII(SUBSTR(P1,1,1))+1) || 'A' || ISEQID;          
                   End If;
              End If;
         END IF;
         return bind2;
         END;

  • Calling stored procedure inside AM. DB connection and updates on act/passiv

    Hi Experts,
    Currently in my application we have view objects and also we have some stored procedure calls to insert and update data (in the procedure we don't commit it. Due to the volume and complexity we couldn't migrate all the procedures). After the stored procedure call we do refresh the VO (Also in the EO we have checked necessary attributes to refresh on update and insert) to pick up the changes that happened in the stored procedure call. It is working fine and i can be able to see the updated values in the VO after the procedure call. However
    Now my question is what will happen on activation and passivation? In the passivation the pinned DB connection is released and used for another AM. Will the stored changes will be rolled back. I mean the DB transaction. If rollback then the VO updates based on the procedure call will be also rolled back? I have tested this behaviour after disabled the AM pooling and set the pool size to 1. It is working but failing some times (In the procedure i have data insert for the child table, after the refresh i could be able to see the child VOs, some times empty child). Did anyone try this approach before?
    Also what will happen if AM goes to passivation during the stored procedure executing ( i am getting the DB connection from getDBTransaction(() method). When i was testing i got the resultset null and i checked the stack and it was due to the connection closed). If AM behaves it like that is it reliable to use procedure call inside the AM?
    Looking forward you expertise answers.
    Thanks

    Hi,
    I agree with Frank.
    In our application we always commit after calling PL/SQL procedures which performs DML-Statements (insert, update, delete).
    Without commits you will - beside the passivation problem - face problems with locked records in the database.
    To refresh the values from DB we use the "restore current row after rollback" approach (which is applicable for commit too).
    regards
    Peter

  • Calling Stored procedure inside an Stored procedure

    Hi,
    I am working in oracle 9i. I want to call a stored procdure from another stored procedure.
    Kindly provide me the example...
    rgds.

    having a pocedure called PRCD1,
    Create or Replace Procedure PRCD2 IS
    egin
    PRCD1;
    END;
    cheers !!!It will for surely err out. You cannot use "EXECUTE" inside a stored procedure.
    Here's how you do it:
    SQL> create or replace procedure p1 is
      2  begin
      3    dbms_output.put_line('I am P1');
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p2 is
      2  begin
      3    dbms_output.put_line('I am P2');
      4    p1;
      5  end;
      6  /
    Procedure created.
    SQL> set serveroutput on
    SQL> exec p2
    I am P2
    I am P1
    PL/SQL procedure successfully completed.
    SQL>

  • Can you call a procedure inside another procedure and how many?

    Ok. I have 3 procedures. I would like to call 2 of the from inside one, but I would like them to be in order.
    So,
    procedure1 // this is in db1
         call procedure2
                this collects, and inserts data into table 2 from db1
                this must be run first
         call procedure3
               this update the table1, and table2 from db2, and db3
               this must be run second
         finish procedure1
               this also updates table1 and table2 from db1 and db3
               this must be run third
    procedure1 end;or should I call a function
    procedures 2, and 3 have there own dblinks to other dbs to gather datat, procedure1 is in the same db.
    the procedures dont have to be like above. If you want to run proc3, and call proc1, and proc2 first so be it. Just an example

    create or replace myPackage
    is
    procedure1;
    procedure2;
    procedure3;
    end myPackage;
    create or replace myPackage body
    is
      procedure1 is
      begin
        -- call 2
        procedure2;
        -- call 3
        procedure3;
      end procedure1;
      procedure2 is
      begin
        do_something_here;
      end procedure2;
      procedure3 is
      begin
        do_something_here;
      end procedure3;
    end myPackage;
    /* now run the procedure1 from sql*plus */
    execute myPackage.Procedure1;Message was edited by:
    Sven W. added packaged call

  • Calling Java procedure from PL/SQL (10g)

    Hi.
    I'm a newbie in Oracle 10g... could you, please, advice any documentation about restrictions put on java code so I could easily load in to 10g DB and call from a PL/SQL procedure?
    I've only found some books for 8i and 9i :(

    I've only found some books for 8i and 9i :( It hasn't changed that much. Have you tried those techniques?
    Anyway, the best place to start is always the documentation, in this case the Java Developer's Guide.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • Calling java from inside an Active Server Page.

    Is it possible to call a java application from inside an ASP ?
    I can't write COM. Just Java. But IIS is all I have access to at this time.
    thanks,
    nupevic

    Yes, I did a year ago (a PDF creating app); however I've forgotten how. Microsoft had a register-tool I believe.
    Please wait on someone else's (with a better recall) reply.

  • Call java procedure from oracle 8.1.7

    Hi all,
    I want to loadjava from a javaclass which was compiled in jdk 1.3 into oracle 8.1.7
    Anyone help me to do it
    thanks a lot
    anhnt

    Anhnt,
    Please refer to the following books, that are part of the Oracle documentation:
    Java Developer's Guide
    Java Stored Procedures Developer's Guide
    Java Tools Reference
    The documentation can be accessed from:
    http://tahiti.oracle.com
    Although Oracle 8i is very old by now, you may still find some useful information from the OracleJVM and Java Stored Procedures Web page.
    Good Luck,
    Avi.

  • Calling Java code inside JSP page and sending toString on object to Servlet

    Hi.
    I am trying to setup a way to make testing my application easier. Using a web-based method will work best. Here is what I am trying to accomplish:
    - Have a web page that will prompt the user to enter data, fill in text fields, make choices, etc. When done, they press the Submit button. I don't need to keep info between sessions. Just open browser, execute, view results, close browser, repeat.
    - I then want to take this data and use some Java Classes I have to create a Java object.
    - I then want to send the toString() results of this Java object to a known Java servlet. The result of the servlet's actions should be displayed as a response on the screen.
    This is what I currently have (Ignore the
    's - I don't know why they are showing up - its not important):
    Web page:
    <html>
    <head><title>TestGroup</title></head>
    <body>
    <form name=f method=post action=http://localhost:100/Servlet>
    Name: <br>
    Group: <input name=group type=text><br>
    <br>
    <input type=submit value=Submit>
    <input type=reset value=Reset>
    </form>
    </body>
    </html>The Java code in the JSP (where to put it?):
    <%
    Group g = new Group();
    g.setGroupName(request.getParameter("group"));
    String output = g.toString(); // I want this to go to the Servlet.
    %>But, now I am stuck as to how to piece these together. I have some JSP experience, but not quite like this.
    As I said, when the user presses the Submit button, I want to perform the Java code above, and have the results of the toString method sent to the Servlet, plus clear all other parameters (so they are not sent to the servlet).
    Does anyone have any advice/comments? I am open to alternative designs too, this is just the simplest one I could think of. If another JSP page is needed, that's fine too.
    Thanks.

    Hi.
    I am trying to setup a way to make testing my application easier. Using a web-based method will work best. Here is what I am trying to accomplish:
    - Have a web page that will prompt the user to enter data, fill in text fields, make choices, etc. When done, they press the Submit button. I don't need to keep info between sessions. Just open browser, execute, view results, close browser, repeat.
    - I then want to take this data and use some Java Classes I have to create a Java object.
    - I then want to send the toString() results of this Java object to a known Java servlet. The result of the servlet's actions should be displayed as a response on the screen.
    This is what I currently have (Ignore the
    's - I don't know why they are showing up - its not important):
    Web page:
    <html>
    <head><title>TestGroup</title></head>
    <body>
    <form name=f method=post action=http://localhost:100/Servlet>
    Name: <br>
    Group: <input name=group type=text><br>
    <br>
    <input type=submit value=Submit>
    <input type=reset value=Reset>
    </form>
    </body>
    </html>The Java code in the JSP (where to put it?):
    <%
    Group g = new Group();
    g.setGroupName(request.getParameter("group"));
    String output = g.toString(); // I want this to go to the Servlet.
    %>But, now I am stuck as to how to piece these together. I have some JSP experience, but not quite like this.
    As I said, when the user presses the Submit button, I want to perform the Java code above, and have the results of the toString method sent to the Servlet, plus clear all other parameters (so they are not sent to the servlet).
    Does anyone have any advice/comments? I am open to alternative designs too, this is just the simplest one I could think of. If another JSP page is needed, that's fine too.
    Thanks.

  • How to call a procedure inside a trigger?

    hi people,
    I have a trigger which cals a stored proc named PY.but i couldn get dis trigger worked out.can u pls sugges me?.the trigger is as follows.
    create or replace trigger ts after insert on s
    for each row
    begin
    call py
    if this trigger gets successfully created its enough for me.gimme some ideas.Thanks in advance.
    regards
    VIDS

    Hi,
    create or replace trigger ts after insert on s
    for each row
    begin
    call py
    just call 'py' no need of calling 'call py'.....
    create or replace trigger ts after insert on s
    for each row
    begin
    py;
    If it helps mark question as anwered or helpfull....
    Thanks,
    Pavan

  • How to Call Java from ABAP

    Hi all,
    I have installed JCO & created the RFC in SAP. i have used below code to test my RFC connection & it's working fine.
    But In the below report, where to call the JAVA Program & what code i should use to call java code .
    Actually my ABAP requirement is to download a file. Then i need to call JAVA program, inside ABAP, to encrypt the downloaded file. Here, Java program is used to encrypt the file. Now question is, how to call the Java program inside the ABAP code.  Please advice with the code sample. Thanks a lot.
    REPORT  z_jco_test.
    PARAMETERS: requtext LIKE sy-lisel.
    DATA: echotext LIKE sy-lisel,
          resptext LIKE sy-lisel,
          rfctest TYPE TABLE OF rfctest,
          wa_rfctest TYPE rfctest.
    wa_rfctest-rfcdata1 = requtext.
    wa_rfctest-rfcdata2 = 'Hello World'.
    APPEND wa_rfctest TO rfctest.
    CALL FUNCTION 'RFC_PING'
      DESTINATION 'JCO'.
    CALL FUNCTION 'STFC_CONNECTION'
      DESTINATION 'JCO'
      EXPORTING
        requtext = requtext
      IMPORTING
        echotext = echotext
        resptext = resptext
      TABLES
        rfctest  = rfctest.
    WRITE: 'Echo Text: ', echotext.
    WRITE: 'Response Text: ', resptext.
    LOOP AT rfctest INTO wa_rfctest.
      WRITE: / 'rfcdata1: ', wa_rfctest-rfcdata1.
      WRITE: / 'rfcdata2: ', wa_rfctest-rfcdata2.
    ENDLOOP.

    Hi,
    You might accomplish your goal using external operating system commands.
    1) Define in SM69 an external command, letu2019s say ZJAVA. This command will execute a script on the operating system, letu2019s call it calljava.sh.
    2) In script calljava.sh you just call java, passing some parameters. For example, java $1 $2 $3 $4 $5 $6 $7
    3) In your ABAP program you call the ZJAVA external command and pass parameters to it. Of course, one of the parameters must be your Java program name.
      CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
        EXPORTING
          commandname                   = l_command
          additional_parameters         = l_param
          trace                         = 'X'
        IMPORTING
          status                        = l_status
          exitcode                      = l_exitcode
        TABLES
          exec_protocol                 = l_exec_protocol_itab
        EXCEPTIONS
          no_permission                 = 1u2026

  • Funtion calling a procedure (getting errors)

    HI,
    I am calling a procedure inside a function(see code below).
    Please see my second post for the code:
    Message was edited by:
    SeshuGiri

    Ok here's a working example, though it doesn't use your data:
    set echo on
    drop table data1
    drop table data1 succeeded.
    create table data1 (id number,
                        sel number,
                        col1 varchar2(15),
                        col2 varchar2(15),
                        col3 varchar2(15))
    create table succeeded.
    insert into data1
    select 1, 1, 'one-1','two-1','three-1' from dual union all
    select 1, 1, 'one-2','two-2','three-2' from dual union all
    select 1, 1, 'one-3','two-3','three-3' from dual union all
    select 2, 2, 'one-4','two-4','three-4' from dual union all
    select 2, 2, 'one-5','two-5','three-5' from dual union all
    select 3, 1, 'one-6','two-6','three-6' from dual
    6 rows inserted
    drop type temp_data_tt
    drop type temp_data_tt succeeded.
    create or replace type temp_data as object (
      id number,
      col1 varchar2(15),
      col2 varchar2(15),
      col3 varchar2(15));
    type temp_data Compiled.
    create type temp_data_tt as table of temp_data;
    type temp_data_tt Compiled.
    create or replace procedure get_recs(criteria number, recs out sys_refcursor) is
    begin
      open recs for select id, col1, col2, col3 from data1 where id=criteria;
    end;
    procedure get_recs(criteria Compiled.
    create or replace function get_data(criteria number) return temp_data_tt pipelined is
      l_id number;
      col1 varchar2(15);
      col2 varchar2(15);
      col3 varchar2(15);
      rs sys_refcursor;
    begin
      for drv in (select distinct id from data1 where sel=criteria) loop
        get_recs(drv.id, rs);
        loop
          fetch rs into l_id, col1, col2, col3;
          exit when rs%notfound;
          pipe row(temp_data(l_id, col1,col2,col3));
        end loop;
        close rs;
      end loop;
      return;
    end;
    function get_data(criteria Compiled.
    select * from table(get_data(1))
    ID                     COL1            COL2            COL3           
    1                      one-1           two-1           three-1        
    1                      one-2           two-2           three-2        
    1                      one-3           two-3           three-3        
    3                      one-6           two-6           three-6        
    4 rows selected
    select * from table(get_data(2))
    ID                     COL1            COL2            COL3           
    2                      one-4           two-4           three-4        
    2                      one-5           two-5           three-5        
    2 rows selected
    select * from data1
    ID                     SEL                    COL1            COL2            COL3           
    1                      1                      one-1           two-1           three-1        
    1                      1                      one-2           two-2           three-2        
    1                      1                      one-3           two-3           three-3        
    2                      2                      one-4           two-4           three-4        
    2                      2                      one-5           two-5           three-5        
    3                      1                      one-6           two-6           three-6        
    6 rows selected

  • Calling java class/procedure inside a trigger

    Hi all
    I want like to call a java procedure from a trigger.
    i know that i should load the class then write call specification and then call the java stored procedure.
    Before that what are the prerequisites ..
    Do i need to install java on my local machine?
    secondly for sample testing can you provide me a sample java code that will connect to my db and inserts some sample data into sample table
    regards
    raj

    Hi Here are the Details: I have the following
    Java File : Helloworld.java
    Class File : HelloWorld.class
    Location of Java and Class Files: C:\Program Files\Java\jdk1.6.0_13\
    Method : main(java.lang.String[])
    Helloworld.java
    class HelloWorldApp {
    public static void main(String[] args) {
    System.out.println("Hello World!"); // Display the string.
    loadjava -u HR/hr@ORCL C:\Program Files\Java\jdk1.6.0_13\HelloWorldApp.class ( From where should i run this command ?should i go to  windows--start--cmd  ? )
    CREATE OR REPLACE PROCEDURE sayhello ()
    AS LANGUAGE JAVA
    NAME 'HelloWorld.main(java.lang.String[])';
    CREATE OR REPLACE TRIGGER sal_trig
    AFTER UPDATE OF sal ON emp
    FOR EACH ROW
    CALL sayhello(); ------------------ ( where do i see the output when i call the procedure?)
    regards
    raj
    Edited by: raj_fresher on May 20, 2009 7:57 AM

Maybe you are looking for

  • Problem with Oracle during installation of NW

    Hi all, I have to install SAP NW on one host(for example IP 192.168.2.2) with the Oracle being installed on different host(for example 192.168.2.3) but the installation od database instance fails. Installator can not connect to Oracle on different ho

  • Do I need a new Apple ID for my second and third apple computers ....

    I just bought a second and third apple computer for my team mates for my business, do I need to have separate Apple ID in order for my emails NOT to drop on their computers ? I didn't think about this before I registered them with apple and now I nee

  • Why can't I sync my ipod with iTunes 7.0.2?

    I'm using itunes 7.0.2 and am having problems syncing my ipod. I have recently formatted my computer and reinstalled everything, including itunes. My whole library was lost. When I reinstalled itunes the library was empty and so it erased all the son

  • Anyone know how to install windows 7 and Lion with more than 1 partition?

    Hi guys, hope this is in the right place, it's my first post, I did search the forums but to be honest it's my first mac so half the time I don't understand what I'm reading. Basically, what I would like is, a partition for mac os, a partition for wi

  • I need help in urgent..please!!!

    my illustrator just freezed while saving my work file and it still like the picture down you see... please help, i'cant lose my works.. Illustrator not responding and i can't do anything. there are 2 files open, because of this i don't want to close