Stupid PLW-07202 warning

Hi,
I get a stupid bunch of warning when compiling this under 11.1.0.7:
create table test ( t varchar2(50) );
create or replace procedure test_warn as
    BEGIN
        INSERT INTO test (t)
             SELECT  substr('blah', 1, 2)
                       FROM dual;
  END;
SP2-0804: Procedure created with compilation warnings
show errors
Errors for PROCEDURE TEST_WARN:
LINE/COL ERROR
6/37     PLW-07202: bind type would result in conversion away from column type
6/40     PLW-07202: bind type would result in conversion away from column typeThe locations point to the "1" and "2" parameters in substr(). WTF???
Thanks,
Chris

What is the database trying to warn me from precisely?Looks like Bug 5983734: SPURIOUS PLW-07202, which still holds in 11gR2:
SQL> select * from v$version where rownum = 1
BANNER                                                                         
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production         
1 row selected.
SQL> alter session set plsql_warnings='enable:all'
Session altered.
SQL> create table t (a varchar2(40))
Table created.
SQL> alter system flush shared_pool
System altered.
SQL> create or replace procedure p as
begin
insert into t values (substr('abc',1,2));
end;
Procedure created.
SQL> show err
Errors for PROCEDURE P
LINE/COL ERROR                                                           
3/37     PLW-07202: bind type would result in conversion away from column
         type                                                            
3/39     PLW-07202: bind type would result in conversion away from column
         type                                                            
1/1      PLW-05018: unit P omitted optional AUTHID clause; default value D
         EFINER used                                                     
SQL> exec p
PL/SQL procedure successfully completed.
SQL> select  sql_text from v$sql
where   lower(sql_text) not like '%v$sql$'
and     lower(sql_text) like 'insert into t values%'
SQL_TEXT                                                                       
INSERT INTO T VALUES (SUBSTR('abc',1,2))                                       
1 row selected.
/* no binding takes place at all, so a message about binding seems non-sensical. */
SQL> alter system flush shared_pool
System altered.
SQL> create or replace procedure p as
s varchar2(3) := 'abc';
s1 int := 1;
s2 int := 1;
begin
insert into t values (substr(s, s1, s2));
end;
Procedure created.
SQL> show err
Errors for PROCEDURE P
LINE/COL ERROR                                                           
6/34     PLW-07202: bind type would result in conversion away from column
         type                                                            
6/38     PLW-07202: bind type would result in conversion away from column
         type                                                            
1/1      PLW-05018: unit P omitted optional AUTHID clause; default value D
         EFINER used                                                     
SQL> exec p
PL/SQL procedure successfully completed.
SQL> select  sql_text from v$sql
where   lower(sql_text) not like '%v$sql$'
and     lower(sql_text) like 'insert into t values%'
SQL_TEXT                                                                       
INSERT INTO T VALUES (SUBSTR(:B3 , :B2 , :B1 ))                                
1 row selected.
But (1) the datatypes of the PL/SQL variables that are bound are exactly
right for Substr(). And (2), the binding occurs in an expression that's that
right-hand-side for "set <column> =" so there's possibility of an index
being in use.
*/

