Error with PL/SQL block

Hi
If I run PL/SQL block
DECLARE
CURSOR C1 is SELECT CLM_CASE_NO FROM CLAIM_OBJECT.CLM_INVLVD_PRTY_T where CLM_CASE_NO=XXXX;
BEGIN
FOR X in C1 loop
INSERT INTO POSTL_ADDRS_ARCHIVE P (SELECT A.* FROM CLAIM_OBJECT.POSTL_ADDRS A, CLAIM_OBJECT.CLM_INVLVD_PRTY_T C WHERE
C.CLNT_NO = A.CLNT_NO AND C.CURR_ROW_IND='A' AND C.CLM_CASE_NO =X.CLM_CASE_NO );
end loop;
end;
there is no error with the above block
If I remove where clause in cursor and run block
DECLARE
CURSOR C1 is SELECT CLM_CASE_NO FROM CLAIM_OBJECT.CLM_INVLVD_PRTY_T;
BEGIN
FOR X in C1 loop
INSERT INTO POSTL_ADDRS_ARCHIVE P (SELECT A.* FROM CLAIM_OBJECT.POSTL_ADDRS A, CLAIM_OBJECT.CLM_INVLVD_PRTY_T C WHERE
C.CLNT_NO = A.CLNT_NO AND C.CURR_ROW_IND='A' AND C.CLM_CASE_NO =X.CLM_CASE_NO );
end loop;
end;
ERROR at line 1:
ORA-01013: user requested cancel of current operation
ORA-06512: at line 12
I searched for ORA-06512
Cause:
     This error message indicates the line number in the PLSQL code that the error resulted.
SELECT CLM_CASE_NO FROM CLAIM_OBJECT.CLM_INVLVD_PRTY_T has over 800,672 records.
SELECT CLM_CASE_NO FROM CLAIM_OBJECT.CLM_INVLVD_PRTY_T where CLM_CASE_NO=XXXX; has 2 records.
I am not not understanding why block 2 is throwing error (with no where clause in cursor)
Any help will be greatly appreciated
Thanks in advance

As the error message indicates clearly the process was cancelled as you pressed CTRL+C. And yes you can’t see any data you insert in one session from other session until it gets committed. And as others have mentioned row by row operation is very expensive think about revising your approach.
Instead of having a cursor why don’t you join it directly in you select in the insert statement and try?
Thanks,
Karthick.
Message was edited by:
karthick_arp

