Why sys_extract_utc(sysdate) never causes error in pl/sql block?

Oracle 11.2
I cannot use
SELECT sys_extract_utc(sysdate) FROM DUAL But I can use
v := sys_extract_utc(sysdate)in a procedure or a trigger without causing any compile or run-time error.
In my opinion, the return value of function sysdate doesn't contain any timezone info, so it should not be able to be used as the parameter of function sys_extract_utc, because it needs timezone info to do the conversion.
Any clues?
Thanks in advance.

Kiran wrote:
use systimestamp it will contain timezone.I know, what I don't know is why sys_extract_utc(sysdate) can be used in procedure without causing any error. It should cause error, right?

Similar Messages

  • 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

  • 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]                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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

  • SQL 2012 SP1 - How to determine a query that causes Error 8623 in SQL Log: The query processor ran out of internal resources and could not produce a query plan. This is a rare event...

    We are getting multiple 8623 Errors in SQL Log while running Vendor's software.
    How can you catch which Query causes the error?
    I tried to catch it using SQL Profiler Trace but it doesn't show which Query/Sp is the one causing an error. 
    I also tried to use Extended Event session to catch it, but it doesn't create any output either.
    Error:
    The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that
    reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.
    Extended Event Session that I used;
    CREATE EVENT SESSION
        overly_complex_queries
    ON SERVER
    ADD EVENT sqlserver.error_reported
        ACTION (sqlserver.sql_text, sqlserver.tsql_stack, sqlserver.database_id, sqlserver.username)
        WHERE ([severity] = 16
    AND [error_number] = 8623)
    ADD TARGET package0.asynchronous_file_target
    (SET filename = 'E:\SQLServer2012\MSSQL11.MSSQLSERVER\MSSQL\Log\XE\overly_complex_queries.xel' ,
        metadatafile = 'E:\SQLServer2012\MSSQL11.MSSQLSERVER\MSSQL\Log\XE\overly_complex_queries.xem',
        max_file_size = 10,
        max_rollover_files = 5)
    WITH (MAX_DISPATCH_LATENCY = 5SECONDS)
    GO
    -- Start the session
    ALTER EVENT SESSION overly_complex_queries
        ON SERVER STATE = START
    GO
    It creates only .xel file, but not .xem
    Any help/advice is greatly appreciated

    Hi VK_DBA,
    According to your error message, about which query statement may fail with error message 8623, as other post, you can use trace flag 4102 & 4118 for overcoming this error. Another way is looking for queries with very long IN lists, a large number of
    UNIONs, or a large number of nested sub-queries. These are the most common causes of this particular error message.
    The error 8623 occurs when attempting to select records through a query with a large number of entries in the "IN" clause (> 10,000). For avoiding this error, I suggest that you could apply the latest Cumulative Updates media for SQL Server 2012 Service
    Pack 1, then simplify the query. You may try divide and conquer approach to get part of the query working (as temp table) and then add extra joins / conditions. Or You could try to run the query using the hint option (force order), option (hash join), option
    (merge join) with a plan guide.
    For more information about error 8623, you can review the following article.
    http://blogs.technet.com/b/mdegre/archive/2012/03/13/8623-the-query-processor-ran-out-of-internal-resources-and-could-not-produce-a-query-plan.aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Why am I getting this error message in SQL Developer-ORA-01735: invalid ALTER TABLE OPTION?

    To Whom it may Concern,
    I am attempting to add two columns Comm_id and Ben_id to a table in SQL Developer (Oracle).
    Here is the syntax I am using:
    ALTER TABLE ACCTMANAGER
    ADD (Comm_id NUMBER(10)),
    Ben_id VARCHAR(2);
    The spool file I'm getting as a result of the script above:
    Error starting at line 1 in command:
    ALTER TABLE ACCTMANAGER
    ADD (Comm_id NUMBER(10)),
    Ben_id VARCHAR(2)
    Error report:
    SQL Error: ORA-01735: invalid ALTER TABLE option
    01735. 00000 -  "invalid ALTER TABLE option"
    *Cause:   
    *Action:
    DESC acctmanager
    Thank you in advance.

    4b60e01f-2ea5-40fe-a161-fc12d38d09e5 wrote:
    To Whom it may Concern,
    I am attempting to add two columns Comm_id and Ben_id to a table in SQL Developer (Oracle).
    Here is the syntax I am using:
    ALTER TABLE ACCTMANAGER
    ADD (Comm_id NUMBER(10)),
    Ben_id VARCHAR(2);
    The spool file I'm getting as a result of the script above:
    Error starting at line 1 in command:
    ALTER TABLE ACCTMANAGER
    ADD (Comm_id NUMBER(10)),
    Ben_id VARCHAR(2)
    Error report:
    SQL Error: ORA-01735: invalid ALTER TABLE option
    01735. 00000 -  "invalid ALTER TABLE option"
    *Cause:  
    *Action:
    DESC acctmanager
    Thank you in advance.
    try as below instead
    ALTER TABLE ACCTMANAGER
    ADD (Comm_id NUMBER(10), Ben_id VARCHAR(2));

  • 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

  • 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.

  • An error when registering SQL server driver

    Hi
    I have got the following error when register SQL server drive
    "RemoteMsDataBase.java": Error #: 302 : cannot access class com.microsoft.jdbc.sqlserver.SQLServerDriver; neither class nor source found for com.microsoft.jdbc.sqlserver.SQLServerDriver at line 19, column 63
    the code that cause error
    // register the SQL driver
    DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
    // connect to the DB by using the driver.
    String connString = "my_dbserver:1433;databasename=my_database";
    String strDBConnect = "jdbc:microsoft:sqlserver://" + connString;
    conn = DriverManager.getConnection(strDBConnect, userName, passwd);
    To include jars to my classpath do this:
    javac -deprecation -classpath msbase.jar;msutil.jar;mssqlserver.jar *.java

    javac -deprecation -classpath msbase.jar;msutil.jar;mssqlserver.jar *.javaSpecify the full path for jar(s), example,
    javac -deprecation -classpath .;c:\myjars\msbase.jar;c:\myjars\msutil.jar;c:\myjars\mssqlserver.jar *.java
    Hope it works.
    Sudha

  • HT203255 Why "Include Text CD" option causes error 4000 when burning disk on Itunes?

    Why "Include Text CD" option causes error 4000 when burning disk on Itunes?

    After running a diagnostics check in iTunes for CD/DVD drives it passed successfully:
    Microsoft Windows 8 x64 Home Premium Edition (Build 9200)
    Dell Inc. Inspiron 5421
    iTunes 11.0.4.4
    QuickTime 7.7.4
    FairPlay 2.4.14
    Apple Application Support 2.3.4
    iPod Updater Library 10.0d2
    CD Driver 2.2.3.0
    CD Driver DLL 2.1.3.1
    Apple Mobile Device 6.1.0.13
    Apple Mobile Device Driver 1.64.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.6.502
    Gracenote MusicID 1.9.6.115
    Gracenote Submit 1.9.6.143
    Gracenote DSP 1.9.6.45
    iTunes Serial Number xxx
    Current user is an administrator.
    The current local date and time is 2013-06-29 16:42:52.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is supported.
    Core Media is supported.
    **** External Plug-ins Information ****
    No external plug-ins installed.
    Genius ID: fc2309a02da463fa503e9fbc2dbb6401
    iPodService 11.0.4.4 (x64) is currently running.
    iTunesHelper 11.0.4.4 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    **** CD/DVD Drive Tests ****
    No drivers in LowerFilters.
    UpperFilters: GEARAspiWDM (2.2.3.0),
    D:   HL-DT-ST DVD+/-R, Rev 
    Audio CD in drive.
    Found 8 songs on CD, playing time 27:37 on Audio CD.
    Track 1, start time 00:02:00
    Track 2, start time 03:55:20
    Track 3, start time 07:17:07
    Track 4, start time 11:37:15
    Track 5, start time 14:40:03
    Track 6, start time 17:46:68
    Track 7, start time 20:52:56
    Track 8, start time 24:52:26
    Audio CD reading succeeded.
    Get drive speed succeeded.
    The drive CDR speeds are:   4 8 10 16 20 24.
    The drive CDRW speeds are:   4.
    The drive DVDR speeds are:   4.
    The drive DVDRW speeds are:   4.
    The last failed audio CD burn had error code 4310(0x000010d6). It happened on drive D:   HL-DT-ST DVD+/-R on CDR media at speed 10X.

  • Why hub sample app windows phone comment characters ò è à cause error ?

    why hub sample app windows phone comment characters ò è à  cause error in
    global::System.Diagnostics.Debugger.Break(); ?

    Hi Orgest,
    Do you add these characters "ò è à" in the SampleData.json file? If so as far as I known the SampleData.json is initially a simple ASCII text file, so if we want to use these special characters, we need to do something with the encoding,
    for the detailed information, please try to refer to the following similar thread:
    https://social.msdn.microsoft.com/Forums/windowsapps/en-US/4d829e96-29dc-4029-911b-f32a40ac01a3/polish-characters-in-sampledatajson-file?forum=wpdevelop
    If I have misunderstood you, please try to post a simple reproduce project in here.
    Best Regards,
    Amy Peng
    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.

  • I have a Free Agent external backup hard drive connected to my iMac Intel desktop via USB.  Why do I get an error message, from time to time, upon startup stating: "disk was disconnected improperly, always eject disk before disconnecting"?

    I have a Free Agent external backup hard drive connected to my iMac Intel desktop via USB, I never unplug it.  Why do I get an error message, from time to time, upon startup stating, "Disk was disconnected improperly.  Always eject disk before disconnecting."?

    I never unplug the external harddrive, and the error message comes up only occassionaly upon startup.  Maybe the USB connection gets disrupted enough to cause the computer to see it as disconnected and then reconnected while the iMac is powered.

  • Why do I get an error message in safari 5.1 telling me to restart in 32 bit mode in order to "view the movie" when I first start safari on opening page?

    why do I get an error message when I start safari 5.1 telling me I need to open browser in 32 bit mode in order to "view movie" ? This occurs when I start safari on the opening page (the page with all the boxes for most viewed web sites). This had never occurred with safari up until the latest updates to safari & OSX [Version 5.1 (6534.50)] and OSX 10.6.8.
    also, I'm not trying to view a movie - this occurs for the page previews that load when safari opens.
    thanks.

    go here:
    http://get.adobe.com/shockwave/otherversions/
    choose "different version">full 64 bit and download - seems to have solved probem...let you know if it happens again

  • Why am I getting this error?  How do I add confirm message to button press?

    Using Java Studio Creator.
    I do not understand why I am getting the following page error:
    Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
    Exception Details: java.lang.IndexOutOfBoundsException
    Index: 0, Size: 0
    Possible Source of Error:
    Class Name: java.util.ArrayList
    File Name: ArrayList.java
    Method Name: RangeCheck
    Line Number: 546
    ======================================================================
    I have a page that works.
    It has a button that is created in the session bean code with the following java:
    button = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    button.setActionListener( application.createMethodBinding("#{ScheduleEditSessionBean.mainApply}", new Class[]{ActionEvent.class} ));
    button.setId( "applyUndates" );
    button.setType( "submit" );
    button.setTitle( "Apply updates.");
    button.setValue( "Apply" );
    button.setStyle(style);
    children.add(button);
    When the button is pushed, it calls the following session bean method:
    public void mainApply(ActionEvent actionEvent)
    updateScheduleData();
    scheduleAdjustFlag = 1;
    dataApplied = true;
    dataSaved = false;
    addControls();
    This all works just fine - no errors
    ====================================================================
    I wanted to add confirmation to the button press, so I removed the action listener for this button and added
    a javascript function call for the onclick method
    button = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    style = "text-align: center; font-family: 'Arial','Helvetica',sans-serif; " + font + " height: 22px; width: 115px";
    // Commented out this line button.setActionListener( application.createMethodBinding("#{ScheduleEditSessionBean.mainApply}", new Class[]{ActionEvent.class} ));
    button.setOnclick("confirmApply()"); // Added this line.
    button.setId( "applyUndates" );
    button.setType( "submit" );
    button.setTitle( "Apply updates.");
    button.setValue( "Apply" );
    button.setStyle(style);
    children.add(button);
    I added a dummy button to the page that has the following call to execute the mainApply method in the sessioon bean.
    The button action just calls the mainApply() method in the session bean
    public String mainApplyBtn_action() {
    seb.mainApply();
    return null;
    Added the javascript to the page that simply pushes the dummy button if confirmed.
    function confirmApply()
    if( confirm( 'Are you sure you want to Apply these changes?' ) )
    form1["form1:mainApplyBtn"].click();
    The session bean method looks like this it is the same method as before, but without the action event argument.
    public void mainApply()
    lsb.logMsg( "<ScheduleEditBean.mainApply> Main apply pushed" );
    updateScheduleData();
    scheduleAdjustFlag = 1;
    dataApplied = true;
    dataSaved = false;
    addControls();
    ==================================================================================
    Now, when I push the original 'Apply' button, I get the confirmation box just like I expected.
    But when I confirm the question, I get the error at the top of this post.
    If I push the 'dummy button' directly, I do not get the error.
    I do not understand why I should be gettng this error.
    Can anyone give me a clue as to why this change would cause the problem?
    The error is related to an ArrayList.
    I use several of these on the page, but they should be filled with data in the preRender method of the page.
    Can anyone suggest a way that I can add confirmation to a button that is created under program control?
    Thanks

    Make use of the fact that when an onclick event of a button returns 'false', the action will not be taken.
    Pseudocode:<h:commandButton value="submit" action="#{myBean.action}" onclick="return confirm('Are you sure?');" />

Maybe you are looking for