Error while replacing IF statements with DECODE function in procedure

Hi All,
I have created a procedure which has nested IF statements. Now I want to replace the IF statements with DECODE functions to improve performance.
Procedure:
IF (var_int_sev = '0')
THEN
var_sev := '2';
ELSE
SELECT sev
INTO var_int_sev
FROM errorconfig
WHERE errorcode = var_errorcode;
var_sev := var_int_sev;
END IF;
I converted the above IF statement into DECODE function as mentioned below:
var_Sev := DECODE(var_int_sev,0,2,SELECT severity FROM errorconfig WHERE errorcode=var_ErrorCode)
But it throws below error at the select statement used inside DECODE.
Error(58,51): PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null others <an identifier> <a double-quoted delimited-identifier> <a bind variable> avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date <a string literal with character set specification> <a number> <a single-quoted SQL string> pipe <an alternatively-quoted string literal with character set specification> <an alternativ
Can someone help me in converting the IF to DECODE in the above case. Also how can we use a select statement inside decode.

instead of trying to rewrite all your code and hoping that the performance will be better, it's a better option to investigate and find out which part of your application is slow
read this:
When your query takes too long ...

Similar Messages

  • Case statement and Decode function both are not working in Select cursor.

    I have tried both the Case statement and Decode function in Select cursor, but both the things are not working. On the other hand both the things work in just select statement.
    See the first column in select (PAR_FLAG), I need to have this evaluated along with other fields. Can you please suggest some thing to make this work. And also I would like to
    know the reason why decode is not working, I heard some where Case statement do not work with 8i.
    Author : Amit Juneja
    Date : 06/20/2011
    Description:
    Updates the Diamond MEMBER_MASTER table with the values from
    INC.MEM_NJ_HN_MEMBER_XREF table.
    declare
    rec_cnt number(12) := 0;
    commit_cnt number(4) := 0;
    cursor select_cur is
    Select DECODE(1,
    (Select 1
    from hsd_prov_contract R
    where R.seq_prov_id = PM.seq_prov_id
    and R.line_of_business = H.line_of_business
    and R.PCP_FLAG = 'Y'
    and R.participation_flag = 'P'
    and SYSDATE between R.EFFECTIVE_DATE AND
    NVL(R.TERM_DATE,
    TO_DATE('31-DEC-9999', 'DD-MON-YYYY'))),
    'Y',
    'N') PAR_FLAG,
    H.SEQ_ELIG_HIST,
    H.SEQ_MEMB_ID,
    H.SEQ_SUBS_ID,
    H.SUBSCRIBER_ID,
    H.PERSON_NUMBER,
    H.EFFECTIVE_DATE,
    H.TERM_DATE,
    H.TERM_REASON,
    H.RELATIONSHIP_CODE,
    H.SEQ_GROUP_ID,
    H.PLAN_CODE,
    H.LINE_OF_BUSINESS,
    H.RIDER_CODE_1,
    H.RIDER_CODE_2,
    H.RIDER_CODE_3,
    H.RIDER_CODE_4,
    H.RIDER_CODE_5,
    H.RIDER_CODE_6,
    H.RIDER_CODE_7,
    H.RIDER_CODE_8,
    H.MEDICARE_STATUS_FLG,
    H.OTHER_STATUS_FLAG,
    H.HIRE_DATE,
    H.ELIG_STATUS,
    H.PREM_OVERRIDE_STEP,
    H.PREM_OVERRIDE_AMT,
    H.PREM_OVERRIDE_CODE,
    H.SEQ_PROV_ID,
    H.IPA_ID,
    H.PANEL_ID,
    H.SEQ_PROV_2_ID,
    H.SECURITY_CODE,
    H.INSERT_DATETIME,
    H.INSERT_USER,
    H.INSERT_PROCESS,
    H.UPDATE_DATETIME,
    H.UPDATE_USER,
    H.UPDATE_PROCESS,
    H.USER_DEFINED_1,
    H.SALARY,
    H.PEC_END_DATE,
    H.REASON_CODE,
    H.PEC_WAIVED,
    H.BILL_EFFECTIVE_FROM_DATE,
    H.BILLED_THRU_DATE,
    H.PAID_THRU_DATE,
    H.SUBSC_DEPT,
    H.SUBSC_LOCATION,
    H.USE_EFT_FLG,
    H.BENEFIT_START_DATE,
    H.SEQ_ENROLLMENT_RULE,
    H.MCARE_RISK_ACCRETION_DATE,
    H.MCARE_RISK_DELETION_DATE,
    H.MCARE_RISK_REFUSED_DATE,
    H.COMMENTS,
    H.USER_DEFINED_2,
    H.USER_DEFINED_3,
    H.RATE_TYPE,
    H.PCPAA_OCCURRED,
    H.PRIVACY_ON,
    H.PCP_CHANGE_REASON,
    H.SITE_CODE,
    H.SEQ_SITE_ADDRESS_ID,
    PM.seq_prov_id rendered_prov
    from hsd_member_elig_history H,
    INC.PCP_REASSIGN_RPRT_DATA P,
    hsd_prov_master PM
    where P.subscriber_id = H.subscriber_id
    and P.rendered_pcp = PM.provider_ID
    and H.elig_status = 'Y'
    and (H.term_date is NULL or H.term_date >= last_day(sysdate))
    order by H.Seq_memb_id;
    begin
    for C in select_cur loop
    rec_cnt := rec_cnt + 1;
    update hsd_member_elig_history
    set term_date = TRUNC(SYSDATE - 1),
    term_reason = 'PCPTR',
    update_datetime = SYSDATE,
    update_user = USER,
    update_process = 'TD33615'
    where seq_elig_hist = C.seq_elig_hist
    and seq_memb_id = C.seq_memb_id;
    INSERT INTO HSD_MEMBER_ELIG_HISTORY
    (SEQ_ELIG_HIST,
    SEQ_MEMB_ID,
    SEQ_SUBS_ID,
    SUBSCRIBER_ID,
    PERSON_NUMBER,
    EFFECTIVE_DATE,
    TERM_DATE,
    TERM_REASON,
    RELATIONSHIP_CODE,
    SEQ_GROUP_ID,
    PLAN_CODE,
    LINE_OF_BUSINESS,
    RIDER_CODE_1,
    RIDER_CODE_2,
    RIDER_CODE_3,
    RIDER_CODE_4,
    RIDER_CODE_5,
    RIDER_CODE_6,
    RIDER_CODE_7,
    RIDER_CODE_8,
    MEDICARE_STATUS_FLG,
    OTHER_STATUS_FLAG,
    HIRE_DATE,
    ELIG_STATUS,
    PREM_OVERRIDE_STEP,
    PREM_OVERRIDE_AMT,
    PREM_OVERRIDE_CODE,
    SEQ_PROV_ID,
    IPA_ID,
    PANEL_ID,
    SEQ_PROV_2_ID,
    SECURITY_CODE,
    INSERT_DATETIME,
    INSERT_USER,
    INSERT_PROCESS,
    UPDATE_DATETIME,
    UPDATE_USER,
    UPDATE_PROCESS,
    USER_DEFINED_1,
    SALARY,
    PEC_END_DATE,
    REASON_CODE,
    PEC_WAIVED,
    BILL_EFFECTIVE_FROM_DATE,
    BILLED_THRU_DATE,
    PAID_THRU_DATE,
    SUBSC_DEPT,
    SUBSC_LOCATION,
    USE_EFT_FLG,
    BENEFIT_START_DATE,
    SEQ_ENROLLMENT_RULE,
    MCARE_RISK_ACCRETION_DATE,
    MCARE_RISK_DELETION_DATE,
    MCARE_RISK_REFUSED_DATE,
    COMMENTS,
    USER_DEFINED_2,
    USER_DEFINED_3,
    RATE_TYPE,
    PCPAA_OCCURRED,
    PRIVACY_ON,
    PCP_CHANGE_REASON,
    SITE_CODE,
    SEQ_SITE_ADDRESS_ID)
    values
    (hsd_seq_elig_hist.nextval,
    C.SEQ_MEMB_ID,
    C.SEQ_SUBS_ID,
    C.SUBSCRIBER_ID,
    C.PERSON_NUMBER,
    trunc(SYSDATE),
    C.TERM_DATE,
    C.TERM_REASON,
    C.RELATIONSHIP_CODE,
    C.SEQ_GROUP_ID,
    C.PLAN_CODE,
    C.LINE_OF_BUSINESS,
    C.RIDER_CODE_1,
    C.RIDER_CODE_2,
    C.RIDER_CODE_3,
    C.RIDER_CODE_4,
    C.RIDER_CODE_5,
    C.RIDER_CODE_6,
    C.RIDER_CODE_7,
    C.RIDER_CODE_8,
    C.MEDICARE_STATUS_FLG,
    C.OTHER_STATUS_FLAG,
    C.HIRE_DATE,
    C.ELIG_STATUS,
    C.PREM_OVERRIDE_STEP,
    C.PREM_OVERRIDE_AMT,
    C.PREM_OVERRIDE_CODE,
    C.SEQ_PROV_ID,
    C.IPA_ID,
    C.PANEL_ID,
    C.SEQ_PROV_2_ID,
    C.SECURITY_CODE,
    SYSDATE,
    USER,
    'TD33615',
    SYSDATE,
    USER,
    'TD33615',
    C.USER_DEFINED_1,
    C.SALARY,
    C.PEC_END_DATE,
    C.REASON_CODE,
    C.PEC_WAIVED,
    C.BILL_EFFECTIVE_FROM_DATE,
    C.BILLED_THRU_DATE,
    C.PAID_THRU_DATE,
    C.SUBSC_DEPT,
    C.SUBSC_LOCATION,
    C.USE_EFT_FLG,
    C.BENEFIT_START_DATE,
    C.SEQ_ENROLLMENT_RULE,
    C.MCARE_RISK_ACCRETION_DATE,
    C.MCARE_RISK_DELETION_DATE,
    C.MCARE_RISK_REFUSED_DATE,
    C.COMMENTS,
    C.USER_DEFINED_2,
    C.USER_DEFINED_3,
    C.RATE_TYPE,
    C.PCPAA_OCCURRED,
    C.PRIVACY_ON,
    C.PCP_CHANGE_REASON,
    C.SITE_CODE,
    C.SEQ_SITE_ADDRESS_ID);
    commit_cnt := commit_cnt + 1;
    if (commit_cnt = 1000) then
    dbms_output.put_line('Committed updates for 1000 records.');
    commit;
    commit_cnt := 0;
    end if;
    end loop;
    commit;
    dbms_output.put_line('Total number of MEMBER_ELIG_HISTROY records inserted : ' ||
    rec_cnt);
    exception
    when others then
    raise_application_error(-20001,
    'An error was encountered - ' || sqlcode ||
    ' -error- ' || sqlerrm);
    end;

    user10305724 wrote:
    I have tried both the Case statement and Decode function in Select cursor, but both the things are not working. Please define what you mean by not working even if your computer screen is near the internet we can't see it.
    You should also look at the FAQ about how to ask a question
    SQL and PL/SQL FAQ
    Particularly *9) Formatting with {noformat}{noformat} Tags* and posting your version.
    know the reason why decode is not working, I heard some where Case statement do not work with 8i.
    Does this mean you are using 8i? Then scalar sub queries - selects within the select list, are not supported, along with CASE in PL/SQL.
    Select DECODE(1,
    * (Select 1
    from hsd_prov_contract R
    where R.seq_prov_id = PM.seq_prov_id
    and R.line_of_business = H.line_of_business
    and R.PCP_FLAG = 'Y'
    and R.participation_flag = 'P'
    and SYSDATE between R.EFFECTIVE_DATE AND
    NVL(R.TERM_DATE,
    TO_DATE('31-DEC-9999', 'DD-MON-YYYY')))*,
    'Y',
    'N') PAR_FLAG,
    >
    exception
    when others then
    raise_application_error(-20001,
    'An error was encountered - ' || sqlcode ||
    ' -error- ' || sqlerrm);
    http://tkyte.blogspot.com/2008/01/why-do-people-do-this.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • OWB3i - Validate with DECODE function

    Hi,
    in OWB 3i when I validate an expression defined inside an expression operator with DECODE() function (which is not include in default transformation) come this error:
    Line 1, Col 1:
    PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only
    but it seems only a warning because when i generate the scripts and run no other error happen and all works fine.
    Regards

    Hi,
    Welcome to the forum!
    When you use a default value, the last argument to DECODE is the actual value you want as a default.
    For example:
    SELECT       ename
    ,       deptno
    ,       DECODE ( deptno
                 , 30     , 'Sales'
                      , 'All others'     -- Default value
                  )                 AS dname
    FROM      scott.emp
    ORDER BY  ename
    ;Output:
    ENAME          DEPTNO DNAME
    ADAMS              20 All others
    ALLEN              30 Sales
    BLAKE              30 Sales
    CLARK              10 All others
    FORD               20 All others
    JAMES              30 Sales
    JONES              20 All others
    KING               10 All others
    MARTIN             30 Sales
    MILLER             10 All others
    SCOTT              20 All others
    SMITH              20 All others
    TURNER             30 Sales
    WARD               30 Sales 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    If you can show the problem using commonly available tables (such as those in the scott schema) then you don't need to post any sample data; just the results and the explanation.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Get error while invoking a page with "create"

    I get this error while invoking a page with "create". Also please any one tell me where is the log file is place to see the full story.
    ]] Root cause of ServletException.
    javax.el.PropertyNotFoundException: Target Unreachable, 'Comments' returned null
         at com.sun.el.parser.AstValue.getTarget(AstValue.java:88)
         at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:126)
         at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:230)
         at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.getReadOnly(EditableValueRenderer.java:400)
         at oracle.adfinternal.view.faces.renderkit.rich.FormElementRenderer.renderAsElement(FormElementRenderer.java:199)
         Truncated. see log file for complete stacktrace
    If i use a "create button then it does not throw error.
    Please help.

    When you are invoking your page, does your view object has an empty row where data can go and presist?
    Create a an empty row in your view object(vo.createRow()) , or use create operation from data control palette.
    You can set the log in Tools->Preferences-->Environment-->Log.
    Regards,
    Vikram

  • Error while generating remuneration statement

    Hi
    I found an error, while generating remuneration statement. The error is "Start date 01.01.1800 is higher than end date 00.00.0000".
    Kindly help
    Shadeesh

    Hi shadeesh,
    Please check the payroll control record's start date and end date in PA03
    regards,
    Ayyaps

  • Error While Installing IDES ECC6 with SQL Server 2005

    Dear Experts,
    I found an error while installing IDES ECC6 with SQL Server 2005. The error is raising at the stage of 17 of 24 processing the procedure of 195 of 197 (sap_z_set_permissions).
    I have tried several times by configuring different type of activites but still i am facing the same problem at the same stage. Please help me in thig regard.
    I herewith pasted hereunder log files information
    Regards,
    B.Sudharsan
    ERROR 2008-01-17 18:38:47
    FCO-00011  The step ExeProcs with step key |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_Postload|ind|ind|ind|ind|10|0|NW_Postload_MSS|ind|ind|ind|ind|2|0|MssProcs|ind|ind|ind|ind|1|0|ExeProcs was executed with status ERROR .
    INFO 2008-01-17 18:40:05
    An error occured and the user decide to stop.\n Current step "|NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_Postload|ind|ind|ind|ind|10|0|NW_Postload_MSS|ind|ind|ind|ind|2|0|MssProcs|ind|ind|ind|ind|1|0|ExeProcs".
    ERROR 2008-01-17 18:38:47
    MDB-05053  Errors when executing sql command: <p nr="0"/> If this message is displayed as a warning - it can be ignored. If this is an error - call your SAP support.

    Sudarshan,
    Occasionally, mid-way through the upgrade, DB permissions to users might change. Check to see, if the users SAP<SID>, OPS$ users have the DBA privilege. Re-assign the role and try continuing with the upgrade.

  • Error while Activating Activate Global Funds Management Functions (PSM-FM)

    Hi,
    I am getting the below error while activating Activate Global Funds Management Functions (PSM-FM) in Funds Management.
    Aktivierung des Haushaltsmanagements ist nicht erlaubt
    Message no. ZZ003
    Kindly help me in fix this issue....
    Thanks
    Kishore

    Hi,
    Thanks for your reply. But can you clarify me why we need to delete the row Z_LEAVE in SE11 for FMISPS table. Because here ABAPER is objecting to do this as they feel there may be some impact if we delete this.
    Kindly clarify me
    Thanks
    Kishore

  • Error while Registering the Database with Catalog..

    I m creating recovery catalog in same database, and getting the errors.
    1. I have created TOOLS tablespace
    2.CREATE USER RMAN2
    SQL> CREATE USER rman IDENTIFIED BY cat
    2 TEMPORARY TABLESPACE temp
    3 DEFAULT TABLESPACE tools
    4 QUOTA UNLIMITED ON tools;
    CREATE USER rman IDENTIFIED BY cat
    ERROR at line 1:
    ORA-01920: user name 'RMAN' conflicts with another user or role name
    SQL> ed
    Wrote file afiedt.buf
    1 CREATE USER rman2 IDENTIFIED BY cat
    2 TEMPORARY TABLESPACE temp
    3 DEFAULT TABLESPACE tools
    4* QUOTA UNLIMITED ON tools
    SQL> /
    User created.
    3. GRANT RECOVERY_CATALOG_OWNER
    SQL> GRANT RECOVERY_CATALOG_OWNER TO rman2;
    Grant succeeded.
    4. To create the recovery catalog:
    1. Connect to the database that will contain the catalog as the catalog owner.
    H:\>rman catalog rman2/cat@rock
    Recovery Manager: Release 10.2.0.1.0 - Production on Fri Sep 5 10:45:52 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to recovery catalog database
    2. Run the CREATE CATALOG command to create the catalog.
    RMAN> CREATE CATALOG;
    recovery catalog created
    3. Optionally, start SQL*Plus and query the recovery catalog to see which tables were created:
    H:\>sqlplus
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 5 11:53:36 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Enter user-name: rman2/cat
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select count(*) from cat;
    COUNT(*)
    91
    SQL> ed
    Wrote file afiedt.buf
    1 select owner, table_name, tablespace_name
    2 from dba_tables
    3* where table_name='DB'
    SQL> /
    OWNER TABLE_NAME
    TABLESPACE_NAME
    RMAN2 DB
    TOOLS
    RMAN DB
    ABAMCO_TEST
    Next step is to registering the Database in the Recovery Catalog.
    Registering a Database in the Recovery Catalog
    H:\>rman TARGET / CATALOG rman2/cat@rock
    Recovery Manager: Release 10.2.0.1.0 - Production on Fri Sep 5 11:56:09 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-04005: error from target database:
    ORA-01031: insufficient privileges
    I m getting above error while registering the Database with Catalog,
    Can anybody help me how can I register the Database with Catalog.????
    Waiting for Reply!!!!!!!

    Dear Manoj I can log in at TARGET Database.
    H:\>rman
    Recovery Manager: Release 10.2.0.1.0 - Production on Fri Sep 5 12:41:59 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    RMAN> connect target sys/rock
    connected to target database: ROCK (DBID=3255117147)
    RMAN>
    ============================================================
    USING CONNECT STRING as you said.
    H:\>rman target "sys/rock@rock as sysdba" catalog rman2/cat@rock
    Argument Value Description
    target quoted-string connect-string for target database
    catalog quoted-string connect-string for recovery catalog
    nocatalog none if specified, then no recovery catalog
    cmdfile quoted-string name of input command file
    log quoted-string name of output message log file
    trace quoted-string name of output debugging message log file
    append none if specified, log is opened in append mode
    debug optional-args activate debugging
    msgno none show RMAN-nnnn prefix for all messages
    send quoted-string send a command to the media manager
    pipe string building block for pipe names
    timeout integer number of seconds to wait for pipe input
    checksyntax none check the command file for syntax errors
    Both single and double quotes (' or ") are accepted for a quoted-string.
    Quotes are not required unless the string contains embedded white-space.
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00552: syntax error in command line arguments
    RMAN-01009: syntax error: found "as": expecting one of: "append, at, auxiliary, catalog, cmdfile, clone, checksyntax, debug, log, msglog, mask, msgno, nocatalog, pipe, rcvcat, script, slaxdebug, send, target, timeout, trace"
    RMAN-01007: at line 0 column 16 file: command line arguments
    H:\>rman
    It didnt work either.
    I have only one database rock, and created recovery catalog in it. I want to register rock database with recovery catalog.

  • HT2693 I am getting an 1015 error while updating Iphone 3G with latest iTunes pls help me to restore iPhone 3G

    I am getting an 1015 error while updating Iphone 3G with latest iTunes pls help me to restore iPhone 3G

    Try this and see if this helps http://support.apple.com/kb/TS3694#error1015

  • Getting Error while integrating Crystal reports with Java

    Hi All,
    I am getting below error while integrating crystal report with java
    [java] os.arch = x86
    [java] java.lang.NoSuchMethodError: com.crystaldecisions.Utilities.d.<init>
    (Ljava/awt/Image;I)V
    [java] at com.crystaldecisions.Utilities.af.try(Unknown Source)
    [java] at com.crystaldecisions.Utilities.af.a(Unknown Source)
    [java] at com.crystaldecisions.Utilities.af.<init>(Unknown Source)
    [java] at com.businessobjects.crystalreports.viewer.applet.g.a(Unknown
    Source)
    [java] at com.crystaldecisions.ReportViewer.ReportViewer.start(Unknown
    Source)
    [java] at ReportViewerFrame.<init>(ReportViewerFrame.java:51)
    [java] at JRCViewReport.launchApplication(JRCViewReport.java:29)
    [java] at JRCViewReport$1.run(JRCViewReport.java:50)
    [java] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:
    178)
    [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
    [java] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDi
    spatchThread.java:190)
    [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
    atchThread.java:144)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
    ava:138)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
    ava:130)
    [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
    Any help can be appreciated
    Kalyan

    Hi All,
    For got to mention i am using crystal reports XI release 2 with JDK1.4.
    Kalyan

  • Error  while gather schema stats

    Hi,
    I am getting the error while gather schema stats
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    Unable to correctly update the history table - fnd_stats_hist.
    -1 - ORA-00001: unique constraint (APPLSYS.FND_STATS_HIST_U1) violated
    -Sagar

    Ariz,
    The FND_STATS package provides procedures for gathering statistics for Oracle Applications database objects. It also provides procedures
    for storing the current statistics in a table (FND_STATTAB) and restoring them back. This package also facilitates the gathering of some statistics in parallel. This package calls the DBMS_STATS package.
    The FND_STATS package also has procedures to populate the FNDSTATS_HIST_* table to record the historical information of time taken for gathering the
    statistics for the different types of objects.
    Famy

  • Error while using DB Adapter in BPEL[Calling a procedure or function]

    Hi
    I am getting Error while executing the BPEL Process.
    1) I created a BPEL Process which uses a DB Adapter. I am using call a procedure or function. My Procedure is shown below. It takes a string a s input parameter and executes that string. I have used an assign activity to assign the input string.
    Procedure
    create or replace
    PROCEDURE SP_QUERY(s_string in varchar2)
    AS
    l_sql_stmt varchar2(1000);
    BEGIN
    l_sql_stmt := s_string;
    -- dbms_output.put_line( l_sql_stmt );
    EXECute immediate l_sql_stmt;
    commit;
    dbms_output.put_line('Executed' );
    -- if SQLCODE = 0 then
    --retCodeString := 'OK';
    --end if;
    END;
    I gave input string as "select * from tab", I have also tried a insert statement to a table in which its present in this database. But i am getting the following error.
    <3 Jun, 2013 9:42:25 AM IST> <Error> <oracle.webservices.service> <OWS-04115>
    Whats the Issue? Is the issue with the procedure or the BPEL process? Please help me out. I am stuck in this

    Hi,
    According to your message you have selected your procedure, but looks like the procedure is not having any reply or response parameter with it.
    Have you executed the procedure separately from SQL editor and see whether you are able to get the response or not ?
    If you get response, then how many columns are you getting ?
    Check the column names are matching with the schema file generated by adapter and see whether those column names are available as elements in .xsd file.
    Example provided below..
    In the below link, check the section "9.7 Stored Procedure and Function Support"
    http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_db.htm#CHDFBBCD
    Thanks,
    Vijay

  • Update Statement With Decode and Business Dates

    Hello everyone,
    I need to write a UPDATE statement using business date rule. In general, the due date is 30 days from the checkout date. If the due date falls on a Saturday or Sunday then the loan period is 32 days.
    I know that to test for a weekday, I'd need to use the to_char function in Oracle with the format of ‘D’. I did some research and found that to test which weekday November 12, 2007 falls on, I'd need to use the expression to_char(’12-NOV-2007’,’D’). This function returns a number between 1 and 7. 1 represents Sunday, 2 Monday, …,7 Saturday.
    What I really would need to do is write one UPDATE statement using an expression with the Decode function and the to_Char function:
    UPDATE book_trans SET due_dte = expression
    These are the transactions that will need to be updated:
    ISBN 0-07-225790-3 checked out on 15-NOV-2007 by employee 101(book_trans_id=1)
    ISBN 0-07-225790-3 checked out on 12-NOV-2007 by employee 151(book_trans_id=2)
    ISBN 0-201-69471-9 checked out on 14-NOV-2007 by employee 175(book_trans_id=3)
    ISBN 0-12-369379-9 checked out on 16-NOV-2007 by employee 201(book_trans_id=4)
    I manually calculated the due-dte and wrote update statement for each book_trans_id:
    UPDATE book_trans SET due_dte = '17-dec-07' WHERE book_trans_id = 1;
    UPDATE book_trans SET due_dte = '12-dec-07' WHERE book_trans_id = 2;
    UPDATE book_trans SET due_dte = '14-dec-07' WHERE book_trans_id = 3;
    UPDATE book_trans SET due_dte = '18-dec-07' WHERE book_trans_id = 4;
    As you can see, it's very cumbersome and I'd just like to know how to incorporate everything in one Update statement:
    UPDATE book_trans SET due_dte = expression
    so that if due date falls on Saturday or Sunday, the loan period is 32 days; weekday, loan period is 30 days.
    Any tips or help will be greatly appreciated. Thanks!

    Hi,
    882300 wrote:
    Hello everyone,
    I need to write a UPDATE statement using business date rule. In general, the due date is 30 days from the checkout date. If the due date falls on a Saturday or Sunday then the loan period is 32 days. That's equivalent to saying that the due date is normally 30 days after the checkout date, but if the checkout date falls on a Thursday or Friday, then the due date is 32 days after the checkout date. I used this equivalent in the statement below.
    I know that to test for a weekday, I'd need to use the to_char function in Oracle with the format of ‘D’. I did some research and found that to test which weekday November 12, 2007 falls on, I'd need to use the expression to_char(’12-NOV-2007’,’D’). This function returns a number between 1 and 7. 1 represents Sunday, 2 Monday, …,7 Saturday.That's just one way to find out the weekday, and it's error-prone because it depends on your NLS_TERRITORY setting. A more reliable way is to use 'DY' or 'DAY' as the 2nd argument to TO_CHAR. That depends on NLS_DATE_LANGUAGE, but you can explicitly set the language in the optional 3rd argument to TO_CHAR, which means your code will work the same no matter what the NLS settings happen to be. It's also easier to debug: you may have to think whether '1' means Sunday or Monday, but it's easy to remember that 'SUN' means Sunday.
    What I really would need to do is write one UPDATE statement using an expression with the Decode function and the to_Char function:
    UPDATE book_trans SET due_dte = expressionHere's one way:
    UPDATE  book_trans
    SET     due_dte = checkout_dte + CASE
                                      WHEN  TO_CHAR ( checkout_dte
                                             , 'fmDAY'
                                     , 'NLS_DATE_LANGUAGE=ENGLISH'
                                     ) IN ('THURSDAY', 'FRIDAY')
                             THEN  32
                             ELSE  30
                                  END
    WHERE   book_trans_id      IN (1, 2, 3, 4)
    ;This assumes that checkout date is a column in the same table.

  • Error while schedulingg update stat in db13

    Dear Experts,
    Please look into my issue we are facing an error while scheduling update statistics in db13 and I tried to open detailed log
    It is given
    SXPG_COMMAND_EXECUTE failed for BRTOOLS - Reason: program_start_error: For More Information, See SYS
    Please help me how to solve this my error
    Regards

    Hi,
    Check the owner for BRBACKUP, BRARCHIVE, and BRCONNECT in kernel,
    these files should be with SIDADM, if not change the owner to SIDADM and rerun the update stats.
    and also Refer the note 446172
    Regards,
    Ram

  • Problem with decode function.

    Hi,
    Can anyone of you help me out in solving this?
    It is like i wish to give different select statements according to the value of a parameter entered by user USING DECODE FUNCTION.The select statement contains some other select statements inside it.So when i execute it,it is giving error like 'ORA-00913-too many values(even when i enclose select statements within brackets).

    ORA-00913 too many values
    Cause: The SQL statement requires two sets of values equal in number. This error occurs when the second set contains more items than the first set. For example, the subquery in a WHERE or HAVING clause may return too many columns, or a VALUES or SELECT clause may return more columns than are listed in the INSERT.
    Action: Check the number of items in each set and change the SQL statement to make them equal.
    the above is from oracle documentation. the brackets is not the problem, u must be using multiple items in the integrated decode queries. If the problem still exists post ur DML for further analysis.
    zaibi.

