Kill a stored procedure/function

Hi Experts,
I have requirement to kill or terminate the stored procedure/function through UI.
Is there anyway to kill or terminate the stored procedure/function in oracle.
Note:-it shouldn't impact the other running Stored procedures/functions.
Thanks in Adavnce!!!

Some basics first.
You do not kill a procedure or function. You kill the process executing it.
The ALTER SYSTEM KILL SESSION command does not kill a process (session). It requests that process to terminate by communicating with the process via the SGA. If that process is in a synchronous kernel call (and waiting for that call to complete), the process is unable to even check the SGA, never mind respond to a kill-yourself instruction. Which means it cannot terminate itself.
User (application) code does NOT need the ALTER SYSTEM priv. That will be a very serious security violation. So if you do want to allow user code to make use of that priv to kill user sessions/processes, then you need to wrap that into a secure interface that user code can use. Such as a SYS owned KillUserSession() procedure, executing with definer rights, and ensuring the caller can only kill sessions that it owns (e.g. if caller is schema SCOTT, then only SCOTT sessions can be killed).
Last comment. Killing user sessions is kind of stupid. As that means you loose. You cannot design properly. You cannot code properly. And to establish some kind of sanity in processing, The Very Large Hammer needs to be employed. Killing sessions does NOT fix the problem. It treats the symptom. The problem is still there.
And to add a treat-the-symptom-by-killing-the-session button on a .Net (or any other) application? That is, IMO, four-letter-words epic lame.
What is the real problem?

