Using Merge procedure done to run forever... Guys please guide me!

I recently updated my procedure to use the merger was intended to insert the record if it is new and do nothing if the record does not exist - I want just include deltas sending us to a flat file on daily basis... .Please help below is what I wrote... but this procedure is TAKING FOR EVER to RUN

PROCEDURE INSERT_RATES_INFO (o_count NUMBER)

IS

-Variables for Procedure_log

v_proc_name VARCHAR2 (60);

v_Name VARCHAR2 (60): = ' MWATCH_SUMMARY_NCIS. INSERT_RATES_INFO';

v_action VARCHAR2 (200);

v_errors VARCHAR2 (500);

d_end_time DATE;

v_comment VARCHAR2 (40);

CURSOR rate_cur

IS

SELECT DECODE (TRIM (RATE_CODE),

"PF", "KVARH"

"ESMBM', 'ESMB."

"EMDSI", "ELECTROMUSCULAIRE."

TRIM (RATE_CODE))

RATE_CODE,

TRIM (USAGE_CODE) usage_code,

Mwatch_Common_NCIS. Season (TRUNC (FROM_DATE)) SEASON_CODE, - must be derived for our purpose

TRIM (PEAK_CODE) peak_code,

TRIM (FROM_DATE) from_date,

To__date NULL,

TO_NUMBER (TRIM (REPLACE (RATE, CHR (13)))-rate)

-"BCC."

-sysdate

OF RATES_ext

UNION

SELECT DECODE (TRIM (RATE_CODE),

"EMDB."

"PMDB.

"MCCD"

"PMDC.

"BLU"

"PREMENSTRUAL DYSPHORIC DISORDER."

"EMDE.

"B.P.ED/M.P.ED,"

"EMDH."

"PMDH."

"ELECTROMUSCULAIRE,"

"MSDP"

"EMDT."

"CDT"

"ESMB."

"PS,"

"CMHTS."

"PSMC,

"ESMD."

"PSMD."

"ESME,"

"MAWP"

"ESMH,"

"PSMH."

"SIMULATION."

"MPS."

'ESMT ',.

"MTSP")

RATE_CODE,

TRIM (USAGE_CODE) usage_code,

Mwatch_Common_NCIS. Season (TRUNC (FROM_DATE)) SEASON_CODE, - must be derived for our purpose

TRIM (PEAK_CODE) peak_code,

TRIM (FROM_DATE) fron_date,

To__date NULL,

TO_NUMBER (TRIM (REPLACE (RATE, CHR (13)))-rate)

-"BCC."

-sysdate

OF RATES_ext

WHERE TO CUT (RATE_CODE) IN

("EMDB',

"MCCD"

"BLU"

"EMDE.

"EMDH."

"ELECTROMUSCULAIRE,"

"EMDT."

"ESMB."

"CMHTS."

"ESMD."

"ESME,"

"ESMH,"

"SIMULATION."

'ESMT');

BEGIN

v_proc_name: = v_name;

v_action: = ' MWATCH_SUMMARY_NCIS refreshing. MWATCH_RATES_NCIS';

-- ******

-* REMOVE MWATCH_RATES_NCIS TABLE

-- ******

-DELETE FROM MWATCH_RATES_NCIS;

-VALIDATION;

FOR c1 IN rate_cur

LOOP

Mwatch_rates_ncis of MERGE IN one

With the HELP of mwatch_rates_ncis b

WE (a.rate_code = b.rate_code

AND a.usage_code = b.usage_code

AND a.season_code = b.season_code

AND a.from_date = b.from_date

AND a.peak_code = b.peak_code

AND a.rate = b.rate)

WHEN NOT MATCHED

THEN

INSERT (RATE_CODE,

USAGE_CODE,

SEASON_CODE, - must be derived for our purpose

PEAK_CODE,

FROM_DATE,

TO__DATE,

RATE,

FROM_SYSTEM,

CREATION_DATE)

VALUES (c1. RATE_CODE,

C1. USAGE_CODE,

C1. SEASON_CODE, - must be derived for our purpose

C1. PEAK_CODE,

C1. FROM_DATE,

C1. TO__DATE,

C1. RATE,

"BCC",

SYSDATE);

END LOOP;

COMMIT;

SELECT COUNT (*) IN O_COUNT OF MWATCH_RATES_NCIS;

EXCEPTION

WHILE OTHERS

THEN

v_action: = ' * failure * ' | v_action;

v_errors: =.

"Sql error code: '.

|| SQLCODE

|| "Sql error message: ' '.

|| SQLERRM;

mwatch_common_ncis.mwatch_log_error (v_proc_name,

v_action,

v_errors);

END INSERT_RATES_INFO;

Use the selection from the cursor instead of the B table.

Mwatch_rates_ncis of MERGE IN one

USING (select...) B

(Comparison LOGIC)

...

Tags: Database