Maybe you are looking for

  • "The scratch disks are write protected or unavailable" on NEW project on PrE

    I am running PrE 10 on Windows 7 64 bit.  My computer has two internal hard drives (C and E).  I want to put my projects and all scratch disks on E, the non-OS drive.  When I try to create a NEW project and designate a directory I have already create

  • Flash 6 legacy use of _root

    I use Flash about twice a year, so I really only have half a clue... I have an old Flash 6 app that I want to reuse as part of a new project. It uses _root extensively. Soooo I toldya I only have half a clue :-( Anyway, I am trying to load it into a

  • Animate in Mocha AE doesnt support scandinavian letters

    Hello there Seems like theres an issue with linking to Mocha AE. After i select a file, go to animate->track in mocha, it says file not found. The dialog box shows the file name, with scandinavian letters - ä and ö - replaced with for example, ÂÅQ. S

  • Error Message: Please Contact iTunes Support to complete this transaction.

    I am trying to buy Fanta Points in a game called Fantasica, however, when I try to make a purchase, after I am prompted to give my Apple ID and password, it gives the message, "Please contact iTunes Support to complete this transaction." I don't unde

  • WAP321 Guest SSID

    I want to create one more SSID (for guest use) in WAP321 AP. Is it possible to perform such setup with non-cisco switch and firewall. Please advise. Thanks !