Similar Messages

  • Parameter index move while executing PL/SQL stored procedure/function

    Hello, community.
    Have a question for you. It looked like very easy to write some small JDBC-wrapper to handle stored procedure/functions call for Oracle.
    Here is the code snippet of it:
    import java.io.Serializable;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.util.HashMap;
    import java.util.Iterator;
    import javax.sql.DataSource;
    import oracle.jdbc.driver.OracleTypes;
    import org.apache.log4j.Logger;
    public class SmallHelper {
         public static final int CALL_TYPE__PROCEDURE = 1;
         public static final int CALL_TYPE__FUNCTION = 2;
         public static final int PARAMETER__IN = 1;
         public static final int PARAMETER__OUT = 2;
         private static final Logger log = Logger.getLogger(SmallHelper.class);
         private Connection con = null;
         private CallableStatement statement = null;
         private String name;
         private int type;
         private int resultType;
         private HashMap arguments = new HashMap();
          * Creates connection using data source as parameter.
          * @param ds - data source
          * @throws EhlApplicationException
         public SmallHelper(DataSource ds) throws Exception {
           try {
                   con = ds.getConnection();
              catch (SQLException e) {
                   ExceptionHelper.process(e);
         public void registerProcedure(String name) {
              this.name = name;
              this.type = CALL_TYPE__PROCEDURE;
         public void registerFunction(String name, int resultType) {
              this.name = name;
              this.resultType = resultType;
              this.type = CALL_TYPE__FUNCTION;
          * NB! When You're dealing with stored function index should start with number 2!
         public void registerArgument(int index, Object value, int type, int inOutType) {
              arguments.put(new Long(index), new CallableStatementArgument(value, type, inOutType));
         private String getSQL() {
              StringBuffer str = new StringBuffer("{ call  ");
              if ( type == CALL_TYPE__FUNCTION )
                   str.append(" ? := ");
              str.append(name).append("( ");
              for ( Iterator i = arguments.values().iterator(); i.hasNext(); ) {
                   i.next();
                   str.append("?");
                   if ( i.hasNext() )
                        str.append(", ");
              str.append(") }");
              return str.toString();
         public void execute() throws SQLException{
              String query = getSQL();
              statement = con.prepareCall(query);
              if ( type == CALL_TYPE__FUNCTION )
                   statement.registerOutParameter(1, resultType);
              for ( Iterator i = arguments.keySet().iterator(); i.hasNext(); ) {
                   Long index = (Long) i.next();
                   CallableStatementArgument argument = (CallableStatementArgument) arguments.get(index);
                   int type = argument.getType();
                   if ( argument.getInOutType() == PARAMETER__OUT )
                        statement.registerOutParameter(index.intValue(), type);
                   else if ( type != OracleTypes.CURSOR )
                        statement.setObject(index.intValue(), argument.getValue(), type);
              log.info("Executing SQL: "+query);
              statement.execute();
         public CallableStatement getStatement() {
              return statement;
         public void close() throws EhlApplicationException {
              try {
                   if (statement != null)
                        statement.close();
                   if (con != null)
                        con.close();
              catch (SQLException e) {
                   EhlSqlExceptionHelper.process(e);
         private class CallableStatementArgument implements Serializable{
              private Object value;
              private int type;
              private int inOutType;
              public CallableStatementArgument(Object value, int type, int inOutType) {
                   this.value = value;
                   this.type = type;
                   this.inOutType = inOutType;
              public int getType() {
                   return type;
              public Object getValue() {
                   return value;
              public int getInOutType() {
                   return inOutType;
    }It was really done in 10-15 mins, so don't be very angry at code quality :)
    Here is the problem.:
                   helper.registerProcedure("pkg_diagnosis.search_diagnosis");
                   helper.registerArgument(1, null, OracleTypes.CURSOR, EhlJdbcCallableStatementHelper.PARAMETER__OUT);
                   helper.registerArgument(2, pattern, OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(3, lang, OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(4, EhlSqlUtil.convertSetToString(langs, ","), OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(5, EhlSqlUtil.convertSetToString(diagnosisClass, ","), OracleTypes.VARCHAR, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.registerArgument(6, parentId, OracleTypes.NUMBER, EhlJdbcCallableStatementHelper.PARAMETER__IN);
                   helper.execute();
                   ResultSet rs = ((OracleCallableStatement) helper.getStatement()).getCursor(1);
                   procedure definition:
    procedure search_diagnosis (l_res OUT dyna_cur,
                               in_search_string IN VARCHAR2,
                               in_search_lang IN VARCHAR2,
                               in_lang_list IN VARCHAR2,
                               in_diag_class_list IN VARCHAR2,
                               in_parent_id IN NUMBER) Procedure call has inner check that fail because of som strange reason:
    in_search_string has 2 as index, that is correct. but procedure recieves is as number 3 in parameter list (what is in_search_lang). Other parameters are moved to. It seems like a cursor takes 2 places in definition. It's clear that if I put in_search_string as 1 parameter and cursor as 0 I'll get invalid parametr bindong(s) exception. So... any ideas why 2nd parameter is actually 3rd?
    Thanks beforehand.

    hmm...moreover:
    if we change procedure to function and call it in a simple way:
    CallableStatement stmnt = helper.getConnection().prepareCall("begin ? := pkg_diagnosis.search_diagnosis(?,?,?,?,?); end;");
                   stmnt.registerOutParameter(1, OracleTypes.CURSOR);
                   stmnt.setString(2, pattern);
                   stmnt.setString(3, lang);
                   stmnt.setString(4, langs);
                   stmnt.setString(5, diagnosisClass);
                   stmnt.setObject(6, parentId, OracleTypes.NUMBER);
                   stmnt.execute();
                   ResultSet rs = (ResultSet) stmnt.getObject(1);the exception is:
    [BEA][Oracle JDBC Driver][Oracle]ORA-06550: line 1, column 14:
    PLS-00382: expression is of wrong type
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredif we return some string or number - it works. but when we want cursor back - it fails.
    cursor is defined like ordinary dynamic cursor:
    TYPE dyna_cur IS REF CURSOR;

  • Establishing database connection in stored procedures/functions

    Hi, any body knows how to do it....
    Consider there is 2 database, Oracle_1 and Oracle_2.
    I want to fetch some table data in Oracle_2 from Oracle_1 database Stored procedure/functions through query staments and cursors. How to establish the Oracle_1 DB connection in Oracle_2 DB stored procedure/function. Is it possible?

    Hi,
    Consider there is 2 database, Oracle_1 and Oracle_2.
    I want to fetch some table data in Oracle_2 from Oracle_1 database Stored procedure/functions through query staments and cursors. How to establish the Oracle_1 DB connection in Oracle_2 DB stored procedure/function. Is it possible?
    It's not the same how you implement the programs in java or .Net to create DB connection. It's different over here. You have use the DataBase Links in order to make to connection with another DB and use that Link in the stored procedure or function where ever its necessary as per your requirement.
    - Pavan Kumar N

  • How to execute a stored procedure/function in TOAD?

    Hi, All ,
    Can someone please tell me how to execute a stored procedure/function in TOAD?
    I have tired
    EXECUTE PROCEDURENAME(888), but it doesn’t work.
    TOAD give me the error: invalid SQL statement.
    Thanks a lot

    Write PL/SQl block.
    i.e Begin
    Procedure name..
    end;
    Then it will be excuted.
    Ashutosh

  • How to Kill a Stored Procedure?

    Sombody knows how to kill a stored procedure from another stored peocedure?
    I wanna know if exists a way to use therads in sored procedures.
    Best Regards

    1) You can't. Unless you code a mechanism yourself, but then since
    you can't thread Procedure calls that wouldn't help much.
    2) You can try using DBMS_JOB, if your not in a hurry to have your procedure finish.
    This is PL/SQL, not Java. You have to imagine all you get is a single thread running
    static methods. You can get away from everything being static by using the CREATE TYPE
    OBJECT stuff. but that doesn't help you thread your processes.
    I hope someone else can give you a different answer,
    Eric Kamradt

  • How to query DDL locks on stored procedures/functions and packages?

    Hi!
    The subject says it all: How do I see existing DDL locks on stored procedures/functions and packages?
    While a procedure is executed it can't be deleted or replaced, so there has to be a DDL lock on it. The information does not seem to be in V$LOCK or V$LOCKED_OBJECTS.
    Thanks!
    Marcus
    Edited by: MMarcus on Nov 21, 2009 3:43 PM

    Hello,
    Here you can find an article about the view DBA_DDL_LOCKS:
    [http://www.praetoriate.com/int_40.htm]
    If you don't have this view on the Data Dictionary, you may have
    to execute the "OH/rdbms/admin/catblock.sql" script first.
    Hope it can help.
    Best regards,
    Jean-Valentin

  • Messages in forms for stored procedures/functions

    Hi!
    i wand to send message or raised exception from the
    stored procedure/function to the oracle forms during
    processing . how can i do this
    Thanking U

    Declare
      invalid_code  EXCEPTION;
      PRAGMA        EXCEPTION_INIT     (invalid_code, -20009); -- raised from server side functionBEGIN
    DO what eva ..... to raise exception
    EXCEPTION
    WHEN invalid_code
    THEN handle appropriately
    END;
    Thanks,
    N.

  • Passing blank parameter to stored procedures/function

    Hi all,
    When I pass blank value ('') to a VARCHAR2 parameter in a stored procedures/function it reads the parameter as NULL, I try to use DEFAULT keyword in the parameter declaration, but it does not work. How can I make the sp/func read the paramater as '' ?
    Thanks in advance
    Setya

    This is a fundamental quirk of Oracle - it treats '' (empty string) as if it were null:
    SQL> SELECT case when '' is null then 'EMPTY STRING IS NULL' else 'EMPTY STRING IS NOT NULL' end
      2  FROM   dual;
    CASEWHEN''ISNULLTHEN'EMP
    EMPTY STRING IS NULL
    SQL> So what is it you want to do that you can do with an empty string but not with a null?
    Regards, APC

  • SSRS with Oracle Stored Procedures, Functions and Packages

    Hi,
    I am working on a BI project. Here we are using PowerPivot to access data from Oracle DB and generate reports. Currently Client generates Few reports using Oracle Stored Procedures, Functions and Packages. We need to move everything to PowerPivot, so
    that user can generate all reports using same platform. But PowerPivot doesn'e support Oracle Stored Procedures, Functions and Packages. So we have decided to try those reports using SSRS.
    I have no knowledge about using SSRS which will call Oracle function/stored procedures/packages for generating reports.
    Can anybody help me in getting exact steps?
    Please let me know if my question is not clear enough.
    Thanks and Regards,
    SS

    Hi Visakh,
    Thanks for the detailed steps. My next question is:
    Is there any other way to develop such reports without using any development tool like Visual Studio? Our aim is to provide a self-serviced reporting platform where user don't need any technical knowledge.
    I am sorry I have no knowledge about SSRS and Oracle DB.Can you please have a look at my Oracle function and let me know whether it's possible to execute this using SSRS? (I am pasting one by one as there is a character limit.
    CREATE OR REPLACE TYPE obj_special_pass_cases
    AS OBJECT
          CLAIM_ID    NUMBER(12),
          claim_ref_no  VARCHAR2(20),
          OFFICER_NAME   VARCHAR2(201),
          SUBMIT_DT   VARCHAR2(10),
          ACC_DT   VARCHAR2(10),
          SP_ISSUE_DT   VARCHAR2(10),
          STATUS    VARCHAR2(30),
          SUB_STATUS   VARCHAR2(30),
          STATUS_LAST_UPDATE_DATE VARCHAR2(10),
          SP_EXP_DT VARCHAR2(10),
          INDUSTRY_CODE VARCHAR2(8),
          EMP_SSIC VARCHAR2(8),
          rel VARCHAR2(4),
          WPNo VARCHAR2(20),
          FIN VARCHAR2(9),
          PASSPORT_NO VARCHAR2(16),
          SPNo VARCHAR2(20),
          VictimName VARCHAR2(100),
          SP_EXT_PURPOSE VARCHAR2(100),
          ISSUE_SYSTEM VARCHAR2(4), 
          REPATRIATION_DATE VARCHAR2(10),
          SP_STATUS    VARCHAR2(30),
          SP_ISSUE_PURPOSE VARCHAR2(500)
    CREATE OR REPLACE TYPE tbl_special_pass_cases
       AS TABLE OF obj_special_pass_cases
    CREATE OR REPLACE TYPE obj_special_pass_casesNew
    AS OBJECT
          CLAIM_ID    NUMBER(12),
          claim_ref_no  VARCHAR2(20),
          OFFICER_NAME   VARCHAR2(201),
          SUBMIT_DT   VARCHAR2(10), /*Case Registration Date*/
          ACC_DT   VARCHAR2(10),
          SP_ISSUE_DT   VARCHAR2(10),
          calc_sp_issue_dt VARCHAR2(10),
          calc_sp_issue_dt_month VARCHAR2(2),
          calc_sp_issue_dt_year VARCHAR2(4),
          calc_Duration_Of_Stay VARCHAR2(4),
          STATUS    VARCHAR2(30),
          SUB_STATUS   VARCHAR2(30),
          STATUS_LAST_UPDATE_DATE VARCHAR2(10),
          lastUpdateDtMonth varchar2(2),
          lastUpdateDtYear varchar2(4),
          DurationOfUpdateDt VARCHAR2(4),
          SP_EXP_DT VARCHAR2(10),
          INDUSTRY_CODE VARCHAR2(8),
          EMP_SSIC VARCHAR2(8),
          rel VARCHAR2(4),
          WPNo VARCHAR2(20), /* New columns from here - SR */
          FIN VARCHAR2(9),
          PASSPORT_NO VARCHAR2(16),
          SPNo VARCHAR2(20),
          VictimName VARCHAR2(100),
          workerNationality VARCHAR2(20),
          employName VARCHAR2(200),
          reportType VARCHAR2(10),
          SP_EXT_PURPOSE VARCHAR2(100),
          ISSUE_SYSTEM VARCHAR2(4), /*IWPS, EIDS*/
          REPATRIATION_DATE VARCHAR2(10),
          SP_STATUS    VARCHAR2(30),
          SP_ISSUE_PURPOSE VARCHAR2(500)
    CREATE OR REPLACE TYPE tbl_special_pass_casesNew
       AS TABLE OF obj_special_pass_casesNew
       FUNCTION getListOfSpecialPassCases(
                  vRepatriationDateFrom VARCHAR2,
                  vRepatriationDateTo VARCHAR2,
                  vIncludeRepatriationDate VARCHAR2)
        RETURN tbl_special_pass_cases
        IS
          TYPE cur_typ IS REF CURSOR;
          SPECIAL_PASS_CASES_CUR cur_typ;
          vSQL1 VARCHAR2(4000);
          --vSQL1 VARCHAR2(4000) := 'SELECT DISTINCT(A.CLAIM_ID), A.CLAIM_REF_NO, A.STATUS, A.SUB_STATUS, A.OFFICER_NAME,  A.SUBMIT_DT, A.ACC_DT, A.vLatestUpdatedDate, A.INDUSTRY_CODE, A.ID_NO, A.vWorkerName, B.vSPWPNO, B.vFIN, B.vSPPassportNo,
    B.vSPIssueDate, B.vSPExpiryDate, B.vSPNo, DECODE(B.vSPExtensionPurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''13'',''FMMD'',''14'',''TMB
    PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION (SB-F)'') vSPExtensionPurpose, B.vIssueSystem, B.vSPActualDepartDate, B.vSPStatus, DECODE(B.vSPIssuePurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
    RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''11'',''PENDING DOCUMENT VERIFICATION'',''12'',''LATE ERENEWAL'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION
    (SB-F)'') vSPIssuePurpose FROM (SELECT vSPWPNO, vFIN, vSPPassportNo, vSPIssueDate, vSPExpiryDate, vSPNo, vSPExtensionPurpose, vIssueSystem, vSPActualDepartDate, vSPStatus, vSPIssuePurpose FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSActiveSpecialPass) WHERE
    (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B JOIN (SELECT WC.CLAIM_ID CLAIM_ID, WC.CLAIM_REF_NO CLAIM_REF_NO, WC.STATUS STATUS,  WC.SUB_STATUS SUB_STATUS, TAS.LAST_NAME ||'' ''|| TAS.FIRST_NAME OFFICER_NAME,  to_char(trunc(IRN.SUBMIT_DT), ''dd/MM/yyyy'')
    SUBMIT_DT, TO_CHAR(trunc(decode(wc.assessmt_type,''OD-PI'',EV.OD_CONSULT_DT,''OD-TI'',ev.od_consult_dt,ECASE.acc_dt)), ''dd/MM/yyyy'') ACC_DT, (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), ''dd/MM/yyyy'') STATUS_LAST_UPDATE_DATE FROM WIC_CLAIM_STATUS WCS WHERE
    WCS.CLAIM_ID=WC.CLAIM_ID) vLatestUpdatedDate, EC.INDUSTRY_CODE INDUSTRY_CODE, EP.ID_NO ID_NO, EP.NAME vWorkerName FROM EVENT_PERSON EP, WIC_CLAIMS WC, TBL_AA_SUBJECT TAS, EVENT_COMPANY EC,EVENT_CASE ECASE,event_victim ev WHERE EP.ID_NO IS NOT NULL AND EP.DELETE_IND
    = ''F'' AND EP.INVOLVEMENT = ''VICTIM'' AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID AND ep.event_person_id = ev.event_person_id (+) AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID AND EC.EVENT_CASE_NO=WC.EVENT_CASE_NO AND
    EC.INVOLVEMENT in (''EMPLOYER'',''EMPLOYER_OCCUPIER'') AND ECASE.EVENT_CASE_NO=WC.EVENT_CASE_NO AND EC.DELETE_IND = ''F'') A ON (B.vFIN = A.ID_NO OR B.vSPPassportNo = A.ID_NO)';
          vSQL2 VARCHAR2(4000);
          --vSQL2 VARCHAR2(4000) := 'SELECT DISTINCT(A.CLAIM_ID),A.CLAIM_REF_NO,A.STATUS,A.SUB_STATUS,A.OFFICER_NAME,A.SUBMIT_DT,A.ACC_DT,A.vLatestUpdatedDate,A.INDUSTRY_CODE,A.ID_NO,A.vWorkerName,B.vSPWPNO,B.vFIN,B.vSPPassportNo,B.vSPIssueDate,B.vSPExpiryDate,B.vSPNo,DECODE(B.vSPExtensionPurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
    RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION (SB-F)'') vSPExtensionPurpose,B.vIssueSystem,B.vSPActualDepartDate,B.vSPStatus,DECODE(B.vSPIssuePurpose,''1'',''WICB'',''2'',''RE-APPLICATION'',''3'',''POLICE'',''4'',''REPATRIATION'',''5'',''LRD'',''6'',''LATE
    RENEWAL'',''9'',''OTHERS'',''10'',''LATE EISSUANCE'',''11'',''PENDING DOCUMENT VERIFICATION'',''12'',''LATE ERENEWAL'',''13'',''FMMD'',''14'',''TMB PENDING REPATRIATION'',''15'',''TMB REPATRIATION'',''16'',''PENDING REPATRIATION (SB-F)'',''17'',''REPATRIATION
    (SB-F)'') vSPIssuePurpose FROM (SELECT vSPWPNO,vFIN,vSPPassportNo,vSPIssueDate,vSPExpiryDate,vSPNo,vSPExtensionPurpose,vIssueSystem,vSPActualDepartDate,vSPStatus,vSPIssuePurpose FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSDepartedSpecialPass(''' || vRepatriationDateFrom
    || ''', ''' ||  vRepatriationDateTo || ''')) WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B JOIN (SELECT WC.CLAIM_ID CLAIM_ID, WC.CLAIM_REF_NO CLAIM_REF_NO, WC.STATUS STATUS,WC.SUB_STATUS SUB_STATUS, TAS.LAST_NAME ||'' ''|| TAS.FIRST_NAME OFFICER_NAME, 
    to_char(trunc(IRN.SUBMIT_DT), ''dd/MM/yyyy'') SUBMIT_DT,TO_CHAR(trunc(decode(wc.assessmt_type,''OD-PI'',EV.OD_CONSULT_DT,''OD-TI'',ev.od_consult_dt,ECASE.acc_dt)), ''dd/MM/yyyy'') ACC_DT, (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), ''dd/MM/yyyy'') STATUS_LAST_UPDATE_DATE
    FROM WIC_CLAIM_STATUS WCS WHERE WCS.CLAIM_ID=WC.CLAIM_ID) vLatestUpdatedDate, EC.INDUSTRY_CODE INDUSTRY_CODE, EP.ID_NO ID_NO, EP.NAME vWorkerName FROM EVENT_PERSON EP, WIC_CLAIMS WC, TBL_AA_SUBJECT TAS, EVENT_COMPANY EC,EVENT_CASE ECASE, IR_NOTIFICATION IRN,event_victim
    ev WHERE EP.ID_NO IS NOT NULL AND EP.DELETE_IND = ''F'' AND EP.INVOLVEMENT = ''VICTIM'' AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID and ep.event_person_id = ev.event_person_id (+) AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
    AND EC.EVENT_CASE_NO=WC.EVENT_CASE_NO AND EC.INVOLVEMENT in (''EMPLOYER'',''EMPLOYER_OCCUPIER'') AND ECASE.EVENT_CASE_NO=WC.EVENT_CASE_NO AND IRN.REF_NO(+) = ECASE.IR_REF_NO AND IRN.SUBMIT_TYPE IN (''SI'',''SE'') AND EC.DELETE_IND = ''F'') A ON (B.vFIN = A.ID_NO
    OR B.vSPPassportNo = A.ID_NO)';
          SPECIAL_PASS_CASES_TBL tbl_special_pass_cases := tbl_special_pass_cases();
       cursor sp_pass_settle_cur is
       SELECT DISTINCT (A.CLAIM_ID),
                    A.CLAIM_REF_NO,
                    A.STATUS,
                    A.SUB_STATUS,
                    A.OFFICER_NAME,
                    A.SUBMIT_DT,
                    A.ACC_DT,
                    A.vLatestUpdatedDate,
                    A.INDUSTRY_CODE,
                    A.ID_NO,
                    A.vWorkerName,
                    B.vSPWPNO,
                    B.vFIN,
                    B.vSPPassportNo,
                    B.vSPIssueDate,
                    B.vSPExpiryDate,
                    B.vSPNo,
                    DECODE(B.vSPExtensionPurpose,
                           '1',
                           'WICB',
                           '2',
                           'RE - APPLICATION',
                           '3',
                           'POLICE',
                           '4',
                           'REPATRIATION',
                           '5',
                           'LRD',
                           '6',
                           'LATE RENEWAL',
                           '9',
                           'OTHERS',
                           '10',
                           'LATE EISSUANCE',
                           '13',
                           'FMMD',
                           '14',
                           'TMB PENDING REPATRIATION',
                           '15',
                           'TMB REPATRIATION',
                           '16',
                           'PENDING REPATRIATION(SB - F)',
                           '17',
                           'REPATRIATION(SB - F)') vSPExtensionPurpose,
                    B.vIssueSystem,
                    B.vSPActualDepartDate,
                    B.vSPStatus,
                    DECODE(B.vSPIssuePurpose,
                           '1',
                           'WICB',
                           '2',
                           'RE - APPLICATION',
                           '3',
                           'POLICE',
                           '4',
                           'REPATRIATION',
                           '5',
                           'LRD',
                           '6',
                           'LATE RENEWAL',
                           '9',
                           'OTHERS',
                           '10',
                           'LATE EISSUANCE',
                           '11',
                           'PENDING DOCUMENT VERIFICATION',
                           '12',
                           'LATE ERENEWAL',
                           '13',
                           'FMMD',
                           '14',
                           'TMB PENDING REPATRIATION',
                           '15',
                           'TMB REPATRIATION',
                           '16',
                           'PENDING REPATRIATION(SB - F)',
                           '17',
                           'REPATRIATION(SB - F)') vSPIssuePurpose
      FROM (SELECT vSPWPNO,
                   vFIN,
                   vSPPassportNo,
                   vSPIssueDate,
                   vSPExpiryDate,
                   vSPNo,
                   vSPExtensionPurpose,
                   vIssueSystem,
                   vSPActualDepartDate,
                   vSPStatus,
                   vSPIssuePurpose
              FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSActiveSpecialPass)
             WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B
      JOIN (SELECT WC.CLAIM_ID CLAIM_ID,
                   WC.CLAIM_REF_NO CLAIM_REF_NO,
                   WC.STATUS STATUS,
                   WC.SUB_STATUS SUB_STATUS,
                   TAS.LAST_NAME ||''|| TAS.FIRST_NAME OFFICER_NAME,
                   '' SUBMIT_DT,
                   TO_CHAR(trunc(decode(wc.assessmt_type,
                                        'OD-PI',
                                        EV.OD_CONSULT_DT,
                                        'OD-TI',
                                        ev.od_consult_dt,
                                        ECASE.acc_dt)),
                           'dd/MM/yyyy') ACC_DT,
                   (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), 'dd/MM/yyyy') STATUS_LAST_UPDATE_DATE
                      FROM WIC_CLAIM_STATUS WCS
                     WHERE WCS.CLAIM_ID = WC.CLAIM_ID) vLatestUpdatedDate,
                   EC.INDUSTRY_CODE INDUSTRY_CODE,
                   EP.ID_NO ID_NO,
                   EP.NAME vWorkerName
              FROM EVENT_PERSON   EP,
                   WIC_CLAIMS     WC,
                   TBL_AA_SUBJECT TAS,
                   EVENT_COMPANY  EC,
                   EVENT_CASE     ECASE,
                   event_victim   ev
             WHERE EP.ID_NO IS NOT NULL
               AND EP.DELETE_IND = 'F'
               AND EP.INVOLVEMENT = 'VICTIM'
               AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO
               AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID
               AND ep.event_person_id = ev.event_person_id(+)
               AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
               AND EC.EVENT_CASE_NO = WC.EVENT_CASE_NO
               AND EC.INVOLVEMENT in ('EMPLOYER', 'EMPLOYER_OCCUPIER')
               AND ECASE.EVENT_CASE_NO = WC.EVENT_CASE_NO
               AND EC.DELETE_IND = 'F') A ON (B.vFIN = A.ID_NO OR  B.vSPPassportNo = A.ID_NO);
       sp_pass_settle_rec sp_pass_settle_cur%rowtype;
       cursor sp_details_with_dt_cur is
     SELECT DISTINCT (A.CLAIM_ID),
                    A.CLAIM_REF_NO,
                    A.STATUS,
                    A.SUB_STATUS,
                    A.OFFICER_NAME,
                    A.SUBMIT_DT,
                    A.ACC_DT,
                    A.vLatestUpdatedDate,
                    A.INDUSTRY_CODE,
                    A.ID_NO,
                    A.vWorkerName,
                    B.vSPWPNO,
                    B.vFIN,
                    B.vSPPassportNo,
                    B.vSPIssueDate,
                    B.vSPExpiryDate,
                    B.vSPNo,
                    DECODE(B.vSPExtensionPurpose,'1','WICB', '2','RE - APPLICATION','3','POLICE','4','REPATRIATION','5','LRD','6','LATE RENEWAL','9','OTHERS','10','LATE EISSUANCE',
                           '13','FMMD','14','TMB PENDING REPATRIATION','15','TMB REPATRIATION','16','PENDING REPATRIATION(SB - F)','17','REPATRIATION(SB
    - F)') vSPExtensionPurpose,
                    B.vIssueSystem,
                    B.vSPActualDepartDate,
                    B.vSPStatus,
                    DECODE(B.vSPIssuePurpose,
                           '1','WICB','2','RE - APPLICATION','3','POLICE','4','REPATRIATION','5','LRD','6','LATE RENEWAL','9','OTHERS', '10', 'LATE EISSUANCE','11','PENDING
    DOCUMENT VERIFICATION',
                           '12','LATE ERENEWAL','13','FMMD','14','TMB PENDING REPATRIATION','15','TMB REPATRIATION','16','PENDING REPATRIATION(SB - F)','17','REPATRIATION(SB
    - F)') vSPIssuePurpose
      FROM (SELECT vSPWPNO,
                   vFIN,
                   vSPPassportNo,
                   vSPIssueDate,
                   vSPExpiryDate,
                   vSPNo,
                   vSPExtensionPurpose,
                   vIssueSystem,
                   vSPActualDepartDate,
                   vSPStatus,
                   vSPIssuePurpose
              FROM TABLE(IOSH_WIC_EXT_INTERFACE_PKG.getIWPSDepartedSpecialPass(''|| vRepatriationDateFrom ||'', ''||  vRepatriationDateTo ||''))
             WHERE (vSPWPNO IS NOT NULL OR vFIN IS NOT NULL)) B
      JOIN (SELECT WC.CLAIM_ID CLAIM_ID,
                   WC.CLAIM_REF_NO CLAIM_REF_NO,
                   WC.STATUS STATUS,
                   WC.SUB_STATUS SUB_STATUS,
                   TAS.LAST_NAME ||''|| TAS.FIRST_NAME OFFICER_NAME,
                   to_char(trunc(IRN.SUBMIT_DT), 'dd/MM/yyyy') SUBMIT_DT,
                   TO_CHAR(trunc(decode(wc.assessmt_type,
                                        'OD - PI',
                                        EV.OD_CONSULT_DT,
                                        'OD - TI',
                                        ev.od_consult_dt,
                                        ECASE.acc_dt)),
                           'dd/MM/yyyy') ACC_DT,
                   (SELECT TO_CHAR(MAX(WCS.STATUS_START_DT), 'dd/MM/yyyy') STATUS_LAST_UPDATE_DATE
                      FROM WIC_CLAIM_STATUS WCS
                     WHERE WCS.CLAIM_ID = WC.CLAIM_ID) vLatestUpdatedDate,
                   EC.INDUSTRY_CODE INDUSTRY_CODE,
                   EP.ID_NO ID_NO,
                   EP.NAME vWorkerName
              FROM EVENT_PERSON    EP,
                   WIC_CLAIMS      WC,
                   TBL_AA_SUBJECT  TAS,
                   EVENT_COMPANY   EC,
                   EVENT_CASE      ECASE,
                   IR_NOTIFICATION IRN,
                   event_victim    ev
             WHERE EP.ID_NO IS NOT NULL
               AND EP.DELETE_IND = 'F'
               AND EP.INVOLVEMENT = 'VICTIM'
               AND WC.EVENT_CASE_NO = EP.EVENT_CASE_NO
               AND WC.EVENT_PERSON_ID = EP.EVENT_PERSON_ID
               and ep.event_person_id = ev.event_person_id(+)
               AND WC.ASSIGN_OFFICER_ID = TAS.SUBJECT_ID
               AND EC.EVENT_CASE_NO = WC.EVENT_CASE_NO
               AND EC.INVOLVEMENT in ('EMPLOYER', 'EMPLOYER_OCCUPIER')
               AND ECASE.EVENT_CASE_NO = WC.EVENT_CASE_NO
               AND IRN.REF_NO(+) = ECASE.IR_REF_NO
               AND IRN.SUBMIT_TYPE IN ('SI', 'SE')
               AND EC.DELETE_IND = 'F') A ON (B.vFIN = A.ID_NO OR  B.vSPPassportNo = A.ID_NO);
         sp_details_with_dt_rec sp_details_with_dt_cur%rowtype;
          /*vSQL VARCHAR2(4000);
          vFIN  VARCHAR2(9);
          vSPPassportNo  VARCHAR2(16);
          vSPWPNO VARCHAR2(20);
          vSPIssueDate VARCHAR2(10);
          vSPExpiryDate VARCHAR2(10);
          vSPNo VARCHAR2(20);
          vSPExtensionPurpose VARCHAR2(100);
          vIssueSystem VARCHAR2(4);
          vSPActualDepartDate VARCHAR2(10);
          vSPStatus VARCHAR2(30);
          vSPIssuePurpose VARCHAR2(500);
          CLAIM_ID NUMBER(12);
          CLAIM_REF_NO VARCHAR2(20);
          STATUS VARCHAR2(30);
          SUB_STATUS VARCHAR2(30);
          OFFICER_NAME VARCHAR2(201);
          SUBMIT_DT VARCHAR2(10);
          ACC_DT VARCHAR2(10);
          vLatestUpdatedDate VARCHAR2(10);
          INDUSTRY_CODE VARCHAR2(8);
          ID_NO VARCHAR2(50);
          vWorkerName VARCHAR2(100);*/
        BEGIN
      if vIncludeRepatriationDate = 'Y' then
       for sp_details_with_dt_rec in sp_details_with_dt_cur
       loop
       SPECIAL_PASS_CASES_TBL.EXTEND;
       SPECIAL_PASS_CASES_TBL(SPECIAL_PASS_CASES_TBL.LAST) := obj_special_pass_cases(sp_details_with_dt_rec.CLAIM_ID,sp_details_with_dt_rec.CLAIM_REF_NO,sp_details_with_dt_rec.OFFICER_NAME,sp_details_with_dt_rec.SUBMIT_DT,sp_details_with_dt_rec.ACC_DT,sp_details_with_dt_rec.vSPIssueDate,sp_details_with_dt_rec.STATUS,sp_details_with_dt_rec.SUB_STATUS,sp_details_with_dt_rec.vLatestUpdatedDate,sp_details_with_dt_rec.vSPExpiryDate,sp_details_with_dt_rec.INDUSTRY_CODE,sp_details_with_dt_rec.INDUSTRY_CODE,'a',sp_details_with_dt_rec.vSPWPNO,sp_details_with_dt_rec.vFIN,sp_details_with_dt_rec.vSPPassportNo,sp_details_with_dt_rec.vSPNo,sp_details_with_dt_rec.vWorkerName,sp_details_with_dt_rec.vSPExtensionPurpose,sp_details_with_dt_rec.vIssueSystem,sp_details_with_dt_rec.vSPActualDepartDate,sp_details_with_dt_rec.vSPStatus,sp_details_with_dt_rec.vSPIssuePurpose);
       end loop;
      else
       for sp_pass_settle_rec in sp_pass_settle_cur
       loop
       SPECIAL_PASS_CASES_TBL.EXTEND;
       SPECIAL_PASS_CASES_TBL(SPECIAL_PASS_CASES_TBL.LAST) := obj_special_pass_cases(sp_pass_settle_rec.CLAIM_ID,sp_pass_settle_rec.CLAIM_REF_NO,sp_pass_settle_rec.OFFICER_NAME,sp_pass_settle_rec.SUBMIT_DT,sp_pass_settle_rec.ACC_DT,sp_pass_settle_rec.vSPIssueDate,sp_pass_settle_rec.STATUS,sp_pass_settle_rec.SUB_STATUS,sp_pass_settle_rec.vLatestUpdatedDate,sp_pass_settle_rec.vSPExpiryDate,sp_pass_settle_rec.INDUSTRY_CODE,sp_pass_settle_rec.INDUSTRY_CODE,'a',sp_pass_settle_rec.vSPWPNO,sp_pass_settle_rec.vFIN,sp_pass_settle_rec.vSPPassportNo,sp_pass_settle_rec.vSPNo,sp_pass_settle_rec.vWorkerName,sp_pass_settle_rec.vSPExtensionPurpose,sp_pass_settle_rec.vIssueSystem,sp_pass_settle_rec.vSPActualDepartDate,sp_pass_settle_rec.vSPStatus,sp_pass_settle_rec.vSPIssuePurpose);
       end loop;
      end if ;
        RETURN SPECIAL_PASS_CASES_TBL;
      END getListOfSpecialPassCases;
    Thanks,
    SS

  • Is is possible to create Socket using Java Stored Procedures/Function(Ora)?

    Hello Friends,
    Is is possible to create Socket using Java Stored Procedures/Function in Oracle?
    OR
    How I can send a message from oracle to Java Desktop Application which is working like server program?
    Please Guide !!

    J3Ganesh wrote:
    Hello Friends,
    Is is possible to create Socket using Java Stored Procedures/Function in Oracle?No, Oracle was very careful to take that feature out of the JDK provided in Oracle 10/11, but you can buy that feature back for, if I remember correctly, about 5000 dollars. (I actually raised a service request on this and then told my rep what I thought about the answer I received--some thing along the line of money grubbing so and so....)
    How I can send a message from oracle to Java Desktop Application which is working like server program?You can make a table and poll it from time to time from the Java side and write and commit what ever you want to the table. I do not know any way to send a signal from Oracle DB an external Java application--Java or PL/SQL stored procedure.

  • SQL query statement  for stored procedure / function listing ...

    Hi everyone,
    Is there a SQL query to list all the stored procedures and functions of an user in an Oracle 8 database?
    I have this idea:
    select * from USER_SOURCE where TYPE = 'PROCEDURE' or TYPE = 'FUNCTION'
    but I am not too sure whether this is correct.
    Thanks in advance,
    Eric

    Yeah
    I agree with you Garcia , my above posting was a correction to the query mentioned in the question only.
    you are correct
    If you only want the name of the object,
    SELECT Object_Name from User_Objects where object_type in ( 'PROCEDURE' ,'FUNCTION');
    is much faster than Selecting (distinct) from User_Source.

  • Stored Procedure/Function

    Hi All
    I am trying to create a stored procedure that will return a line from a table.
    The basic brief I have is that we have a bunch of tables that set up the user security and they link back to a our_systems table which holds info about all internal systems.
    I need a stored procedure which can be called with a username and a system id. If the user has rights to the system then the line from the our_system table will be returned along with a rights level.
    The hard part is I want to stop the users from seeing all the tables in this section. The original idea is to denie access to the tables but allow access to a stored procedure. Would this work?
    The second point is how can I get this working? I am used to MS SQL Server and this would easily be done by creating the procedure and then doing
    SELECT * FROM spCheckRights('dave',1)
    But Oracle (9i is the version I am using) says that a function / procedure can't be placed there.
    I have 2 version of my procedure
    FUNCTION spCheckRights (login_name In varchar2, drxsystem_id In number)
    return sys_refcursor
    AS
    l_cursor sys_refcursor;
    BEGIN
    open l_cursor for SELECT ds.NAME FROM drx_systems ds WHERE ds.system_id = 1;
    return l_cursor;
    END;
    OR
    FUNCTION spCheckRights (login_name In varchar2, drxsystem_id In number)
    return drx_systems%ROWTYPE
    AS
    drxsys drx_systems%ROWTYPE;
    BEGIN
    SELECT * INTO drxsys FROM drx_systems ds WHERE ds.system_id = 1;
    return drxsys;
    END;
    As you can see neither do all the check rights stuff yet, I wanted to test the basics first. Any views on which method is better for returning a row?
    Any help would be appreciated
    Thanks in advance
    Dave R

    As long as the owner of the function has rights to the tables, the users calling the function do not need to have any rights on the table, only execute on the function.
    The choice of using a procedure or a function (in Oracle they differ) and whether to return a cursor, a collection type or a record type really depends on your front-end requirements, and the number of values you want to return.
    A function can only return a single value. That value can be a cursor or a collection of some kind (think array), or it can be a scalar variable. A procedure can return, through out parameters, multiple values. This set of types that can be returned is the same as for a function.
    So, for a function returning a cursor, you would do something analagous to:
    curvar ResultSet;
    curvar = f(p1, p2);in the language appropriate way. For testing in sqlplus, that would be something like:
    VAR curvar SYS_REFCURSOR;
    exec :curvar := f(p1, p2);
    print curvar;Note, the colon in front of curvar in the exec is required. As long as your calling code can define a variable of drx_systems%ROWTYPE to recieve it, then the second version should work similarly.
    If you will only be returning values from a single row, and if the number of coumns is relatively small, you could also consider a procedure something like:
    PROCEDURE spcheckrights (p_login_name   IN VARCHAR2,
                             p_drxsystem_id IN NUMBER,
                             p_name         OUT VARCHAR2,
                             p_allowed      OUT VARCHAR2) AS
    BEGIN
       SELECT ds.name, ds.allowed
       INTO p_name, p_allowed
       FROM drx_systems
       WHERE system_id = 1;
    END;Then call it passing in variable to get the results. Again, in sqlplus that would look something like:
    VAR name VARCHAR2(30);
    VAR allowed VARCHAR2(1);
    exec p(p1, p2, :name, :allowed);
    print name, allowed;Again, in sqlplus, the colons before name and allowed in the exec call are required.
    HTH
    John

  • Stored Procedure: Function returns Array

    I was just wondering if following scenario is possible in a stored procedure.
    I have a package, which includes 4 different functions and 1 procedure. Procdure uses ref cursor to return values in my reporting tool. What I am trying to do is to write a function which takes input and return array of varchar. Something like..
    Package ABC
    Function student_classes (student_no in Varchar2) return [array]
    begin
    select class_nbr into [array]
    from student_table
    where student_nbr = student_no;
    return [array];
    end student_classes;
    procedure students_info (rpt_cursor IN OUT rpt_type)
    begin
    OPEN rpt_cursor FOR
    select
    student_name,
    student_nbr,
    student_address,
    student_classes (student_nbr) --returns array
    from student_table;
    end student_info; --end of procedure
    end abc; --end of pacakge.
    I used [array], as I am ont sure how to define (syntax) it in spec part of package or in body. I will really appreciate if someone could help me with this function.
    Thank you

    Thanks for the reply Tonguc Y.
    I declared an array in my package declaration
    CREATE OR REPLACE PACKAGE rpt_TESTING_pkg
    AS TYPE rpt_type IS REF CURSOR;
         TYPE DIAGARRAY IS VARRAY(20) OF VARCHAR2(6);
         FUNCTION DIA_CODES (MNO IN VARCHAR2) RETURN DIAGARRAY;
         PROCEDURE member (rpt_cursor IN OUT rpt_type);
    END rpt_TESTING_pkg;
    but then when I try to use it in my function it gives me error that I should declare DIAGARRAY.
    CREATE OR REPLACE PACKAGE BODY rpt_TESTING_pkg
    as
    FUNCTION DIA_CODES (MNO IN VARCHAR2)
                   RETURN DIGARRAY AS diags DIGARRAY;
    begin
    <sql block>
    end dia_codes;
    end rpt_TESTING_pkg;
    Any suggestions.

  • DDL statement/s in stored procedures (FUNCTION)

    Hello all,
    I was trying to create a small function that tests keywords on the basis of successful/failed table creation. If a table can be created with a keyword as identifier, it is a non-reserved keyword, if table creation fails, it is a reserved keyword:
    CREATE OR REPLACE FUNCTION createTableForKeyword (keyword VARCHAR) RETURN BOOLEAN IS
    BEGIN
    CREATE TABLE keyword (x NUMBER);
    -- if no exception occurred, table creation succeeded
    DROP TABLE keyword; drop it
    RETURN FALSE; -- FALSE means non-reserved
    EXCEPTION
    WHEN OTHERS THEN
    -- if exception occurred, table creation failed
    RETURN TRUE; -- TRUE means reserved
    END createTableForKeyword;
    This would have been my first PL/SQL program, but I get the following error:
    PLS-00103: Found symbol "CREATE" when expecting one of:
    begin case declare exit ................
    .............. merge pipe
    I had to translate the error message from German, but it should suffice. Obviously DDL statements in functions are not allowed. How do I solve my problem then, given a table that has one column containing the keyword?:
    CREATE TABLE Keywords (keyword VARCHAR(30));
    I was looking too call this function from a loop, but how would I do this without a function? How do I capture table creation fails without exceptions in functions?
    TIA
    Karsten

    To run DDL inside stored procedure you must use Dynamic SQL. Use EXECUTE IMMEDIATE
    To see if a word is a reserved word just query V$RESERVED_WORDS
    Thanks,
    Karthick.

  • Passing array as a argument in the Stored Procedure/Function

    Hello Friends,
    I need a help, i Want one stored proedure/Function which take array as a argument and return an array also.
    and the size of array should not be fixed.
    I don't want to use Varray because for this I have to specified its size first.
    I think Associative arry will work( For dynamic size) but I am not able to run it .
    Is Associative arry(Index by Pls_Integer) support JDBC?
    If yes, plz give me some clue. I have found some information of associative array in this url
    http://www.oracle.com/technology/oramag/oracle/07-jan/o17odp.html
    But I am not able to run this package through SQL and also not able to connect it through JDBC.
    Is there any other alternative solution?
    Thanks & Regards,
    manish Kumar

    This is my table structure :
    SQL> desc jobs
    Name Null? Type
    JOB_ID      NOT NULL VARCHAR2(10)
    JOB_TITLE      NOT NULL VARCHAR2(35)
    MIN_SALARY NUMBER(6)
    MAX_SALARY NUMBER(6)
    My Requirement is, User will enter the above field value in the form of array. I need to store these value and after manupulating this I will return that value also.
    Here I am using procedure just for testing purpuse.
    In my case I will take one array argumentlike JOB_ID and after manupulating these data I will return that array value.
    I am also not able to run this example through SQL.
    Can U give me exact code for running this prog.
    create or replace package associative_array as
    -- define an associative array type for each column in the jobs table
    type t_job_id is table of jobs.job_id%type index by pls_integer;
    type t_job_title is table of jobs.job_title%type index by pls_integer;
    type t_min_salary is table of jobs.min_salary%type index by pls_integer;
    type t_max_salary is table of jobs.max_salary%type index by pls_integer;
    -- define the procedure that will perform the array insert
    procedure array_insert (p_job_id in t_job_id,
    p_job_title in t_job_title,
    p_min_salary in t_min_salary,
    p_max_salary in t_max_salary);
    end associative_array;
    create or replace package body associative_array as
    -- implement the procedure that will perform the array insert
    procedure array_insert (p_job_id in t_job_id,
    p_job_title in t_job_title,
    p_min_salary in t_min_salary,
    p_max_salary in t_max_salary) is
    begin
    forall i in p_job_id.first..p_job_id.last
    insert into jobs (job_id,
    job_title,
    min_salary,
    max_salary)
    values (p_job_id(i),
    p_job_title(i),
    p_min_salary(i),
    p_max_salary(i));
    end array_insert;
    end associative_array;
    Regards,
    manish Kumar

Maybe you are looking for

  • Custom Table Entry not in Sync between Different Environment

    Hi All, we have different environment like Dev System, Quality system, performance testing system etc... these are all environment customs table entry not in syn .. Table entry should be syn. How to make it syn all the entry between all environment w

  • Load balancing in EP

    Hi , I wanted to know if there are any guides availble which tell me how to do load balancing in portal. We will be having more than 1400 users logging in simultaneously. It would be geat if i can get some guidance SAP R3, BW, SAP SRM will be made av

  • Policies on specific time range

    Does Ironport has in the plan to set the policies to be applied in a specific time ranges, like apply a specific policy on morning then set another one at night? This feature is in the websense & smart filter and should be there in Ironport

  • I am unable to download itunes to my pc even after removing all itunes components

    i am unable to download itunes to my pc even after i have removed all previous components of itunes

  • 2 site-site VPNS, PING behaves differently

    Site-Site VPNs on an ASA5510, trying to ping between the Local Hosts. One VPN the PING gets reply, the other it doesn't. Where it works the Log Viewer shows me traffic btween LocalHost/512 and LocalHost/0 - using port 512? Where it does not work I se