Similar Messages

  • Avoiding PLW-07202 warning in SQL Developer

    Hi All,
    I am using EM Console to create package, now I have switched over to SQL Developer. When I was using EM Console, It was not showing any warning, but that same package when compiled in SQL Developer It show following warning:
    PLW-07202: bind type would result in conversion away from column type
    I want to avoid this warning to occur everytime when I compile.
    How do I do it?
    Help...

    or issue an alter session/alter system yourself or :
    http://www.oracle-base.com/articles/10g/PlsqlEnhancements10g.php#compile_time_warnings
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/errors.htm#sthref2096
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams166.htm#REFRN10249

  • PLW-07202: bind type would result in conversion away from column type

    Got this error, "PLW-07202: bind type would result in conversion away from column type", when compiling in the stored procedure editor.
    CREATE OR REPLACE
    procedure test_proc (at_incoming varchar)
    as begin
    insert into test2(itemname) values (substr('1234',1,2));
    end;
    The table test2 was created like this:
    CREATE TABLE "DMSCO"."TEST2"
    (     "ITEMNAME" VARCHAR2(30),
         "ITEM2" VARCHAR2(10),
         "ITEMNUM" NUMBER(10,0)
    Removed the substr, and it compiles.
    CREATE OR REPLACE
    procedure test_proc (at_incoming varchar)
    as begin
    insert into test2(itemname) values ('1234');
    end;
    In sqlplus it compiles fine even with the substr.

    PLW-07202: is a warning. There's a bug that it's showing as an error.
    -kris

  • PLW 07204 and PLW 07202 ?

    CREATE OR REPLACE PROCEDURE library_portal_home(ldt portal_home_non_login_log.logdatetime%TYPE, COT portal_home_non_login_log.counter%TYPE) IS
    lv_count NUMBER;
    BEGIN
    SELECT COUNT(1)
    INTO lv_count
    FROM portal_home_non_login_log
    WHERE to_char(logdatetime, 'dd-mm-yyyy ') = to_char(sysdate, 'dd-mm-yyyy ');
    IF lv_count > 0 THEN
    UPDATE portal_home_non_login_log
    SET counter = counter + 1
    WHERE to_char(logdatetime, 'dd-mm-yyyy ') = to_char(sysdate, 'dd-mm-yyyy ');
    ELSE
    INSERT
    INTO portal_home_non_login_log(logdatetime, counter)
    VALUES(sysdate, 1);
    DBMS_OUTPUT.PUT_LINE('ONE RECORD IS ADDED......!');
    END IF;
    COMMIT;
    END;
    I got 2 warning when i compile for debug.
    Warning PLW 07204
    Warning PLW 07202
    Would this 2 warning affect the procedure and how do I solve it?

    create or replace PROCEDURE in_focus_page(ldt infocus_log.logdatetime%TYPE, COT infocus_log.counter%TYPE) IS
    lv_count NUMBER;
    BEGIN
    SELECT COUNT(1)
    INTO lv_count
    FROM infocus_log
    WHERE TRUNC(logdatetime) = TRUNC(sysdate);
    IF lv_count > 0 THEN
    UPDATE infocus_log
    SET counter = counter + 1
    WHERE TRUNC(logdatetime) = TRUNC(sysdate);
    ELSE
    INSERT
    INTO infocus_log(logdatetime, counter)
    VALUES(sysdate, 1);
    DBMS_OUTPUT.PUT_LINE('ONE RECORD IS ADDED......!');
    END IF;
    COMMIT;
    END;
    I still have same 2 warning. First one is PLW 07204 and other one is PLW 07202. (bold)
    Thanks in Advance

  • PLW-07204 Warning

    We are using SQLDeveloper and almost every stored procedure I compile I get this warning. If I had it my way, I would not use SQLDeveloper but due to budget restrictions this is all I have.
    Here is the piece of code I am getting this warning on.
    select count(*)
    into dup_cnt
    FROM trans
    WHERE trans.ID_SSN = SSN_NUM
    AND trans_cd = 'DU'
    and trans_date between '01-NOV-'||to_char(to_number(to_char(sysdate,'YYYY')-1)) and trunc(sysdate);
    Thank you for taking time to look at this.
    Sandeep.

    I don't get any errors compiling it (in SQL*Plus or
    SQLDeveloper) these are only warnings, but would like
    not to get any warnings.did you get any warning message when you tried to recompile it in SQL*Plus?
    i think it might have been because your start range is ahead of end range. if your 01-NOV is always fixed you need to define some mechanism that would allow your code to use the current year or prior year if the current month is not yet in november or ahead of november which is in december.
      decode(to_char(sysdate,'MON'),'NOV', to_date('01-NOV-'||to_char(sysdate,'YYYY'),'DD-MON-YYYY'),
                                    'DEC','to_date('01-NOV-'||to_char(sysdate,'YYYY'),'DD-MON-YYYY'),
                                    to_date('01-NOV-'||to_char(to_number(to_char(sysdate,'YYYY'))-1),'DD-MON-YYYY'))

  • PLW warning?

    The warning is highlighted at the bold:
    create or replace procedure portal_pro IS lv_count number;
    BEGIN
      SELECT COUNT(*)
      INTO lv_count
      FROM portal_log
      WHERE TRUNC(logtime) = TRUNC(sysdate);
      IF lv_count > 0 THEN
        UPDATE portal_log
        SET counter = counter + 1
    WHERE TRUNC(logtime) = TRUNC(sysdate);
      ELSE
        INSERT
        INTO portal_log(logtime,   counter)
        VALUES(sysdate,   1);
      END IF;
    END
    portal_log
    ===========
    logtime       DATE
    counter       NUMBERI got two warnings for this procedure (above). I need help in solving this 2 warning (below) .
    PLW 07204
    PLW 07202
    Can anyone help me on this issue?

    Can you expalin..?
    SQL> create table portal_log(logtime date,counter number);
    Table created.
    SQL> create or replace procedure portal_pro IS
      2   lv_count number;
      3   BEGIN
      4    SELECT COUNT(*)
      5    INTO lv_count
      6    FROM portal_log
      7    WHERE TRUNC(logtime) = TRUNC(sysdate);
      8    IF lv_count > 0 THEN
      9      UPDATE portal_log
    10      SET counter = counter + 1
    11      WHERE TRUNC(logtime) = TRUNC(sysdate);
    12    ELSE
    13     INSERT INTO portal_log(logtime,counter)
    14     VALUES(sysdate,   1);
    15    END IF;
    16   END;
    17  /
    Procedure created.Message was edited by:
    jeneesh
    I think you can use merge..
    SQL>  merge into portal_log p
      2   using (select sysdate dt from dual) s
      3   on (TRUNC(p.logtime) =trunc(s.dt))
      4   when matched then
      5     UPDATE SET counter = counter + 1
      6   when not matched then
      7      INSERT (logtime,counter)
      8     VALUES(sysdate,   1)
      9  /
    1 row merged.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How do I get rid of this sql warning?

    Hi folks,
    I am running oracle 10.2.0 on Linux. I would like to get rid of this sql code warning
    (Warning(151,3): PLW-07202: bind type would result in conversion away from column type)I get when I compile the code below. Basically Oracle does not like the idea of using a number in an expression with sysdate. eg (sampling_date < sysdate - p_n_value) where p_n_value is a number;
    What is the best way to do this?
    CREATE TABLE "USERDATA"."TBL_SESSION_SQL_WAIT_HISTORY"
       (           "SESSION_SQL_WAIT_HIST_SEQ_ID" NUMBER,
                    "DBID" NUMBER,
                    "SID" NUMBER,
                    "SEQ#" NUMBER,
                    "EVENT" VARCHAR2(64 BYTE),
                    "P1TEXT" VARCHAR2(64 BYTE),
                    "P1" NUMBER,
                    "P1RAW" RAW(8),
                    "P2TEXT" VARCHAR2(64 BYTE),
                    "P2" NUMBER,
                    "P2RAW" RAW(8),
                    "P3TEXT" VARCHAR2(64 BYTE),
                    "P3" NUMBER,
                    "P3RAW" RAW(8),
                    "WAIT_TIME" NUMBER,
                    "SECONDS_IN_WAIT" NUMBER,
                    "STATE" VARCHAR2(19 BYTE),
                    "SAMPLING_DATE" DATE,
                    "SAMPLING_TIME" VARCHAR2(8 BYTE),
                    "SERIAL#" NUMBER,
                    "USERNAME" VARCHAR2(30 BYTE),
                    "OSUSER" VARCHAR2(30 BYTE),
                    "PADDR" RAW(4),
                    "LOGON_TIME" DATE,
                    "PROCESS" VARCHAR2(24 BYTE),
                    "SQL_HASH_VALUE" NUMBER,
                    "SADDR" RAW(4),
                    "MODULE" VARCHAR2(48 BYTE),
                    "ROW_WAIT_OBJ#" NUMBER,
                    "ROW_WAIT_FILE#" NUMBER,
                    "ROW_WAIT_BLOCK#" NUMBER,
                    "ROW_WAIT_ROW#" NUMBER
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 16384 NEXT 65536 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERDATA" ;
      CREATE TABLE "USERDATA"."TBL_SQLTEXT_WAIT_HISTORY"
       (           "SQLTEXT_SEQ_ID" NUMBER,
                    "DBID" NUMBER,
                    "ADDRESS" RAW(4),
                    "HASH_VALUE" NUMBER,
                    "SQL_ID" VARCHAR2(13 BYTE),
                    "COMMAND_TYPE" NUMBER,
                    "PIECE" NUMBER,
                    "SQL_TEXT_PIECE" VARCHAR2(64 BYTE),
                    "SQL_TEXT" VARCHAR2(1000 BYTE),
                    "DISK_READS" NUMBER,
                    "BUFFER_GETS" NUMBER,
                    "DIRECT_WRITES" NUMBER,
                    "PARSE_CALLS" NUMBER
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 16384 NEXT 65536 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERDATA" ;
    create or replace
    PROCEDURE data_coll AS
    p_n_value userdata.tbl_options.n_value%type;  -- number
    BEGIN
    -- irrelevant code here
      select n_value into p_n_value from tbl_options where name ='PURGE_DAY_COUNT';
      DELETE FROM tbl_sqltext_wait_history t where t.hash_value in
        (select s.sql_hash_value from cc_session_sql_wait_history s
        where s.sampling_date < sysdate  - p_n_value
        and s.sql_hash_value = t.hash_value);
      DELETE FROM tbl_session_sql_wait_history
      WHERE sampling_date < sysdate - p_n_value;
    END;Thanks in advance for your feedback.
    rgds, Efachim
    Edited by: efachim on Jan 19, 2009 10:44 AM

    One general suggestion.
    "TBL_SESSION_SQL_WAIT_HISTORY"Did you create your table and column names within double quotes?
    It will make your table as case sensitive.
    Regards.
    Satyaki De.

  • Warning message in 10g related to timestamp

    select * from v$version;
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    create table jtime(jtime timestamp with time zone);
    create or replace procedure jtimePro as
    begin
    insert into jtime values(systimestamp);
    end jtimePro;
    Assuming I compile it via SQL Developer I get a message of
    Warning(3,28): PLW-07202: bind type would result in conversion away from column type
    I did check the return type on systimestamp it is a timestamp with time zone.
    I also different column type of just timestamp with the same warning message. Any ideas how to use a timestamp or timestamp with time zone datatype and not get a warning message?
    Also how do I see the warning messages in sql+ there is no 'show warnings'
    Thanks

    SQL> alter session set PLSQL_WARNINGS = 'enable:ALL' ;
    Session altered.
    SQL> create table jtime(jtime timestamp with time zone);
    Table created.
    SQL> create or replace procedure jtimePro as
      2  begin
      3  insert into jtime values(systimestamp);
      4  end jtimePro;
      5  /
    SP2-0804: Procedure created with compilation warnings
    SQL> show errors
    Errors for PROCEDURE JTIMEPRO:
    LINE/COL ERROR
    3/26     PLW-07202: bind type would result in conversion away from column
             type
    SQL> create or replace procedure jtimePro as
      2      dt_tz timestamp with time zone ;
      3  begin
      4      dt_tz := systimestamp ;
      5  insert into jtime values(dt_tz);
      6  end jtimePro;
      7  /
    Procedure created.
    SQL> show errors
    No errors.
    SQL>

  • TIMESTAMP formatting!!!

    Hi All,
    My Query is...
    I have a table COGNOS_UH with columns which holds history transaction updates
    Business_date Date;
    Actual_trans number(8);
    Update_trans number(8);
    UH_STIME timestamp(6);
    UH_FTIME timestamp(6);
    UH_DURATION Varchar2(30);
    if i try to update UH_DURATION column with diff of start_time & finish_time in this format HH : MIN: SS in a procedure using sql statement shown below...it works fine but i get WARNING message as:
    Warning(164,42): PLW-07202: bind type would result in conversion away from column type
    UPDATE COGNOS_UH SET UH_DURATION= EXTRACT (HOUR from(UH_FTIME - UH_STIME))||' : '||EXTRACT (MINUTE from(UH_FTIME - UH_STIME))||' : '||EXTRACT (SECOND from(UH_FTIME - UH_STIME));
    Could you please suggest how can i resolve this issue/is there any better way to compute the same???

    This looks like a bug to me. It seems impossible to get the right conversion take place. Whatever you try you get PLW-07202:
    michaels>  alter session set plsql_warnings='ENABLE:ALL'
    Session altered.
    michaels>  create or replace procedure p
    as
       myhiredate   emp.hiredate%type;
    begin
       update emp set job = to_char (myhiredate);
    end;
    Procedure created.
    michaels>  show error
    Errors for PROCEDURE P
    LINE/COL ERROR                                                           
    5/34     PLW-07202: bind type would result in conversion away from column
             type 
    michaels>  select * from v$version
    BANNER                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production                         
    CORE     10.2.0.3.0     Production                                     
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production        
    NLSRTL Version 10.2.0.3.0 - Production Only workaround that comes to my mind is to make the statement dynamic, but of course I wouldn't do that just because of a compiler warning.

  • Eliminate warings

    hi  i am working with SQL developer Tool,
    here i am some warings in my procedure.. but not errors.
    here my PM wants to eliminate those warings..
    how to do this issue..
    like below..
    Package body [email protected]...
    Warings(167,21): PLW-07204: conversion from column may result in sub-optimal plan
    Waring(1856,23): PLW-07202 bind type would result in conversion away column type

    The problem might be, that you cannot eliminate the warnings.
    E.g. if you have a package with many functions, each has an exception section where the error is logged and reraised without a RETURN. You won't see usefull warnings (Warning(1,1): Only first 20 issues are reported) for all those
    Warning(675,1): PLW-05005: function GETZAW returns without value at line 737Or if I get tons of
    Warning(1899,60): PLW-07204: conversion away from column type may result in sub-optimal query planin Selects like
    WHERE col1 = NVL(col2,col1)Or if you can't fix it because
    Warning(2134,17): PLW-06002: Unreachable codeshows a line that is reached regularily.
    I think compiler warnings are a good invention but they can be improved.
    Regards
    Marcus

  • Raptor (07.15)  almost had compilation  warnings

    The version 07.15 of the Raptor had a feature that would be useful: PL/SQL
    compilation warnings. However it had two problems: 1: the warnings were
    actually
    errors, which alone made the tool unusable, 2: some messages were generated
    without any cause.
    This can be seen in the following:
    INSERT INTO priceloki(t) VALUES (loki_seq.NEXTVAL,
    'Virhe : ' || module || '
    hi_hinnoittelu_pac.hae_hinnastovoimassa_pvm Sqlerr: ' || err_num || ' Errmsg: '
    || err_msg
    Error(68,107): PLW-07202: bind type would result in
    conversion away from column type
    It seems that using expression in assigning to t confuses the compiler, since
    simple variable assignments work correctly.
    In the version 07.96 all traces of the "modern" warning feature are away,
    probably because of field feedback.

    yep. I have warnings in user_errors after compilation.
    It would be better to catch warnings somewhere (into separate output window?) or let user specify compilation level settings...
    select * from user_errors;
    NAME TYPE SEQUENCE LINE POSITION TEXT ATTRIBUTE MESSAGE_NUMBER
    ILOAD_PREPARE_FINISH_CM_PRO PROCEDURE 1 3 5 PLW-07203: parametr 'P_RET_CODE_VC' m&#367;že využívat nápov&#283;du kompilátoru NOCOPY WARNING 7203
    ILOAD_PREPARE_FINISH_CM_PRO PROCEDURE 2 4 5 PLW-07203: parametr 'P_RET_TEXT_VC' m&#367;že využívat nápov&#283;du kompilátoru NOCOPY WARNING 7203

  • I had no hard drive space on my computer when I synced- Lost alot of info

    While syncing my Iphone 4 a while back, I stupidly ignored a warning that said that I did not have enough hard drive space on my computer. It said that some of my info will be lost. So I did it anyway. When it was completed about the only thing that made the sync was my contacts. Everything else was gone, apps, music, photos. I manually installed music & photos but my text messages did not come back. Someone told me to back it up from an earlier backup which I did find in my Itunes folder but I have been kinda timid about doing it. Should I rename this back up (or Iphone) Or what the **** do I do to get back my older text messages that go all the way back to my first Iphone from June 2007?? Help..

    Welcome to the discussions!
    463GB sounds about right for "backup" space on the 500GB TC disk. Time Capsule usually "reserves" about 8-10% for system operations, etc. On a 1TB disk, the usable space on my Time Capsule is about 928GB.
    If the Time Machine is not backing up to the TC, try resetting as follows:
    Open System Preferences and click on Time Capsule. You will need to select the disk that you want to use and click Use for Backups. This should get things going again.
    If no luck, then go Hard Drive > Library > Preferences and delete the com.apple.timemachine.plist file and start the process above again.

  • Error in stored procedure

    When i executed the below query I got no error and o/p is inserted into RECON_RESULTS table
    INSERT into RECON_RESULTS(contract,plan_code,issue_date,product_type,status,"mode",bill_to_date)
    SELECT TBL_SRC.CONTRACT,
    CASE WHEN ((TBL_SRC.PLAN_CODE IS NOT NULL) AND (TBL_TRGT.PLAN_CODE IS NULL))
    THEN 3
    WHEN NVL(TBL_SRC.PLAN_CODE,0) != NVL(TBL_TRGT.PLAN_CODE,0)
    THEN 0
    WHEN NVL(TBL_SRC.PLAN_CODE,0) = NVL(TBL_TRGT.PLAN_CODE,0)
    THEN 1
    END PLAN_CODE,
    CASE WHEN TBL_SRC.ISSUE_DATE =TBL_TRGT.ISSUE_DATE
    THEN 1
    ELSE 0
    END ISSUE_DATE,
    TBL_SRC.product_type,
    TBL_SRC.STATUS,
    NVL(TBL_SRC."MODE",3) AS "MODE" ,
    CASE WHEN ((TBL_SRC.BILL_TO_DATE IS NOT NULL) AND (TBL_TRGT.BILL_TO_DATE IS NULL))
    THEN 3
    WHEN NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'dd/mm/yyyy'),0) != NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'dd/mm/yyyy'),0)
    THEN 0
    WHEN NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'dd/mm/yyyy'),0) = NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'dd/mm/yyyy'),0)
    THEN 1
    END BILLDATE
    FROM TBL_SRC LEFT JOIN TBL_TRGT ON TBL_SRC.CONTRACT = TBL_TRGT.CONTRACT;
    But when I placed the above query in Procedure it is throwing error
    create or replace
    PROCEDURE PROCEDURE2 AS
    AA TBL_SRC.CONTRACT%TYPE;
    BB RECON_RESULTS.PLAN_CODE%TYPE;
    CC RECON_RESULTS.ISSUE_DATE%TYPE;
    DD RECON_RESULTS.PRODUCT_TYPE%TYPE;
    EE RECON_RESULTS.STATUS%TYPE;
    FF RECON_RESULTS."MODE"%TYPE;
    GG RECON_RESULTS.BILL_TO_DATE%TYPE;
    BEGIN
    SELECT TBL_SRC.CONTRACT,
    CASE WHEN ((TBL_SRC.PLAN_CODE IS NOT NULL) AND (TBL_TRGT.PLAN_CODE IS NULL))
    THEN 2
    WHEN NVL(TBL_SRC.PLAN_CODE,0) != NVL(TBL_TRGT.PLAN_CODE,0)
    THEN 0
    WHEN NVL(TBL_SRC.PLAN_CODE,0) = NVL(TBL_TRGT.PLAN_CODE,0)
    THEN 1
    END ,
    TBL_SRC.product_type,
    TBL_SRC.STATUS,
    NVL(TBL_SRC."MODE",3),
    CASE WHEN ((TBL_SRC.BILL_TO_DATE IS NOT NULL) AND (TBL_TRGT.BILL_TO_DATE IS NULL))
    THEN 2
    WHEN NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'DD-MON-YYYY'),0) != NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'DD-MON-YYYY'),0)
    THEN 0
    WHEN NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'DD-MON-YYYY'),0) = NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'DD-MON-YYYY'),0)
    THEN 1
    END,
    CASE WHEN ((TBL_SRC.ISSUE_DATE IS NOT NULL) AND (TBL_TRGT.ISSUE_DATE IS NULL))
    THEN 2
    WHEN NVL(TO_CHAR(TBL_SRC.ISSUE_DATE,'DD-MON-YYYY'),0) != NVL(TO_CHAR(TBL_SRC.ISSUE_DATE,'DD-MON-YYYY'),0)
    THEN 0
    WHEN NVL(TO_CHAR(TBL_SRC.ISSUE_DATE,'DD-MON-YYYY'),0) = NVL(TO_CHAR(TBL_SRC.ISSUE_DATE,'DD-MON-YYYY'),0)
    THEN 1
    END
    INTO AA,BB,DD,EE,FF,GG,CC
    FROM TBL_SRC LEFT JOIN TBL_TRGT ON TBL_SRC.CONTRACT = TBL_TRGT.CONTRACT;
    END PROCEDURE2;
    Error Message:
    Error(13,2): PL/SQL: SQL Statement ignored
    Error(24,5): PL/SQL: ORA-00932: inconsistent datatypes: expected DATE got NUMBER

    I have changed the datatype of issue_date and bill_to_date to number and used insert into tablename ...select but my SP is throwing
    warining (8,2): PLW-07202: bind type would result in conversion away from col
    so I have diabled the warnings
    ALTER SYSTEM SET PLSQL_WARNINGS = 'DISABLE:ALL';
    Now my SP complied successfully.
    Then I tried running the SP
    EXECUTE PROCEDURE2;
    It is throwing the error ORA-00900-"Invalid SQL Statement".
    My complied SP
    create or replace
    PROCEDURE PROCEDURE2 AS
    BEGIN
    INSERT into RECON_RESULTS(contract,plan_code,issue_date,product_type,status,bill_form,bill_to_date)
    SELECT TBL_SRC.CONTRACT,
    CASE WHEN ((TBL_SRC.PLAN_CODE IS NOT NULL) AND (TBL_TRGT.PLAN_CODE IS NULL))
    THEN 3
    WHEN NVL(TBL_SRC.PLAN_CODE,0) != NVL(TBL_TRGT.PLAN_CODE,0)
    THEN 0
    WHEN NVL(TBL_SRC.PLAN_CODE,0) = NVL(TBL_TRGT.PLAN_CODE,0)
    THEN 1
    END PLAN_CODE,
    CASE WHEN TBL_SRC.ISSUE_DATE =TBL_TRGT.ISSUE_DATE
    THEN 1
    ELSE 0
    END ISSUE_DATE,
    TBL_SRC.product_type,
    TBL_SRC.STATUS,
    NVL(TBL_SRC."MODE",3) AS "MODE" ,
    CASE WHEN ((TBL_SRC.BILL_TO_DATE IS NOT NULL) AND (TBL_TRGT.BILL_TO_DATE IS NULL))
    THEN 3
    WHEN NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'DD-MON-YYYY'),0) != NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'DD-MON-YYYY'),0)
    THEN 0
    WHEN NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'DD-MON-YYYY'),0) = NVL(TO_CHAR(TBL_SRC.BILL_TO_DATE,'DD-MON-YYYY'),0)
    THEN 1
    END BILLDATE
    FROM TBL_SRC LEFT JOIN TBL_TRGT ON TBL_SRC.CONTRACT = TBL_TRGT.CONTRACT;
    END PROCEDURE2;

  • Compiling Packages, Functions, and Procedures Issues

    If you are in the editor for a package and attempt to compile a know good package under another schema (compiled in SQL+ and Toad), you receive the following errors:
    Error(21,5): PLW-06002: Unreachable code
    Error(131,7): PLW-07202: bind type would result in conversion away from column type
    (122) TN_EXISTS NUMBER := 0;
    (131) IF TN_EXISTS > 0 THEN ...
    When commenting a line with if you have something like the following it tells you there is a syntax error
    -- some comment here --
    When compiling a PL/SQL function that returns a Boolean, you get this error: Error(40,4): PLW-06002: Unreachable code

    Kris,
    I seem to have the same problem.
    Is there a way to 'deactivate' this behaviour, or do we need to wait for another Raport Release.
    This is basically preventing me from using Raptor at all for any PL/SQL development ;-(
    Wouter

  • New features present in oracle 11gr2.

    Hi all,
    I would like to know the new features present in oracle 11gR2. Any pointers would be helpful.
    Example: list aggregate features is not there in 11gR1... etc.
    Thanks and Regards
    Nagaraja Akkivalli.

    SQL New Features:
    Performance improvements
    1.Alter table to add columns with default value.
    2.Invisible Indexes
    3.Redefinition improvements
    4.SQL Result cache
    New Language features
    1.New data types: SIMPLE_INTEGER, SIMPLE_FLOAT, SIMPLE_DOUBLE
    2.Regular Expressions:regexp_count
    3.Read Only Table
    4.Virtual Columns
    5.Partitioning:Interval Partitioning,System Partitioning,Reference Partitioning,Virtual Column-Based Partitioning
    6.IGNORE_ROW_ON_DUPKEY_INDEX hint
    7.Analytic functions – NTH_VALUE ,LISTAGG
    8.SecureFiles
    9.Pivot query
    PL/SQL New Features:
    1.Real Native Compilation
    2.DML triggers are faster
    3.Compound triggers
    4.Fine grained dependency Intra unit inlining
    5.PL/SQL result cache
    6.OCI Result Set Caching
    New Language features:
    1.Disabled Trigger
    2.FOLLOWS keyword in Trigger
    3.PLW-006009 warning
    4.Continue statement
    5.Enhancements in Dynamic SQL

Maybe you are looking for

  • HP Envy 120 All in One Printer no longer recognises MacBook Air

    Since upgrading to Yosemite, my HP Envy 120 no longer recognises my Macbook Air and vice versa via the router, having worked previously (not perfectly all the time admittedly but connection wasn't an issue). I can connect Macbook to printer via HP di

  • Why hasn't WP 7.8 update been released on HTC Trophy?

    Title says it all.  I don't want to use any third party ROMs that may damage my device / void my warranty but that's what Verizon is telling its customers to do when it doesn't release a long awaited update.  I, like other Trophy users, bought the Tr

  • Changes in Service Tax Rate from 12% to 10% from 24th Feb 2009

    Dear All SAP Consultants     In our Company we are using JSRT ,JEC3 & JES3 Condition type, for calculation of S.Tax, Cess & H,Cess respectively, for Service Tax Calculation. We have maintain above Condition through FV11 [Maintain Condition Type for V

  • Do we need two ports for establishing one connection to EJB from swing clie

    Hi all, I have an application which uses Java Swing client and accesses an EJB to connect to the server. I am connecting to the EJB using iiop://server-ipaddress:port. It is required for me to open the firewall to access the above specified ip addres

  • Creating users and groups

    Hi all, I have about 100 users and many groups. How can i create users and groups quickly? Appreciate any help