Similar Questions

  • Void query causes the query to run forever

    Here are the two original requests that I started with. They refer to the correct when executed separately results but when combined it causes the query to run and run and run and run forever. I try to delete the query results of query 2 1 with a statement of "not in". 3 is the query that runs always with this 'not in' statement that runs forever. Please help me! *!

    -Request 1
    SELECT DISTINCT
    S.NAME,
    S.RRN,
    RTRIM (LTRIM (S.STREET_NBR) |) ' ' ||
    RTRIM (SUBSTR (S.STREET, 33, 2)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 1, 28)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 29, 4)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 35, 2))) | ' ' ||
    NVL2 (S.UNIT_NBR, ' #',' ') | ' ' ||
    ADDRESS LTRIM (S.UNIT_NBR),
    CITY OF S.CITY_NAME,
    S.STPV_CODE STATE,
    RTRIM (S.ZIP_CODE) |
    '-'||
    S.ZIP_PLUS4 ZIP,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR (S.EXPR_DATE, 'MMDDYY') START_DATE,
    TO_CHAR ((P.EFF_DATE-1), 'MMDDYY') END_DATE.
    TO_CHAR(SYSDATE,'MMDDYY') FILE_DATE,
    ROUND ((-1 * (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT)) * 100) TO BALANCE.
    S.STAT_FLAG,
    MIN (P.SEQ_CTR)
    Of
    THE DISCUS THROW. SUB_SUN S,.
    THE DISCUS THROW. TRN_STP_SUN P,.
    THE DISCUS THROW. TRN_MEM_SUN M.
    (SELECT
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    MIN (SEQ_CTR)
    Of
    THE DISCUS THROW. TRN_DLR_SUN
    WHERE
    TRAN_CODE = 'BILL' AND
    EFF_DATE > = TRUNC (SYSDATE)-65
    GROUP BY
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    D SEQ_CTR)
    WHERE
    S.RRN = P.SUB_RRN AND
    S.RRN = M.SUB_RRN AND
    S.RRN = D.SUB_RRN (+) AND
    TRIM (P.PAPR_CODE) = "SS" AND
    S.BILL_CODE NOT IN ("PRTY", "EZCC', 'EMPB', 'CTCE', 'NSPC", "NYET", "NIEF", "SAMP", "ALTP", "COMP", "CMHC", "MAIL") AND
    TRIM (S.STAT_FLAG) = 'F' AND
    P.TYPE = 'P' AND
    P.SPRS_CODE IN ('NOPY","CHMD","SCOUT","TIME") AND
    TRUNC (P.EFF_DATE) BETWEEN TRUNC (SYSDATE)-43 AND TRUNC (SYSDATE)-29 AND
    S.NAME_FLAG! = 'B' AND
    (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + (S.DLVF_AMT)) <-6.99 AND
    M.CODE! = 'DISP' AND
    NOT EXIST
    (SELECT
    Q.HOME_PHONE
    Of
    THE DISCUS THROW. SUB_SUN Q
    WHERE
    S.HOME_PHONE = Q.HOME_PHONE AND
    Q.SUBT_CODE IN ('HARD DRIVES', 'HDLV') AND
    Q.STAT_FLAG = 'C')
    GROUP BY
    S.NAME,
    S.RRN,
    RTRIM (LTRIM (S.STREET_NBR) |) ' ' ||
    RTRIM (SUBSTR (S.STREET, 33, 2)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 1, 28)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 29, 4)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 35, 2))) | ' ' ||
    NVL2 (S.UNIT_NBR, ' #',' ') | ' ' ||
    LTRIM (S.UNIT_NBR),
    S.CITY_NAME,
    S.STPV_CODE,
    RTRIM (S.ZIP_CODE) |
    '-'||
    S.ZIP_PLUS4,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR (S.EXPR_DATE, 'MMDDYY'),
    TO_CHAR ((P.EFF_DATE-1), 'MMDDYY').
    TO_CHAR (SYSDATE, 'MMDDYY'),
    (-1 * (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT) * 100),
    S.STAT_FLAG
    ORDER BY 10;

    -The application 2
    Select
    THE DISCUS THROW. TRN_STP_SUN. SUB_RRN
    Of
    THE DISCUS THROW. TRN_STP_SUN,
    (select SUB_RRN, min (seq_ctr) MINSEQ, SRCE_CODE1 of DISCUS. SUB_RRN TRN_STP_SUN, SRCE_CODE1 group) MIN_ROWS
    where
    THE DISCUS THROW. TRN_STP_SUN. MIN_ROWS = SUB_RRN. SUB_RRN
    And DISCUS. TRN_STP_SUN. MIN_ROWS = SRCE_CODE1. SRCE_CODE1
    And DISCUS. TRN_STP_SUN. MIN_ROWS = SEQ_CTR. MINSEQ
    And DISCUS. TRN_STP_SUN. SRCE_CODE1 IN ('FREE', 'ALTP","CANADA","E","DENY","DOOR")
    And TRUNC (DISCUS. TRN_STP_SUN. EFF_DATE) BETWEEN TRUNC (SYSDATE)-460 AND TRUNC (SYSDATE)-0
    And DISCUS. TRN_STP_SUN. TYPE = S"

    Request 3 (Broken query)
    SELECT DISTINCT
    S.NAME,
    S.RRN,
    RTRIM (LTRIM (S.STREET_NBR) |) ' ' ||
    RTRIM (SUBSTR (S.STREET, 33, 2)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 1, 28)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 29, 4)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 35, 2))) | ' ' ||
    NVL2 (S.UNIT_NBR, ' #',' ') | ' ' ||
    ADDRESS LTRIM (S.UNIT_NBR),
    CITY OF S.CITY_NAME,
    S.STPV_CODE STATE,
    RTRIM (S.ZIP_CODE) |
    '-'||
    S.ZIP_PLUS4 ZIP,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR (S.EXPR_DATE, 'MMDDYY') START_DATE,
    TO_CHAR ((P.EFF_DATE-1), 'MMDDYY') END_DATE.
    TO_CHAR(SYSDATE,'MMDDYY') FILE_DATE,
    ROUND ((-1 * (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT)) * 100) TO BALANCE.
    S.STAT_FLAG,
    MIN (P.SEQ_CTR) SEQ_CTR
    Of
    THE DISCUS THROW. SUB_SUN S,.
    THE DISCUS THROW. TRN_STP_SUN P,.
    THE DISCUS THROW. TRN_MEM_SUN M.
    (SELECT
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    MIN (SEQ_CTR)
    Of
    THE DISCUS THROW. TRN_DLR_SUN
    WHERE
    TRAN_CODE = 'BILL' AND
    EFF_DATE > = TRUNC (SYSDATE)-65
    GROUP BY
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    D SEQ_CTR)
    WHERE
    S.RRN = P.SUB_RRN AND
    S.RRN = M.SUB_RRN AND
    S.RRN = D.SUB_RRN (+) AND
    TRIM (P.PAPR_CODE) = "SS" AND
    S.BILL_CODE NOT IN ("PRTY", "EZCC', 'EMPB', 'CTCE', 'NSPC", "NYET", "NIEF", "SAMP", "ALTP", "COMP", "CMHC", "MAIL") AND
    TRIM (S.STAT_FLAG) = 'F' AND
    P.TYPE = 'P' AND
    * S.RRN NOT IN (select + _ *)
    DISCUS. TRN_STP_SUN. SUB_RRN_ *.
    de_ *
    DISCUS. TRN_STP_SUN,_ *.
    + (select SUBNRNS, min (seq_ctr) MINSEQ, SRCE_CODE1 de DISCUS.) SUB_RRN TRN_STP_SUN, SRCE_CODE1 group) MIN_ROWS + _ *.
    _ *
    DISCUS. TRN_STP_SUN. MIN_ROWS = SUB_RRN. SUB_RRN_ *.
    And DISCUS. TRN_STP_SUN. MIN_ROWS = SRCE_CODE1. SRCE_CODE1_ *.
    And DISCUS. TRN_STP_SUN. MIN_ROWS = SEQ_CTR. MINSEQ_ *.
    And DISCUS. TRN_STP_SUN. SRCE_CODE1 IN ('FREE', 'ALTP","CANADA","E","DENY","DOOR")_ *.
    And DISCUS. TRN_STP_SUN. TYPE = the of '_ *.
    and discus.trn_stp_sun.sub_rrn is not null) *AND _
    P.SPRS_CODE IN ('NOPY","CHMD","SCOUT","TIME") AND
    TRUNC (P.EFF_DATE) BETWEEN TRUNC (SYSDATE)-35 AND TRUNC (SYSDATE)-29 AND
    S.NAME_FLAG! = 'B' AND
    (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + (S.DLVF_AMT)) <-6.99 AND
    M.CODE! = 'DISP' AND
    NOT EXIST
    (SELECT
    Q.HOME_PHONE
    Of
    THE DISCUS THROW. SUB_SUN Q
    WHERE
    S.HOME_PHONE = Q.HOME_PHONE AND
    Q.SUBT_CODE IN ('HARD DRIVES', 'HDLV') AND
    Q.STAT_FLAG = 'C')
    GROUP BY
    S.NAME,
    S.RRN,
    RTRIM (LTRIM (S.STREET_NBR) |) ' ' ||
    RTRIM (SUBSTR (S.STREET, 33, 2)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 1, 28)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 29, 4)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 35, 2))) | ' ' ||
    NVL2 (S.UNIT_NBR, ' #',' ') | ' ' ||
    LTRIM (S.UNIT_NBR),
    S.CITY_NAME,
    S.STPV_CODE,
    RTRIM (S.ZIP_CODE) |
    '-'||
    S.ZIP_PLUS4,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR (S.EXPR_DATE, 'MMDDYY'),
    TO_CHAR ((P.EFF_DATE-1), 'MMDDYY').
    TO_CHAR (SYSDATE, 'MMDDYY'),
    (-1 * (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT) * 100),
    S.STAT_FLAG,
    P.SEQ_CTR
    ORDER BY 10;

    Yes, your problem is that the not exists clause. Try:

    SELECT DISTINCT
    S.NAME,
    S.RRN,
    RTRIM(LTRIM(S.STREET_NBR) || ' ' ||
    RTRIM(SUBSTR(S.STREET,33,2)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,1,28)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,29,4)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,35,2))) || ' ' ||
    NVL2(S.UNIT_NBR, '#', ' ') || ' ' ||
    LTRIM(S.UNIT_NBR) ADDRESS,
    S.CITY_NAME CITY,
    S.STPV_CODE STATE,
    RTRIM(S.ZIP_CODE) ||
    '-'||
    S.ZIP_PLUS4 ZIP,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR(S.EXPR_DATE,'MMDDYY') START_DATE,
    TO_CHAR((P.EFF_DATE-1),'MMDDYY') END_DATE,
    TO_CHAR(SYSDATE,'MMDDYY') FILE_DATE,
    ROUND((-1*(S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT))*100) BALANCE,
    S.STAT_FLAG,
    MIN(P.SEQ_CTR) SEQ_CTR
    FROM
    DISCUS.SUB_SUN S,
    DISCUS.TRN_STP_SUN P,
    DISCUS.TRN_MEM_SUN M,
    (SELECT
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    MIN(SEQ_CTR)
    FROM
    DISCUS.TRN_DLR_SUN
    WHERE
    TRAN_CODE = 'BILL' AND
    EFF_DATE >= TRUNC(SYSDATE)-65
    GROUP BY
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    SEQ_CTR)D,
    (select distinct
    DISCUS.TRN_STP_SUN.SUB_RRN
    from
    DISCUS.TRN_STP_SUN,
    (select SUB_RRN, min(seq_ctr) MINSEQ, SRCE_CODE1 from DISCUS.TRN_STP_SUN group by SUB_RRN, SRCE_CODE1) MIN_ROWS
    where
    DISCUS.TRN_STP_SUN.SUB_RRN = MIN_ROWS.SUB_RRN
    And DISCUS.TRN_STP_SUN.SRCE_CODE1 = MIN_ROWS.SRCE_CODE1
    And DISCUS.TRN_STP_SUN.SEQ_CTR = MIN_ROWS.MINSEQ
    And DISCUS.TRN_STP_SUN.SRCE_CODE1 IN ('FREE','ALTP','ELSN','EMPL','NIE','DOOR')
    And DISCUS.TRN_STP_SUN.TYPE = 'S'
    And DISCUS.TRN_STP_SUN.SUB_RRN is not null) Z
    WHERE
    S.RRN = P.SUB_RRN AND
    S.RRN = M.SUB_RRN AND
    S.RRN = D.SUB_RRN(+) AND
    TRIM(P.PAPR_CODE) = 'SS' AND
    S.BILL_CODE NOT IN ('PRTY','EZCC','EMPB','EMPP','NSPC','NIET','NIEF','SAMP','ALTP','COMP','SCHL','MAIL') AND
    TRIM(S.STAT_FLAG) = 'F' AND
    P.TYPE = 'P' AND
    P.SPRS_CODE IN ('NOPY','CHMD','OTHR','TIME') AND
    TRUNC(P.EFF_DATE) BETWEEN TRUNC(SYSDATE)-35 AND TRUNC(SYSDATE)-29 AND
    S.NAME_FLAG != 'B' AND
    (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + (S.DLVF_AMT)) < -6.99 AND
    M.CODE != 'DISP'  and
    NOT EXISTS
    (SELECT
    Q.HOME_PHONE
    FROM
    DISCUS.SUB_SUN Q
    WHERE
    S.HOME_PHONE = Q.HOME_PHONE AND
    Q.SUBT_CODE IN ('HDDS','HDLV') AND
    Q.STAT_FLAG = 'C')
    AND Z.SUB_RRN (+) = S.RRN
    AND Z.SUB_RRN is null
    GROUP BY
    S.NAME,
    S.RRN,
    RTRIM(LTRIM(S.STREET_NBR) || ' ' ||
    RTRIM(SUBSTR(S.STREET,33,2)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,1,28)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,29,4)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,35,2))) || ' ' ||
    NVL2(S.UNIT_NBR, '#', ' ') || ' ' ||
    LTRIM(S.UNIT_NBR),
    S.CITY_NAME,
    S.STPV_CODE,
    RTRIM(S.ZIP_CODE) ||
    '-'||
    S.ZIP_PLUS4,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR(S.EXPR_DATE,'MMDDYY'),
    TO_CHAR((P.EFF_DATE-1),'MMDDYY'),
    TO_CHAR(SYSDATE,'MMDDYY'),
    (-1*(S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT)*100),
    S.STAT_FLAG,
    P.SEQ_CTR
    ORDER BY 10;
    
  • using stored procedures - I can't seem to get the right settings

    I am wanting to use stored procedures to create variables of substitution use UC4 (Appworx). (the databases I use are 10g) To do this, I first need to run command line in PL/SQL procedures. I don't seem to be able to create the correct command. This is the part of the package that I want to call



    CREATE OR REPLACE
    PACKAGE BODY 'APPLICATION_PACKAGE' AS


    PROCEDURE GET_APP_PARAM (V_APP_PARAM_ID IN CCOK. CC_APP_PARAM_DETAIL. APP_PARAM_ID % TYPE,
    V_APP_PARAM_NAME IN CCOK. CC_APP_PARAM_DETAIL. APP_PARAM_NAME % TYPE,
    OUT NOCOPY CCOK V_APP_PARAM_VALUE. CC_APP_PARAM_DETAIL. APP_PARAM_VALUE % TYPE)


    AS


    BEGIN

    SELECT APP_PARAM_VALUE
    IN V_APP_PARAM_VALUE
    TO CCOK. CC_APP_PARAM_DETAIL
    WHERE APP_PARAM_ID = V_APP_PARAM_ID
    AND APP_PARAM_NAME = V_APP_PARAM_NAME;


    END;




    It's the exact command I use command line

    run application_package.get_app_param(1000,'RUN_TYPE')

    When I do this I get invalid statements expected but still tweaking doesn't fix it and does not give me a clear idea of what I need to do to fix it.
    I get this sort of thing


    SQL & gt; run ccok.application_package.get_app_param(1000,'run_type')
    BEGIN ccok.application_package.get_app_param(1000,'run_type'); END;


    *
    ERROR on line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'GET_APP_PARAM '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored



    SQL & gt; run ccok.application_package.get_app_param(1000,'run_type',:result)
    SP2-0552: Bind variable 'RESULT' undeclared.
    SQL & gt; run ccok.application_package.get_app_param('1000','run_type')
    BEGIN ccok.application_package.get_app_param('1000','run_type'); END;


    *
    ERROR on line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'GET_APP_PARAM '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored



    Any help will be appreciated with more recognition.

    It's interesting.

    Package specification has "GET_APP_PARAM" with 2 parameters.
    The package body has "GET_APP_PARAM" with 3 settings.

    I tested this out case in my db. Oracle balk when the package body is compiled, but shows no errors.

    test@ORA10G> --
    test@ORA10G> DROP PACKAGE "APPLICATION_PACKAGE";
    
    Package dropped.
    
    test@ORA10G>
    test@ORA10G> drop table cc_app_param_detail;
    
    Table dropped.
    
    test@ORA10G> create table cc_app_param_detail (
      2    app_param_id    number(4),
      3    app_param_name  varchar2(20),
      4    app_param_value varchar2(20));
    
    Table created.
    
    test@ORA10G>
    test@ORA10G> insert into cc_app_param_detail
      2  select 1, 'name_1', 'value_1' from dual union all
      3  select 2, 'name_2', 'value_2' from dual union all
      4  select 3, 'name_3', 'value_3' from dual;
    
    3 rows created.
    
    test@ORA10G> commit;
    
    Commit complete.
    
    test@ORA10G>
    test@ORA10G> select * from cc_app_param_detail;
    
    APP_PARAM_ID APP_PARAM_NAME       APP_PARAM_VALUE
    ------------ -------------------- --------------------
               1 name_1               value_1
               2 name_2               value_2
               3 name_3               value_3
    
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> CREATE OR REPLACE PACKAGE "APPLICATION_PACKAGE" AS
      2    PROCEDURE GET_APP_PARAM (
      3      V_APP_PARAM_ID IN TEST.CC_APP_PARAM_DETAIL.APP_PARAM_ID%TYPE,
      4      V_APP_PARAM_NAME IN TEST.CC_APP_PARAM_DETAIL.APP_PARAM_NAME%TYPE);
      5  --    V_APP_PARAM_VALUE OUT NOCOPY TEST.CC_APP_PARAM_DETAIL.APP_PARAM_VALUE%TYPE);
      6  END;
      7  /
    
    Package created.
    
    test@ORA10G> show err
    No errors.
    test@ORA10G>
    test@ORA10G> DESC APPLICATION_PACKAGE
    PROCEDURE GET_APP_PARAM
     Argument Name                  Type                    In/Out Default?
     ------------------------------ ----------------------- ------ --------
     V_APP_PARAM_ID                 NUMBER(4)               IN
     V_APP_PARAM_NAME               VARCHAR2(20)            IN
    
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> CREATE OR REPLACE PACKAGE BODY "APPLICATION_PACKAGE" AS
      2    PROCEDURE GET_APP_PARAM (
      3      V_APP_PARAM_ID    IN TEST.CC_APP_PARAM_DETAIL.APP_PARAM_ID%TYPE,
      4      V_APP_PARAM_NAME  IN TEST.CC_APP_PARAM_DETAIL.APP_PARAM_NAME%TYPE,
      5      V_APP_PARAM_VALUE OUT NOCOPY TEST.CC_APP_PARAM_DETAIL.APP_PARAM_VALUE%TYPE)
      6    AS
      7    BEGIN
      8      SELECT APP_PARAM_VALUE
      9      INTO V_APP_PARAM_VALUE
     10      FROM TEST.CC_APP_PARAM_DETAIL
     11      WHERE APP_PARAM_ID = V_APP_PARAM_ID
     12      AND APP_PARAM_NAME = V_APP_PARAM_NAME;
     13    END;
     14  END;
     15  /
    
    Warning: Package Body created with compilation errors.
    
    test@ORA10G> show err
    No errors.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> var x varchar2(10)
    test@ORA10G> exec test.application_package.get_app_param(1,'name_1',:x);
    BEGIN test.application_package.get_app_param(1,'name_1',:x); END;
    
          *
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'GET_APP_PARAM'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    
    test@ORA10G> print x
    
    X
    --------------------------------
    
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> select object_type, object_name, status from user_objects where object_name='APPLICATION_PACKAGE';
    
    OBJECT_TYPE         OBJECT_NAME                    STATUS
    ------------------- ------------------------------ -------
    PACKAGE             APPLICATION_PACKAGE            VALID
    PACKAGE BODY        APPLICATION_PACKAGE            INVALID
    
    test@ORA10G>
    test@ORA10G>
    

    What do you see as the State of the art and the body when he is interviewed command-line SQL * more?

    The solution would be to add the third parameter to the package specification and recompile.

    HTH,
    isotope

  • "Don't run specified windows applications" How do I turn off notifications?

    So I use Group Policy "do not run windows applications specified", but this program keeps advising me that his weight. I have implemented this option to disable notifications from another program so I replaced one irritating popup with another!  I don't understand why Microsoft would warn me every time its something here.  Imagine if they did with all that has happened in the background. Which is not a riot.  We would have thousands of notifications of a second.

    Is there a way of turning notifications off?  Nothing in the setting window where you would think it would be.

    See this:

  • In the mapping of an interface using ODI procedure

    Hello

    Yesterday, I asked question how will you use ODI procedure in the mappings of an interface for complex operations on the fields?

    I don't know if this can be done in ODI.

    Any help on this would be helpful.

    Kind regards

    Mahesh

    Don't forget the basic principle of procedure and function.

    Now coming to your question, first of all to a large no second thing its an impractical and immature question to ask someone to use the ODI procedure in the mappings of an interface for complex operations on the fields. (Or maybe issue was something and you wrote something. Too bad)

    The main reason for the ODI process must allow group of actions that do not fit within the Interface and considered that when something can be achieved with the interface. She's. I always encourage to turn against the interviewer in such circumstances.

    What should have been the question is if we can use the DB procedure in the interface mapping. Answer is that it depends. I can use the phases of analysis to write some java-based codes to call a db procedure. But this isn't for my fields from the source to the complex functioning and codes based on java will be isolated from each other.

    For a complex operation, you use a function that can be called without flaw inside the DML and DQL statements. Inside the function, you can use as many procedure to do the massage/validation/transformation.

    Chantal

  • How to create the report using the procedure.

    Hi all

    I want to create the report in the apex. But I don't have a sql code. I have a single procedure. Is it possible to create the report using this procedure in the apex.

    CREATE OR REPLACE PROCEDURE headcsv_prc2

    AS

    CURSOR cr_header

    IS

    SELECT ood.organization_code, fm.formula_no AS "FORMULA_NAME."

    FM.formula_vers AS "FORMULA_VERSION."

    FM.formula_desc1 AS "FORMULA_DESC."

    DECODE (fm.formula_status,

    100, 'new ',.

    400, "approved for use in the laboratory."

    700, "allow the general."

    800, "We Hold."

    900, "frozen."

    1000, "obsolete/archived.

    ) AS "FORMULA_STATUS."

    DECODE (fd.line_type, '1', msib.segment1).

    DECODE (fd.line_type, '-1', msib.segment1 ') ingrediant.

    DECODE (fd.line_type, '2', msib.segment1) AS "BY_PRODUCT."

    DECODE (by_product_type,

    "W', 'waste."

    "R',"rework. "

    "Y', 'Yield."

    The of ', 'Sample. "

    NULL VALUE

    ) AS "BY_PRODUCT_TYPE".

    Of org_organization_definitions ood,.

    fm_form_mst fm,

    fm_matl_dtl fd,

    mtl_system_items_b msib

    WHERE ood.organization_id = fm.owner_organization_id

    AND fm.owner_organization_id = msib.organization_id

    AND msib.organization_id = fd.organization_id

    AND fd.organization_id = ood.organization_id

    AND fm.formula_id = fd.formula_id

    AND msib.inventory_item_id = fd.inventory_item_id

    - and fm. FORMULA_NO like '% THE % '.

    AND fd.line_type IN ('1 ', ' 2', '-1' ")

    Ood.organization_code GROUP,

    FM.formula_no,

    FM.formula_vers,

    FM.formula_desc1,

    FM.formula_status,

    FD.line_type,

    MSIB. Segment1,

    by_product_type

    ORDER BY fm.formula_no, fm.formula_vers;

    BEGIN

    Dbms_output.put_line (INITCAP ('the ORGANIZATION CODE')

    || ','

    || INITCAP ('NAME FORMULA')

    || ','

    || INITCAP ('FORMULA VERSION')

    || ','

    || INITCAP ('FORMULA DESC')

    || ','

    || INITCAP ('FORMULA STATUS')

    || ','

    || INITCAP ('PRODUCT')

    || ','

    || INITCAP ('INGREDIANT")

    || ','

    || INITCAP ("PER PRODUCT")

    || ','

    || INITCAP ('PER TYPE OF PRODUCT")

    );

    FOR ch IN cr_header

    LOOP

    Dbms_output.put_line (ch.organization_code

    || ','

    || ch.formula_name

    || ','

    || ch.formula_version

    || ','

    || '"'

    || ch.formula_desc

    || '"'

    || ','

    || ch.formula_status

    || ','

    || ch. Product

    || ','

    || ch.ingrediant

    || ','

    || ch.by_product

    || ','

    || ch.by_product_type

    );

    END LOOP;

    EXCEPTION

    WHILE OTHERS

    THEN

    Dbms_output.put_line (' No error: ' |) SQLCODE. "Error Msg: ' '.

    || SQLERRM

    );

    END;

    EXEC HeadCSV_Prc2



    Thank you

    Rambeau

    Hi Christian,

    In addition to the fact that the Oracle database has an internal Java engine and it would be possible for Apex call a Java stored procedure, the Apex really has nothing to do with Java. To create a report, you discovered, you specify a SQL query. In certain circumstances, you can embed a query in a PL/SQL function, but the incorporation of an arbitrary Java application and waiting for it to be called from Apex for a kind of security is there with the fairies.

    I recommend you research the Apex and then enter your so-called "higher authorities" how things work.

    Concerning

    André

  • "Detection of Java on your computer" runs forever

    Hello

    Win 7 32-bit / IE installation 9 / Clean - wiped the hard drive and began to charge

    Installed upgrading Java 7 10 (1.7.0_10 - b18, according to the Java Control Panel applet) starting from java.com, without any error.

    When I go into the Installation verification page, 'Detection of Java on your computer' applet runs forever.

    Removing Java, reinstalled, restarted the browser and the computer several times, same result.

    He tried another PC, also Win 7 32 bit / IE9 / Clean install - same result.

    What is going on?

    Thank you

    Published by: 979978 on 4 January 2013 09:35

    Check the proxy settings, I suspect this is the problem.
    It is often the case when a class file cannot be loaded.

    http://docs.Oracle.com/javase/7/docs/TechNotes/guides/deployment/deployment-guide/JCP.html#General scroll down to "use a proxy server".

    If problems are still visible, view the Console output. This turns on the Advanced Settings tab.
    http://docs.Oracle.com/javase/7/docs/TechNotes/guides/deployment/deployment-guide/JCP.html#advanced
    Console for more information: http://docs.oracle.com/javase/7/docs/technotes/guides/deployment/deployment-guide/console.html

    Less likely, but possible, are the AVs, firewalls, routers, etc.

    -Roger

  • Query runs forever - suggestions - ideas - tips

    Hi all

    I have the following situation:

    (1) 1 database: XE 10 g Release 10.2.0.1.0 - Production
    (2) database of 02:10 g Enterprise Edition Release 10.2.0.4.0 - Production 64-bit
    (3) Dblink 1 pointing to the database 2 data
    (4) synonyms created within database 1, pointing to tables and packages of data 2:
    -"mytable1" exists in database 2 therefore a synonym of "mytable1" is created in the database 1
    -"mytable2" exists in the 2 database so a synonym of "mytable2" is created in the database 1
    -"mypackage" exists in the 2 database so a synonym of "mypackage" is created in the database 1
    (5) of course select and run rights are granted
    (6) request:
    SELECT field1
    OF myshcema.mytable1
    WHERE Field2 = myshcema.mypackage.myfunction ("PARAMVALUE"))
    AND EXISTS (SELECT 1 FROM myshcema.mytable2 WHERE field_in_tab2 = field_in_tab1)
    7) problem. This query runs forever
    (8) explain plan
    COST OF OPERATION - OBJECT_NAME - OPTIONS-
    SELECT THE STATEMENT - 17
    -> FILTER-
    -->--> FILTER - 3
    -->-->--> REMOTE - mytable1 -.
    -->--> REMOTE - mytable2 - 1

    (9) now I get the value returned by the function and re-run the previous query:
    -Select myshcema.mypackage.myfunction ("PARAMVALUE")) twice;
    -return value is * 89787621 *.
    -re - run the query:
    SELECT field1
    OF myshcema.mytable1
    WHERE Field2 = * 89787621 *.
    AND EXISTS (SELECT 1 FROM myshcema.mytable2 WHERE field_in_tab2 = field_in_tab1)

    (10) to explain the plan
    COST OF OPERATION - OBJECT_NAME - OPTIONS-
    SELECT THE STATEMENT - REMOTE - 3
    -> NESTED LOOPS - SEMI - 3
    -->--> - MY_UK_NAME - INDEX RANGE SCAN - 3
    -->--> SCAN limited UNIQUE - MY_2ND_UK - index - 0


    And the results are instant

    Now my question: can someone direct me on knowledge if a trick or something else will correct this situation? Due to restrictions I can't explain currently here, I'm not able to change the code first gets the value, and then run the query.

    Thanks for the help
    G

    Published by: G on May 17, 2011 09:07

    Published by: G on May 17, 2011 09:10

    I think that driving site tip woud be the frist thing I've tried. If for any reason any Oracle does not seem to be able to use the trick or if councils are strongly wrong on your website then here is another approach to the problem.

    Code of the query in a vision and set the view on the remote database and local questions to interrogate the remote view.

    HTH - Mark D Powell.

  • I am interested in the Apple Watch for fitness, but want to be able to use the phone when I run without carry my iPhone is possible

    I am interested in the Apple Watch for fitness, but to use the phone when I run it without having to carry my iPhone 6 s, is it possible?

    You can, but the Fitness app works better if you have the iPhone on your person.

    Use the activity on your Apple Watch - Apple Support

  • I always use Firefox, but when I run CCleaner, Internet Explorer files appear... How? Why?

    I never use Internet Explorer, always use Firefox, but when I run CCleaner, some files appear in Internet Explorer. Can't understand why?

    Note If you are using MS plugins like the Windows Media Player and Silverlight these plugins to store their data in the storage of the cache and cookies IE location.

  • I had a problem with slow, so I used "reset". The popup ran forever so I stopped it. Now I can not remove or add the program.

    I had a problem with slow, so I used "reset". The popup ran forever so I stopped it. Now I can not use, remove or add the program. How should I proceed?

    TIA,
    BWSwede

    Try to create a new profile.

    See "create a profile":

    If the new profile works then you can transfer files from a profile in the new profile, but make sure not to copy corrupted files.

    What problems do you have that you want to reset Firefox?

    Firefox creates a new folder of old data of Firefox on the desktop?

    If reset you Firefox and a new profile is created and some of your data (bookmarks, passwords, cookies, form data) is automatically imported and your current profile will be moved on the desktop (old data of Firefox).

  • I use Firefox version 3.0.19 and I have Windows 7. When I use Firefox as a browser, I can't print my emails. I get an error message: «not available pcfax» If I use IE I don't have no problems printing emails.

    I use Firefox version 3.0.19 and I have Windows 7, which came with a new computer. When I use Firefox as a browser, I can't print my emails. I get an error message: «not available pcfax» If I use IE I don't have no problems printing emails.

    This has happened

    Each time Firefox opened

    == 1 day with the new computer about two weeks ago.

    Looks like you got the wrong printer selected.

    When you get the print window, choose another printer in your printer dropdown. You seem to have a fax printer selected instead of a physical printer.

  • Commander supreme 1 I lost my drive there at - it a patch or crack, that I could use so I don't have to buy the game again

    Commander supreme 1 I lost my drive there at - it a patch or crack, that I could use so I don't have to buy the game again

    Hello

    You may need to contact the manufacturer of the game for the disc

  • Windows the dates that I am up to 22 gigabytes off 69.5 gigabits on drive D. Can someone help me with this problem so I don't run out of space

    original title: windows dates

    on my computer windows vista home basic, is Drive - D were all my windows updates are stored. I do not stor photos or other long-term files on my computer.
    I ' am up to 22 gigabytes of 69.5 gigabits on drive D. Can someone help me with this problem so I don't run out of space.
    Also all update my windows go back as far as the year 2008. Note-windows update are the only element which appear on the D drive and also when I backup windows is were I notice less space on this drive. Is there something I can do so I don't run out of space on this drive?
    could someone help me with this problem.

    I have found, do not delete the old windows updates.
    they could corrupt your entire system.

  • Windows 7 update runs forever

    I have a laptop HP (G71 - 448 CL) that has been sitting for a few years. Happens to me to remember installing free Windows 10 was al; more more and pulled the laptop to install. I was a day late to install it for free, but when I tried to update it started running forever.

    I downloaded the update diagnostic and it ran also found a tool to reset update and did this.

    I ran to a DVD and Malwarebytes Microsoft Security databases.

    When I launches the update, he said that there are no updates installed and now worked for three days with the Green banner goes pretty slowly. This screen also indicates that it is 9 in option updates available, but does not show what they are.

    How long should I wait to get it working?

    I have a direct connection cable to the cable router.

    You can wait as long as you want too

    But it would be best to follow these instructions :)

    The manual installation of updates that you have to change your update settings to never check the updates and restart the machine first.

    Make sure that KB3020369 is installed, otherwise install it manually.

    These links will prompt you to download as soon as you click on them just for you give a heads up :)

    Win - 7 32-bit

    https://download.Microsoft.com/download/C/0/8/C0823F43-BFE9-4147-9B0A-35769CBBE6B0/Windows6.1-KB3020369-x86.MSU

    Win - 7 64-bit

    https://download.Microsoft.com/download/5/D/0/5D0821EB-A92D-4CA2-9020-EC41D56B074F/Windows6.1-KB3020369-x64.MSU

    Then manually install KB3172605

    https://support.Microsoft.com/en-us/KB/3172605

    KB3172605

    Win - 7 32-bit

    https://download.Microsoft.com/download/C/D/5/CD5DE7B2-E857-4BD4-AA9C-6B30C3E1735A/Windows6.1-KB3172605-x86.MSU

    Win - 7 64-bit

    https://download.Microsoft.com/download/5/6/0/560504D4-F91A-4DEB-867F-C713F7821374/Windows6.1-KB3172605-x64.MSU

    After your windows update settings back to what you had before, and manually check the updates and the rest should appear shortly.

    If you have problems with the installer of stand-alone stalling stop and disable the windows update service,

    Switch back to default after installing other updates

    If you need Visual AIDS to refer to this

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-update/Windows-7-update-problems-read-this-first/28147a5f-B0B0-480b-bed9-834a2da7a375

Maybe you are looking for

  • OS Sierra - Time Machine

    Since I upgraded my iMac 27 "I can no longer use Time Machine to recover. Whenever I want to use it, I get a black screen and I can't chose the files I wish to recover. Backup itself does not turn. I reformatted the drive that I use for Time Machine

  • LJ Login cannot be used

    I just updated Firefox, and thanks to the shit, I can't use LJ Login. Is there a way to fix this? If this isn't the case, I'll downgrade.

  • SPEEDY33

    Hello world. I have a problem with mySpeedy33. Why can't hear my recorded voice back which I recordedThrough an external microphone (which is with a headset) that isconnected to the audio in port. However, I can listen to the recordedthe voice so I r

  • Audible alert options for SMS messages

    Why is it after all the releases of the webos you can't always choose different sounds for incoming SMS messages?  The sound of an incoming message is also identical to an incoming message.  I submitted an application for this feature with justificat

  • Zoo Tycoon 2 - cannot run

    My daughter has Zoo Tycoon 2 Ultimate Collection. It runs on a 32-bit computer Win 7 with 3 GB of RAM. It worked very well for a long time. After a few months of not playing, she inserted the CD and launched the program. The screen 'Run', 'Install',