Similar Messages

  • Error with Oracle10G Sql Browser while execute package with exec clause

    Dear Experts,
    Please tell me why i am getting Error ORA- 00900 while executing this script with Oracle10G Sql Browserbut not getting error with Oracle9i Sql Browser
    var r1 refcursor;
    var r2 refcursor;
    exec ETKT_CANCEL_TICKET_PCK.GET_DATA(:r1,:r2,'05052007/00000003/0000994','23');

    It would be interesting to know, what Sql Browser is.

  • Error executing pl sql block

    Hii All,
    I'm facing the following error
    ERROR at line 66:
    ORA-06550: line 66, column 20:
    PLS-00306: wrong number or types of arguments in call to '||'
    ORA-06550: line 66, column 11:
    PL/SQL: Statement ignoredVersion Details
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionMy pl sql block
    Declare
        p_table_name  clob := 'CP_CA_DTLS' ;
        Type t_column_name_tab is table of varchar2(4000)
        index by binary_integer;
        l_table_tab      t_column_name_tab;
        l_file_name constant varchar2(5000) := 'column_counts';
        l_count      number;
        l_tab_count    number;
        l_str    varchar2(32000);
        l_tbl_str  varchar2(32000);
      Cursor c_table_columns(c_table_name user_tables.table_name%type)
      Is
        Select  column_name
        from  user_tab_cols
        where  table_name = upper(c_table_name);
      Type t_table_columns is table of c_table_columns%rowtype;
       l_column_name_tab  t_table_columns;
    Begin
        --Splitting comma seperated data
        Select  regexp_substr(p_table_name,'[^,]+{1}',1,level)
        bulk collect into  l_table_tab
        from  dual
        connect by level <= length(regexp_replace(p_table_name,'[^,]*'))+1;
        for k in 1..l_table_tab.count
        loop
         -- dbg_print(l_file_name,'***'||l_table_tab(k)||'***');   
          Begin
              l_tbl_str := 'Select count(*) from '||l_table_tab(k);
              execute immediate l_tbl_str into l_tab_count;
            --  dbg_print(l_file_name,'Overall Count of table '||l_table_tab(k)||' is '||l_tab_count);   
          End;
       -- dbg_print(l_file_name,'Column Name '||','||'Count'); 
        Open c_table_columns(l_table_tab(k));
        loop
          Fetch c_table_columns bulk collect into l_column_name_tab limit 50;
          exit when l_column_name_tab.count = 0;
          dbms_output.put_line('l_column_name_tab.count count is : '||l_column_name_tab.count);
            for i in 1..l_column_name_tab.count
            loop
            Begin
              l_str := 'Select count(*) ' ;
              l_str := l_str||' from  '||l_table_tab(k) ;
              l_str := l_str||' where '||l_column_name_tab(i);
              l_str := l_str||' is null'  ;
              Execute Immediate l_str into l_count;
            End;
            --dbg_print(l_file_name,l_column_name_tab(i)||','||l_count);
            end loop;
        end loop;
        Close c_table_columns;
      end loop;
          dbms_output.put_line('l_column_name_tab.count count is : '||l_column_name_tab.count);
    End;Even I'm not able to print l_column_name_tab(i) using dbms_output.
    (Later I came to know that this information can be achieved using user_tab_col_statistics table)
    But would like to know whats wrong with my code.???
    Plz help me .
    Edited by: 792353 on Dec 3, 2010 1:26 AM

    Hii RDB,
    when I comment this part of code
      --   l_str := l_str||' where '||l_column_name_tab(i);
           --   l_str := l_str||' is null'  ;
    SQL> Declare
      2 
      3 
      4      p_table_name  clob := 'CP_CA_DTLS' ;
      5 
      6      Type t_column_name_tab is table of varchar2(4000)
      7      index by binary_integer;
      8     
      9      l_table_tab      t_column_name_tab;
    10    
    11 
    12 
    13 
    14      l_file_name constant varchar2(5000) := 'column_counts';
    15      l_count      number;
    16      l_tab_count    number;
    17      l_str    varchar2(32000);
    18      l_tbl_str  varchar2(32000);
    19   
    20    Cursor c_table_columns(c_table_name user_tables.table_name%type)
    21    Is
    22      Select  column_name
    23      from  user_tab_cols
    24      where  table_name = upper(c_table_name);
    25     
    26     
    27    Type t_table_columns is table of c_table_columns%rowtype;
    28   
    29   
    30     l_column_name_tab  t_table_columns;
    31   
    32  Begin
    33      --Splitting comma seperated data
    34     
    35      Select  regexp_substr(p_table_name,'[^,]+{1}',1,level)
    36      bulk collect into  l_table_tab
    37      from  dual
    38      connect by level <= length(regexp_replace(p_table_name,'[^,]*'))+1;
    39     
    40      for k in 1..l_table_tab.count
    41      loop
    42       -- dbg_print(l_file_name,'***'||l_table_tab(k)||'***');   
    43       
    44        Begin
    45            l_tbl_str := 'Select count(*) from '||l_table_tab(k);
    46       
    47            execute immediate l_tbl_str into l_tab_count;
    48       
    49          --  dbg_print(l_file_name,'Overall Count of table '||l_table_tab(k)||' is '||l_tab_coun
    t);   
    50 
    51        End;
    52 
    53     -- dbg_print(l_file_name,'Column Name '||','||'Count'); 
    54 
    55      Open c_table_columns(l_table_tab(k));
    56      loop
    57        Fetch c_table_columns bulk collect into l_column_name_tab limit 50;
    58        exit when l_column_name_tab.count = 0;
    59        dbms_output.put_line('l_column_name_tab.count count is : '||l_column_name_tab.count);
    60          for i in 1..l_column_name_tab.count
    61          loop
    62          
    63          Begin
    64            l_str := 'Select count(*) ' ;
    65            l_str := l_str||' from  '||l_table_tab(k) ;
    66         --   l_str := l_str||' where '||l_column_name_tab(i);
    67         --   l_str := l_str||' is null'  ;
    68         
    69            Execute Immediate l_str into l_count;
    70 
    71          End;
    72         
    73          --dbg_print(l_file_name,l_column_name_tab(i)||','||l_count);
    74       
    75          end loop;
    76      end loop;
    77      Close c_table_columns;
    78    end loop;
    79 
    80        dbms_output.put_line('l_column_name_tab.count count is : '||l_column_name_tab.count);
    81  End;
    82  /
    PL/SQL procedure successfully completed.its running fine so the problem is l_column_name_tab(i) !!!!!!
    and there is nothing wrong with l_table_tab(k) and its declaration.
    Edited by: 792353 on Dec 3, 2010 2:17 AM

  • Statspack: error with spcreate.sql in 11.1.0.7 on WIndows

    Hello,
    I'm trying to install statspack on a 11.1.0.7 64bit RDBMS on Windows 2008 R2.
    I get this error during spcreate.sql as sysdba
    ... Creating views
    . quisce_t*drms quiesce_time
    ERROR at line 5
    ORA-00904: "QUISCE_T" : invalid identifier
    I wasn't able to find anything related on metalink....
    Any hint?
    I was previously able to run it on 11.2.0.1 and 11.2.0.3 RDBMS on Linux systems...
    I don't know if it is a problem with this particular version of the rdbms.
    Thanks in advance,
    Gianluca

    hello,
    running now a snap as perfstat user I get this error
    SQL> exec statspack.snap;
    BEGIN statspack.snap; END;
    ERROR at line 1:
    ORA-04063: package body "SYS.DBMS_SHARED_POOL" has errors
    ORA-06508: PL/SQL: could not find program unit being called:
    "SYS.DBMS_SHARED_POOL"
    ORA-06512: at "PERFSTAT.STATSPACK", line 5767
    ORA-06512: at line 1
    In fact
    SQL> select owner,object_name,object_type from dba_objects where status='INVALID
    2 order by object_name;
    OWNER OBJECT_NAME OBJECT_TYPE
    SYS DBMS_SHARED_POOL PACKAGE BODY
    PUBLIC STATSPACK SYNONYM
    Trying to recompile as sysdba I get
    Connected to:
    Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
    SQL> alter package dbms_shared_pool compile body;
    Warning: Package Body altered with compilation errors.
    SQL> show errors
    Errors for PACKAGE BODY DBMS_SHARED_POOL:
    LINE/COL ERROR
    87/13 PLS-00323: subprogram or cursor 'PURGE' is declared in a package
    specification and must be defined in the package body
    Could it be that t was my first 10.2.0.3 spcreate.sql putting the package in this state?
    I don't suppose so and that the package was already invalid before... but not sure...
    How to correct? I found similar cases where Oracle oly suggested catalog/catproc runs... but I would like to avoid if possible...
    Thanks in advance

  • Exception error  in PL/SQL block

    Hi,
    do the following conditions in a PL/SQL block cause an exception error to occur ?
    A- Select statement does not return a row.
    B- Select statement returns more than one row.
    Thank you.

    If you're talking about SELECT INTO then yes:
    Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
    Connected as cmza
    SQL> set serveroutput on
    SQL>
    SQL> declare
      2    v_text varchar2(4000);
      3  begin
      4    -- question 1
      5    select banner
      6      into v_text
      7      from v$version;
      8  end;
      9  /
    declare
      v_text varchar2(4000);
    begin
      -- question 1
      select banner
        into v_text
        from v$version;
    end;
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at line 6
    SQL> declare
      2    v_text varchar2(4000);
      3  begin
      4    -- question 2
      5    select banner
      6      into v_text
      7      from v$version
      8     where 1 = 2;
      9  end;
    10  /
    declare
      v_text varchar2(4000);
    begin
      -- question 2
      select banner
        into v_text
        from v$version
       where 1 = 2;
    end;
    ORA-01403: no data found
    ORA-06512: at line 6
    SQL>

  • Error in PL/SQL Block of Trigger

    Hi all,
    I have written a trigger whose PL/SQL block contains a simple select statment among many other statements.
    Now I find that, if the select statement returns no rows the trigger does not continue its operation further and aborts there itself. And if the select statement returns some rows, then it works fine.
    I tried to execute a simplified PL/SQL block of the trigger in SQL*Plus and following were the results:
    declare
    tempdate date;
    begin
    select trdt into tempdate from inv_trans;
    if sql%notfound then
    null;
    end if;
    end;
    When no data is present in inv_trans table, the result was:
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 4
    And when the table inv_trans had data, the result was:
    PL/SQL procedure successfully completed.
    Why is the piece of code flashing an error when I have already given a treatment if no data is found.
    Why is it taking "No Data in table" as an abnormal condition and not normal?
    THanks in advance
    Warm Regards
    Manu

    In your case you have to use a cursor:
    declare
      cursor c_cur is
        select trdt from inv_trans;
      r_cur   c_cur%rowtype;
    begin
      open c_cur;
      fetch c_cur into r_cur;
      if c_cur%notfound then
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • CDS-11025 Error: Oracle Designer generation error with PL/SQL package

    Hi friends,
    We tried to generate a database package from Oracle Designer (10.1.2.6) and getting "syntax errors" but the package has no syntax errors when we copy and paste the code and compile in TOAD (10.6)
    Error from Designer:
    Server Generator 10.1.2.6 (Build 10.1.2.11.12) , Wed Oct 17 10:58:43 2012
    Copyright (c) Oracle Corporation 1995, 2010. All rights reserved.
    CDS-11025 Error: The PL/SQL within PACKAGE BODY AVP_WATER_ANALYSIS_V has syntax errors - At token 'END', around:
    ...te_dist.VLV_INTL_ID;
    END LOOP;
    Processing Complete: 1 error(s), 0 warning(s)
    code snippet from the Error message:
    FOR rec_update_dist IN cur_update_dist (i_anlyd_intl_id,
    i_iterd_intl_id,
    i_phsed_intl_id,
    i_wtrc_intl_id)
    LOOP
    UPDATE AVP_VALVE AvpValve
    SET AvpValve.DIST_FROM_EDGE = rec_update_dist.DIST_FROM_EDGE
    WHERE AvpValve.ANLYD_INTL_ID = rec_update_dist.ANLYD_INTL_ID
    AND AvpValve.ITERD_INTL_ID = rec_update_dist.ITERD_INTL_ID
    AND AvpValve.PHSED_INTL_ID = rec_update_dist.PHSED_INTL_ID
    AND AvpValve.WTRC_INTL_ID = rec_update_dist.WTRC_INTL_ID
    AND AvpValve.VLV_INTL_ID = rec_update_dist.VLV_INTL_ID;
    END LOOP;
    Thanks for any feedback,
    Jim

    Found the problem.
    It was an issue with the CURSOR with the SELECT ... FROM (SELECT CASE WHEN THEN ELSE END). After swithing to the DECODE statement, Designer is able to generate the package.
    CASE
    WHEN ISOLATION_IND = 'Y' THEN
    'A'
    WHEN OPERATED_IND = 'Y' THEN
    'B'
    ELSE
    'C'
    END
    decode(ISOLATION_IND,'Y','A',decode(OPERATED_IND,'Y','B','C'))
    However, still strange to me that Designer doesn't like the CASE as part of SELECT.
    Edited by: user476620 on Oct 18, 2012 8:13 PM

  • Error with PL/SQL xmlGen if unlimited rows

    If I run xmlgen server side from pl/sql and I dont specify a limit on the rows I get the following error
    xml version=1.0
    ERROR
    oracle.xml.sql.OracleXMLSQLEception
    ORA-00600: internal error code, arguments: [kdlseek-kgbtnscb]
    ERROR
    If limit the rows it works ok, the generated xml is not that big only about 600 rows
    Any ideas on whast the problem
    Rob

    I too get the same problem. Has anyone come up with a solution, not a workaround?
    SQL> select xmlgen.getXML('select * from dict where table_name like ''%ROLE%''') from dual;
    XMLGEN.GETXML('SELECT*FROMDICTWHERETABLE_NAMELIKE''%ROLE%''')
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <TABLE_NAME>DBA_ROLES</T
    SQL> select xmlgen.getXML('select * from dict') from dual;
    select xmlgen.getXML('select * from dict') from dual
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: ORA-00600: internal error code,
    arguments: [kdlseek-kgbtnscb], [], [], [], [], [], [], []
    ORA-06512: at "SCOTT.XMLGEN", line 465
    ORA-06512: at "SCOTT.XMLGEN", line 456
    ORA-06512: at line 1
    SQL> select count(*) from dict;
    COUNT(*)
    851
    SQL> describe dict;
    Name Null? Type
    TABLE_NAME VARCHAR2(30)
    COMMENTS VARCHAR2(4000)
    SQL>
    shared_pool_size = 52428800 # 50MB
    large_pool_size = 614400
    java_pool_size = 41943040 # 40MB
    W2K V5 SP1, 8.1.6 RLSE2 & XSU1.2
    Steve.
    null

  • Error in pl/sql  block with parameters

    Hi,
    I have the following code which works in normal cursor forloops,
    Can some one please check how to achive the same functionality using bulk insert.( i want to use parameterised cursor)
    step 1 ---working
    declare
    CURSOR DEPT_inst
    is
    select d.deptno
    from dept d where d.dname='RESEARCH';
    CURSOR emp_inst (p_dept in number)
             IS
         SELECT e.empno ,
                e.ename  ,
                e.deptno
           from emp1 e
          where e.deptno = p_dept;
    begin
    for i in dept_inst loop
       delete from emp2 where deptno=i.deptno;
       for j in emp_inst(i.deptno) loop
          INSERT INTO emp2(empno,
                               ename,
                               deptno )
                       VALUES (j.empno,
                               j.ename,
                              j.deptno
    end loop;
    end loop;
    commit;
    exception
    when others then
    dbms_output.put_line( 'exception in err insert'||SQLERRM);
    ROLLBACK;
    end;
    step - 2  compilation error
    declare
    CURSOR DEPT_inst
    is
    select d.deptno
    from dept d where dname='RESEARCH';
    CURSOR emp_inst (p_dept in number)
             IS
         SELECT e.empno ,
                e.ename  ,
                e.deptno
           from emp1 e
          where e.dept = p_dept;
    TYPE id_tab_dep_1 IS TABLE OF dept_inst%ROWTYPE
                INDEX BY PLS_INTEGER;
         t_id_dep_1       id_tab_dep_1;
        TYPE id_tab_det_1 IS TABLE OF emp_inst(t_id_det_1(indxi).deptno)%ROWTYPE
                INDEX BY PLS_INTEGER;
         t_id_det_1       id_tab_det_1;
           BEGIN
             OPEN dept_inst;
               FETCH dept_inst
               LOOP
               BULK COLLECT into t_id_dep_1 LIMIT 100;
               EXIT WHEN t_id_dep_1.count <= 0;
             FOR indxi IN t_id_det_1.FIRST  .. t_id_det_1.LAST LOOP
                   delete from emp2 where deptno=t_id_det_1(indxi).deptno;
             OPEN emp_inst;
             LOOP
             FETCH emp_inst(t_id_det_1(indxi).deptno)
                 BULK COLLECT INTO t_id_det_1  limit 100;
                 EXIT WHEN t_id_det_1.count <= 0;
             FOR indxj IN t_id_det_1.FIRST  .. t_id_det_1.LAST LOOP
                     INSERT INTO emp2(empno,
                               ename,
                               deptno )
                       VALUES (t_id_det_1(indxj).empno,
                               t_id_det_1(indxj).ename,
                              t_id_det_1(indxj).deptno
              END LOOP;
              END LOOP;
              CLOSE emp_inst;
              END LOOP;
              END LOOP;
              CLOSE dept_inst;
            EXCEPTION
                   WHEN OTHERS
                   THEN
                      dbms_output.put_line( 'exception in err insert' || SQLCODE ||' ' ||SQLERRM);
                      ROLLBACK;
                      RETURN;
            END;
    I am getting below error
        TYPE id_tab_det_1 IS TABLE OF emp_inst(t_id_det_1(indxi).deptno)%ROWTYPE
    ERROR at line 16:
    ORA-06550: line 16, column 69:
    PLS-00103: Encountered the symbol "%" when expecting one of the following:
    ; not null alter index characterEdited by: user11289444 on Dec 26, 2010 3:58 AM

    hoek wrote:
    I was referring to OP's second Bulk DML, the insert part.
    You cannot reference individual columns there.Then you have to be even more specific. You cannot reference individual columns there unless you are on 11g:
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> declare
      2    cursor dept_inst
      3    is
      4    select d.deptno
      5    from   dept d
      6    where  d.dname = 'RESEARCH';
      7    --
      8    cursor emp_inst(b_deptno in number)
      9    is
    10    select e.empno
    11    ,      e.ename
    12    ,      e.deptno
    13    from   emp1 e
    14    where  e.deptno = b_deptno;
    15    --
    16    type depttype is table of number index by binary_integer;
    17    depttab depttype;
    18    type emptype is table of emp_inst%rowtype /*this will not work*/ index by binary_integer;
    19    emptab emptype;
    20    --
    21  begin
    22    --
    23    open dept_inst;
    24    loop
    25     
    26      fetch dept_inst bulk collect into depttab limit 100;
    27      forall i in depttab.first..depttab.last
    28        delete from emp2 where deptno = depttab(i);
    29         --
    30        dbms_output.put_line(sql%rowcount||' records were deleted from table emp2');
    31        --
    32  --      open emp_inst(depttab(i));
    33        open emp_inst(depttab(1));
    34        loop
    35          fetch emp_inst bulk collect into emptab limit 100;
    36          forall j in emptab.first..emptab.last
    37            insert into emp2 values(emptab(j).empno,emptab(j).ename,emptab(j).deptno);
    38          --
    39          exit when emp_inst%notfound;
    40          --
    41        end loop;
    42        exit when dept_inst%notfound;
    43        close dept_inst;         
    44      --
    45    end loop;
    46    close dept_inst;
    47  end;
    48  /
              insert into emp2 values(emptab(j).empno,emptab(j).ename,emptab(j).deptno);
    ERROR at line 37:
    ORA-06550: line 37, column 35:
    PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND
    table of records
    ORA-06550: line 37, column 35:
    PLS-00382: expression is of wrong type
    ORA-06550: line 37, column 51:
    PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND
    table of records
    ORA-06550: line 37, column 51:
    PLS-00382: expression is of wrong type
    ORA-06550: line 37, column 67:
    PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND
    table of records
    ORA-06550: line 37, column 67:
    PLS-00382: expression is of wrong type
    ORA-06550: line 37, column 35:
    PL/SQL: ORA-22806: not an object or REF
    ORA-06550: line 37, column 11:
    PL/SQL: SQL Statement ignored
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> declare
      2    cursor dept_inst
      3    is
      4    select d.deptno
      5    from   dept d
      6    where  d.dname = 'RESEARCH';
      7    --
      8    cursor emp_inst(b_deptno in number)
      9    is
    10    select e.empno
    11    ,      e.ename
    12    ,      e.deptno
    13    from   emp1 e
    14    where  e.deptno = b_deptno;
    15    --
    16    type depttype is table of number index by binary_integer;
    17    depttab depttype;
    18    type emptype is table of emp_inst%rowtype /*this will not work*/ index by binary_integer;
    19    emptab emptype;
    20    --
    21  begin
    22    --
    23    open dept_inst;
    24    loop
    25     
    26      fetch dept_inst bulk collect into depttab limit 100;
    27      forall i in depttab.first..depttab.last
    28        delete from emp2 where deptno = depttab(i);
    29         --
    30        dbms_output.put_line(sql%rowcount||' records were deleted from table emp2');
    31        --
    32  --      open emp_inst(depttab(i));
    33        open emp_inst(depttab(1));
    34        loop
    35          fetch emp_inst bulk collect into emptab limit 100;
    36          forall j in emptab.first..emptab.last
    37            insert into emp2 values(emptab(j).empno,emptab(j).ename,emptab(j).deptno);
    38          --
    39          exit when emp_inst%notfound;
    40          --
    41        end loop;
    42        exit when dept_inst%notfound;
    43        close dept_inst;         
    44      --
    45    end loop;
    46    close dept_inst;
    47  end;
    48  /
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Error with stored procedure block datasource

    Hi all,
    I tried to base a datablock on a stored procedure in order to get better runtime performance. I work with Forms Builder 6i with patch 17 , and our database is oracle 8.1.7.1.4
    But when compiling I got errors.
    Here are what I did :
    create or replace type TSourceObject as object(name varchar2(30), propname varchar2(200));
    create or replace type TSourceTable is table of TSourceObject;
    create or replace procedure p_query_ntwk_chnl_mirror(p_tab IN OUT NOCOPY TSourceTable, p_action varchar2, p_lien number)
    is
    begin
    if p_action = 'VISU' then
    select TSourceObject(B.bdw_name, P.prop_bdw_name)
    bulk collect into p_tab
    from T_NETWORK_CHANNEL N, t_bdw_mw B, t_prop_bdw_mw P
    where B.comp_bdw = P.comp_bdw and P.comp_prop_bdw = N.comp_prop_bdw
    and EXISTS (SELECT 1
    FROM t_channel_element C
    WHERE N.comp_network_channel = C.comp_network_channel and comp_lien = p_lien);
    else
    select TSourceObject(B.bdw_name, P.prop_bdw_name)
    bulk collect into p_tab
    from T_NETWORK_CHANNEL N, t_bdw_mw B, t_prop_bdw_mw P
    where B.comp_bdw = P.comp_bdw and P.comp_prop_bdw = N.comp_prop_bdw;
    end if;
    end;
    Then I created the datablock with the wizard , I entered correctly the value of the arguments for the table type name, the argument p_action and the argument p_lien.
    And when compiling there was this alert error :
    Compiling QUERY-PROCEDURE trigger on NETWORK_CHANNEL_MIRROR data block...
    Compilation error on QUERY-PROCEDURE trigger on NETWORK_CHANNEL_MIRROR data block:
    PL/SQL ERROR 960 at line 5, column 9
    RPCs cannot use variables with schema level user-defined types in this release
    PL/SQL ERROR 0 at line 5, column 9
    Item ignored
    PL/SQL ERROR 320 at line 7, column 26
    the declaration of the type of this expression is incomplete or malformed
    PL/SQL ERROR 0 at line 7, column 1
    Statement ignored
    PL/SQL ERROR 320 at line 8, column 28
    the declaration of the type of this expression is incomplete or malformed
    PL/SQL ERROR 0 at line 8, column 1
    Statement ignored
    Compilation errors have occurred.
    So what should I do ?
    Thank you very much indeed.

    I create the package , and when creating the body then there was an error.
    Here is the package :
    create or replace package pkg_query_ntwrk_chnl_mirror
    is
    type TSourceObject is record(name varchar2(30), propname varchar2(200));
    type TSourceTable is table of TSourceObject index by binary_integer;
    procedure p_query_ntwk_chnl_mirror(p_tab IN OUT NOCOPY pkg_query_ntwrk_chnl_mirror.TSourceTable, p_action varchar2, p_lien number);
    end;
    create or replace package body pkg_query_ntwrk_chnl_mirror
    is
    procedure p_query_ntwk_chnl_mirror(p_tab IN OUT NOCOPY pkg_query_ntwrk_chnl_mirror.TSourceTable, p_action varchar2, p_lien number)
    is
    begin
    if p_action = 'VISU' then
         select B.bdw_name, P.prop_bdw_name
         bulk collect into p_tab
         from T_NETWORK_CHANNEL N, t_bdw_mw B, t_prop_bdw_mw P
         where B.comp_bdw = P.comp_bdw and P.comp_prop_bdw = N.comp_prop_bdw
         and EXISTS (SELECT 1
         FROM t_channel_element C
         WHERE N.comp_network_channel = C.comp_network_channel and comp_lien = p_lien);
    else
         select B.bdw_name, P.prop_bdw_name
         bulk collect into p_tab
         from T_NETWORK_CHANNEL N, t_bdw_mw B, t_prop_bdw_mw P
         where B.comp_bdw = P.comp_bdw and P.comp_prop_bdw = N.comp_prop_bdw;
    end if;
    end;
    end;
    And here is the error :
    7/2 PL/SQL: SQL Statement ignored
    8/20 PLS-00597: expression 'P_TAB' in the INTO list is of wrong type
    15/2 PL/SQL: SQL Statement ignored
    16/20 PLS-00597: expression 'P_TAB' in the INTO list is of wrong type
    And what is the problem here ? I think it is right!

  • BT2010 Installed Cum Update Packs for Adapters and getting run-time errors with WCF-SQL

    The process has been working fine for months.  Then we installed Cum Update packs to BT2010 (I'll get the exact C.U.'s from our admin guy) and last night got probably 20 errors similar to below.
       - Installed CU6 for BT2010
       - Installed CU3 for LOB (Adapters)
    The SQL stored proc returns a mix of strings, integers, Guids, and dates; the BizTalk schema looks like matches perfectly. The stored proc runs fine in SSMS.
    Got two errors for each, 1 in XLANG/s for the orchestration, and 1 for the Send port that calls the WCF-SQL adapter from the orchestration, and also 1 warning.
    NOTE: This orchestration runs every 15 minutes 24x7.  It calls the Stored Proc to find out which extracts it needs to create.  Most all the extracts run at night.  So if I run the stored proc during the day, it normally returns an empty result
    set.  Yet, the error below is happening every 15 minutes, even when the result set is empty.  How can it generate a data conversion error when there is no data to be converted? 
    ORCHESTRATION/XLANG ERROR:
    xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'Common.Extract.Orchestrations.EFSRExtractHandler(2b35190e-5f11-e360-9ae8-daaf0372cbc3)'.
    The service instance will remain suspended until administratively resumed or terminated.
    If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
    InstanceId: dc354922-73ef-46fc-ac3d-dbf793e5aaf8
    Shape name:
    ShapeId:
    Exception thrown from: segment -1, progress -1
    Inner exception: An error occurred while processing the message, refer to the details section for more information
    Message ID: {066027B8-4750-4D63-A746-1390E9959E49}
    Instance ID: {5A978538-5DD7-40D1-8826-D0486D129F84}
    Error Description: System.InvalidCastException: Failed to convert parameter value from a String to a Guid. ---> System.InvalidCastException: Invalid cast from 'System.String' to 'System.Guid'.
       at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
       at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
       at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming)
       --- End of inner exception stack trace ---
    Server stack trace:
       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
    Exception type: XlangSoapException
    Source: Microsoft.XLANGs.BizTalk.Engine
    Target Site: Void VerifyTransport(Microsoft.XLANGs.Core.Envelope, Int32, Microsoft.XLANGs.Core.Context)
    The following is a stack trace that identifies the location where the exception occured
       at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(Envelope env, Int32 operationId, Context ctx)
       at Microsoft.XLANGs.Core.Subscription.Receive(Segment s, Context ctx, Envelope& env, Boolean topOnly)
       at Microsoft.XLANGs.Core.PortBase.GetMessageIdForSubscription(Subscription subscription, Segment currentSegment, Context cxt, Envelope& env, CachedObject location)
       at Common.Extract.Orchestrations.EFSRExtractHandler.segment1(StopConditions stopOn)
       at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
    SEND PORT ERROR: 
    A message sent to adapter "WCF-Custom" on send port "Send_SQL_Orch_Call_GetAirportsForExtract" with URI "mssql://QADBAlias.datacenter.local//QTAviation?" is suspended.
     Error details: System.InvalidCastException: Failed to convert parameter value from a String to a Guid. ---> System.InvalidCastException: Invalid cast from 'System.String' to 'System.Guid'.
       at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
       at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
       at System.Data.SqlClient.SqlParameter.CoerceValue(Object value, MetaType destinationType, Boolean& coercedToDataFeed, Boolean& typeChanged, Boolean allowStreaming)
       --- End of inner exception stack trace ---
    Server stack trace:
       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
     MessageId:  {C1FB3913-42EB-4957-9289-16D03B02674E}
     InstanceID: {46C9D190-902F-48CE-86CF-D8C3C5B8944D}

    Hi,
    About the error System.InvalidCastException: Failed to convert parameter value from a String to a Guid
    , maybe the field on the database is varchar(string type).
    And you can refer to the similar discussion:
    http://stackoverflow.com/questions/12816641/failed-to-convert-parameter-value-from-string-to-guid
    Hope it can help you.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error with PL/SQL package

    Hi ,
    I have written a package specification given below :
    create or replace PACKAGE BILL_PACKAGE AS
    storeId varchar2(5);
    startDate varchar2(10);
    FUNCTION F_Bill(str_id IN tel_tr_ltm_bl_py.id_str_rt%TYPE,ws_id IN tel_tr_ltm_bl_py.id_ws%TYPE,v_date IN tel_tr_ltm_bl_py.dc_dy_bsn%TYPE) RETURN boolean;
    END BILLPAYPACKAGE;
    I have written the package body also .Now when i am calling the function F_Bill , I am gettin this error :
    PLS-00201: identifier 'BILL_PACKAGE.STARTDATE' must be declared
    ORA-06550: line 2, column 1:
    PL/SQL: Statement ignored
    ORA-06550: line 3, column 1:
    PLS-00201: identifier 'BILL_PACKAGE.STOREID' must be declared
    ORA-06550: line 3, column 1:
    PL/SQL: Statement ignored
    This same package is running fine on another local database.
    What could be the reason for this?
    Is this an acess issue ?In db which we are getting an error , we are using a user 'ConUser' to connect to a schema 'b_owner'.
    How can we check this if this is a privilege issue.
    Thanks!

    >
    This same package is running fine on another local database.
    What could be the reason for this?
    Is this an acess issue ?In db which we are getting an error , we are using a user 'ConUser' to connect to a schema 'b_owner'.
    How can we check this if this is a privilege issue.The user "ConUSer" needs execute privileges for the pacakge.
    Also it depends how he calls the package or the variables in it.
    You can check the privs with
    select * from all_tab_privs where table_name = 'BILL_PACKAGE';this must be run as user ConUser.
    You could also have a problem with name resolution. The name of the package is not BILL_PACKAGE. It is "b_owner.BILL_PACKAGE".
    If you omit the schema name then the current user is tried. So if you call BILL_PACKAGE then this is translated into "ConUSer.BILL_PACKAGE".
    You can change this by creating a synonym like
    create synonym bill_package for b_owner.bill_package;

  • Java.sql.SQLException: Internal Error with oracle.sql.ARRAY getArray()

    hi,
    I am having having problems with the getArray() of oracle.sql.ARRAY.
    Here are the details:
    Oracle Database - 9.2.0.6. The JDBC driver used -10.2.0.1 jar.(the latest available).
    I am calling a stored procedure from java, that has out param as a collection (VARRAY) of a user defined type.
    The stored procedure works fine, if the user/schema used to connect,contains actual type, and i am able to extract the user defined object from the oracle.sql.ARRAY, via getArray().
    But if i use a different user to connect which has public synonyms and execute rights to the actual type, i get the following error:
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:370)
    The problem is happening because we have 2 different users to connect to the database. one is the dba user, which contains all the types, packages and other one the application user, which we are supposed to use, to connect via java. This application user does have access to types via public synonym, but it gives the above mentioned error.
    Please help :(.
    Regards,
    Gaurav.

    Hi avi,
    Even I am getting the same error inspite of preceding the type name with the same user who has created the type.
    It has displayed the array length.When I am trying to fetch each array, I am getting the error.
    ARRAY simpleArray = (ARRAY) cs.getObject(3);          
    System.out.println("Array is of length " + simpleArray.length());          ********************** The above stmt prints 2 records ******************
    But it goes to exception in the foll stmt..
    Object [] objArrStructArray = null;
    try{
         objArrStructArray = (Object[]) simpleArray.getArray();
    }catch(SQLException e){
         e.printStackTrace();
    Do u know abt this?
    The foll is the error which I am getting.
    java.sql.SQLException: Internal Error
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:1026)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1056)
         at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:110)
         at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:2262)
         at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1656)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:466)
         at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:416)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:979)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:923)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:743)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:242)
         at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:208)
         at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:963)
         at oracle.sql.ARRAY.getArray(ARRAY.java:353)
         at com.telstra.plo.data.NetworkDAO.findCablesInBuffer(NetworkDAO.java:730)
         at com.telstra.plo.data.NetworkDAOTest.testFindCablesInBuffer(NetworkDAOTest.java:45)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Thanks
    Archana

  • Problems when tyring to continue install: Errors with grant.sql

    Going through the install procedure for PeopleTools 8.50 with PeopleSoft HRMS 9.1. Running Windows XP Pro SP3. Install on single machine for testing purposes.
    I ran scripts in Data Mover to populate the PeopleSoft database tables. I did this through Database Setup for PeopleSoft HRCS Database and selected Demo for the database type. I have checked all the log files and everything completed successfully.
    Now I am trying to run grant.sql, but I'm getting errors telling me none of the tables exist. I have checked my services and the instance is running. I am attempting to run this script after a shut down of my machine so I could simply be missing a service or something. Not sure what I should be looking for...
    Thanks in advance...
    Edited by: ibrahim2k2 on Nov 19, 2009 8:27 AM

    Now I am trying to run grant.sql, but I'm getting errors telling me none of the tables exist. Which user are you connected with when running the script ?
    Nicolas.

  • Error in PL/SQL block..

    Hi Im facing an error in the following code.. Cant trace it out.
    /* Formatted on 2009/10/21 22:09 (Formatter Plus v4.8.8) */
    DECLARE
       latest_task_id    NUMBER;
       task_name_em7      VARCHAR2 (50);
       select_flag_em7    NUMBER        := 1;
       ds_count_em7       NUMBER;
       stateid           NUMBER;
       ds_id_em7          NUMBER;
       server_id_em7      NUMBER;
    BEGIN
       SELECT server_id
         INTO server_id_em7
         FROM ems_servers
        WHERE server_name = :P82_EM7_COLLECTOR;
       FOR i IN 1 .. apex_application.g_f01.COUNT
       LOOP
          SELECT COUNT (*)
            INTO ds_count_em7
            FROM delivered_service_mapping
           WHERE equipment_id = apex_application.g_f01(i)
             AND termination_id IS NULL;
          IF ds_count_em7 = 0
          THEN
             MERGE INTO provision_em7 pem7
                USING (SELECT apex_application.g_f01(i) apex_equip_id_em7
                         FROM DUAL) a
                ON (    a.apex_equip_id_em7 = pem7.equipment_id
                    AND pem7.termination_id IS NULL)
                WHEN MATCHED THEN
                   UPDATE
                      SET "PROVISION_STATE_ID" = 2, "SERVER_ID" = server_id_em7,
                          "LAST_PROVISION_BY" = :app_user
                      WHERE provision_state_id IN (1, 4, 10, 5)
                WHEN NOT MATCHED THEN
                   INSERT (EQUIPMENT_ID, PROVISION_STATE_ID, ERROR_CODE,
                           SERVER_ID, LASTMODIFIED_BY, LAST_MODIFIED_ON,
                           REMARKS, COLLECTOR_IP, COLLECTION_STATE,CURRENT_STATE)
                   VALUES (a.apex_equip_id_em7,2,NULL,server_id_em7,:APP_USER,SYSDATE,NULL,NULL,NULL,NULL                     NULL, , , 'remarks_by_navarose for iv',
             SELECT delivered_service_id
               INTO ds_id_em7
               FROM delivered_service
              WHERE delivered_service_name = apex_application.g_f02(i);
             INSERT INTO delivered_service_mapping
                         (ID, customer_id,
                          equipment_id, termination_id, delivered_service_id,
                          last_modified_by, last_modified_on
                  VALUES (delivered_service_seq.NEXTVAL, NULL,
                          apex_application.g_f01(i), NULL, ds_id_em7,
                          :APP_USER, SYSDATE
             select_flag_em7 := 0;
          ELSE
             UPDATE delivered_service_mapping SET delivered_service_id = apex_application.g_f01(i),
             last_modified_by = :APP_USER, last_modified_on = SYSDATE;  
             select_flag_em7 := 0;
          END IF;
       END LOOP;
       IF select_flag_em7 = 0
       THEN
          IF P82_CHECK_TASK_NAME_EM7 = 1
          THEN
             IF :P82_CHECK_TASK_NAME_EM7 IS NULL
             THEN
                task_name_em7 :=
                      :app_user
                   || '_PROVISIONING PERIODIC EM7_'
                   || TO_CHAR (SYSDATE, 'YYYYMMDD_HHMISS');
                INSERT INTO tasks
                            (task_id, task_name, created_by,
                             created_on, task_action, task_state_id, server_id
                     VALUES (task_id_seq.NEXTVAL, task_name_em7, :app_user,
                             SYSDATE, 14, 1, server_id_em7
             ELSE
                INSERT INTO tasks
                            (task_id, task_name, created_by,
                             created_on, task_action, task_state_id, server_id
                     VALUES (task_id_seq.NEXTVAL, :P82_TASK_NAME_EM7, :app_user,
                             SYSDATE, 14, 1, server_id_em7
             END IF;
             SELECT MAX (task_id)
               INTO latest_task_id
               FROM tasks
              WHERE created_by = :APP_USER;
             FOR i IN 1 .. apex_application.g_f01.COUNT
             LOOP
                INSERT INTO task_details
                            (task_details_id,
                             equipment_id, task_id
                     VALUES (task_detail_seq.NEXTVAL,
                             apex_application.g_f01 (i), latest_task_id
             END LOOP;
          END IF;
       END IF;
    END;The errror is
    1 error has occurred
    ORA-06550: line 42, column 123: PL/SQL: ORA-00917: missing comma ORA-06550: line 28, column 10: PL/SQL: SQL Statement ignored

    Hi,
    This line:
    VALUES (a.apex_equip_id_em7,2,NULL,server_id_em7,:APP_USER,SYSDATE,NULL,NULL,NULL,NULL                     NULL, , , 'remarks_by_navarose for iv',needs a comma between the two nulls - there's just a huge gap instead!
    Andy

Maybe you are looking for