Help with ORA 24381

Hi all,
I have a stored proecedure where I am supposed to load data into a table from multiple tables.
I am using BULK COLLECT technique here. My data is loaded alright but in my status monitoring table (which records any errors that might occur) I am getting an entry after the data loads as:
"ORA-24381: error(s) in array DML."
Please suggest your inputs on what might be going wrong.
Thank you.
Edited by: Chaitanya on Oct 25, 2010 5:28 AM

What version of Oracle?
How much data are you trying to load?
Can you post the code?

Similar Messages

  • Help with ORA 14400 error while inserting data

    Hi all,
    i am facing an ora 14400 error in the following scenario , please help.
    i have created a table using the syntax:
    CREATE TABLE temp_table
    GRPKEY NUMBER(20, 0) NOT NULL,
    UKEY NUMBER(10, 0),
    ANUM VARCHAR2(250 BYTE),
    APC VARCHAR2(2 BYTE),
    SID VARCHAR2(65 BYTE),
    RDATETIME VARCHAR2(19 BYTE),
    CKEY NUMBER(20, 0),
    AVER VARCHAR2(25 BYTE),
    CVER VARCHAR2(250 BYTE),
    TNAME VARCHAR2(50 BYTE),
    SCODE VARCHAR2(30 BYTE),
    PTYPE VARCHAR2(50 BYTE),
    FILENUMB NUMBER(10, 0),
    LINENUMB NUMBER(10, 0),
    ENTRY_CREATEDDATE DATE
    , CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
    PARTITION BY RANGE(ENTRY_CREATEDDATE)
    (PARTITION P0 VALUES LESS THAN(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    when i try to insert data using :
    insert into temp_table values
    (1,null,null,null,null,null,null,null,null,null,null,null,null,null,'01-NOV-2010');
    i get the following error output:
    Error report:
    SQL Error: ORA-14400: inserted partition key does not map to any partition
    14400. 00000 - "inserted partition key does not map to any partition"
    *Cause:    An attempt was made to insert a record into, a Range or Composite
    Range object, with a concatenated partition key that is beyond
    the concatenated partition bound list of the last partition -OR-
    An attempt was made to insert a record into a List object with
    a partition key that did not match the literal values specified
    for any of the partitions.
    *Action:   Do not insert the key. Or, add a partition capable of accepting
    the key, Or add values matching the key to a partition specification

    Hi Chaitanya,
    Change your table script to
    CREATE TABLE temp_table
    GRPKEY NUMBER(20, 0) NOT NULL,
    UKEY NUMBER(10, 0),
    ANUM VARCHAR2(250 BYTE),
    APC VARCHAR2(2 BYTE),
    SID VARCHAR2(65 BYTE),
    RDATETIME VARCHAR2(19 BYTE),
    CKEY NUMBER(20, 0),
    AVER VARCHAR2(25 BYTE),
    CVER VARCHAR2(250 BYTE),
    TNAME VARCHAR2(50 BYTE),
    SCODE VARCHAR2(30 BYTE),
    PTYPE VARCHAR2(50 BYTE),
    FILENUMB NUMBER(10, 0),
    LINENUMB NUMBER(10, 0),
    ENTRY_CREATEDDATE DATE
    , CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
    PARTITION BY RANGE(ENTRY_CREATEDDATE)
    (PARTITION P0 VALUES LESS THAN(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P1 VALUES LESS THAN(MAXVALUE)
    insert into temp_table values
    (1,null,null,null,null,null,null,null,null,null,null,null,null,null,'01-NOV-2010');
    1 row insertedor refer question regarding "Date Partitioning a table"
    *009*
    Edited by: 009 on Nov 3, 2010 11:29 PM

  • Urgent help with ORA-01062: unable to allocate memory for define buffer

    Hello, Folks!
    I have a c++ code that is using OCI API that is running both in
    windows and in spark.
    (The same c++ code compiled and running in both platforms)
    and asking the same query.
    In windows, everything is OK but in spark
    it failes...
    The ORACLE Server is installed on win2003 station
    Both client and server ORACLE version is 10.2.0.1.0
    The code is running on spark(oracle instant client is installed)
    This query is a simple select query that selects only one field
    of type VARCHAR2(4000) (the same problem with happen with any
    string type field larger than 150 characters)
    The error occured when calling for OCIDefineByPos method
    when associating an item in a select-list with the type and output
    data buffer.
    The error message is: ORA-01062: unable to allocate memory for define
    buffer
    (This error message signifies that I need to use piecewise operation...)
    But it happens even if I make this varchar2 field to be of size larger
    than 150.
    It is not fair to use piecewise fetch for such a small fields sizes.
    May be there is not configuration setting that can enlarge this
    I know that I wrote here a very superficial description.
    If somebody knows something about this issue, please help
    Thanks

    I had a special luck today after searching the solution per weeks:)I have got a solution.
    When I get the size of the oci field, in the following expressioin
    l_nResult = OCIAttrGet(l_oParam->pOCIHandle(), OCI_DTYPE_PARAM, &(orFieldMD.m_nSize), NULL, OCI_ATTR_DATA_SIZE, m_oOCIErrInfo.pOCIError());
    orFieldMD.m_nSize was of type ub4 but according the manual it must be ub2.
    As a result, the number returned was very large (junk?) and I passed this value to OCIDefineByPos
    Now I changed the type and everything is working!!!
    In windows there is not problem with this expression :)
    Thanks
    Issahar

  • Please Help with ORA-01031 - try to connect as sysdba

    The log of the error is as follows:
    D:\oracle\product\10.1.0\Db_ra>set oracle_sid
    Environment variable oracle_sid not defined
    D:\oracle\product\10.1.0\Db_ra>set oracle_sid=ra
    D:\oracle\product\10.1.0\Db_ra>connect "/ as sysdba"
    'connect' is not recognized as an internal or external command,
    operable program or batch file.
    D:\oracle\product\10.1.0\Db_ra>sqlplus "/ as sysdba"
    SQL*Plus: Release 9.0.1.4.0 - Production on Mon Aug 29 12:31:17 2005
    (c) Copyright 2001 Oracle Corporation. All rights reserved.
    ERROR:
    ORA-01031: insufficient privileges
    Enter user-name: sys@ra as sysdba
    Enter password:
    Connected to an idle instance.
    SQL> shutdown immediate;
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    SQL> startup;
    ORACLE instance started.
    Total System Global Area 612368384 bytes
    Fixed Size 790096 bytes
    Variable Size 170127792 bytes
    Database Buffers 440401920 bytes
    Redo Buffers 1048576 bytes
    Database mounted.
    ORA-01092: ORACLE instance terminated. Disconnection forced
    I have been trying to work this out, but no success, Thanks in advance for your help.
    JA

    some part of the alert.log:
    Instance terminated by USER, pid = 1212
    ORA-1092 signalled during: ALTER DATABASE open ...
    Dump file d:\oracle\product\10.1.0\admin\ra\bdump\alert_ra.log
    Mon Aug 29 16:40:06 2005
    ORACLE V10.1.0.2.0 - Production vsnsta=0
    vsnsql=13 vsnxtr=3
    Windows Server 2003 Version V5.2 Service Pack 1
    CPU : 4 - type 586, 2 Physical Cores
    Process Affinity: 0x00000000
    Memory (A/P) : PH:3794M/4094M, PG:5823M/5973M, VA:1960M/2047M
    Mon Aug 29 16:40:06 2005
    Starting ORACLE instance (normal)
    LICENSE_MAX_SESSION = 0
    LICENSE_SESSIONS_WARNING = 0
    Picked latch-free SCN scheme 2
    KCCDEBUG_LEVEL = 0
    Autotune of undo retention is turned on.
    Dynamic strands is set to TRUE
    Running with 2 shared and 18 private strand(s). Zero-copy redo is FALSE
    IMODE=BR
    ILAT =18
    LICENSE_MAX_USERS = 0
    SYS auditing is disabled
    Starting up ORACLE RDBMS Version: 10.1.0.2.0.
    System parameters with non-default values:
    processes = 150
    __shared_pool_size = 159383552
    __large_pool_size = 4194304
    __java_pool_size = 4194304
    sga_target = 612368384
    control_files = D:\ORACLE\PRODUCT\10.1.0\RA\U02\ORADATA\RA\CONTROLFILE\O1_MF_1GHVSHLJ_.CTL, D:\ORACLE\PRODUCT\10.1.0\RA\U03\ORADATA\RA\CONTROLFILE\O1_MF_1GHVSHNZ_.CTL
    db_block_size = 8192
    __db_cache_size = 440401920
    compatible = 10.1.0.2.0
    log_archive_dest_1 = LOCATION=D:\oracle\product\10.1.0\ra\flash_recovery_area
    log_archive_format = ARC%S_%R.%T
    db_file_multiblock_read_count= 8
    db_create_file_dest = D:\oracle\product\10.1.0\ra\u01\oradata
    db_create_online_log_dest_1= D:\oracle\product\10.1.0\ra\u02\oradata
    db_create_online_log_dest_2= D:\oracle\product\10.1.0\ra\u03\oradata
    db_recovery_file_dest = D:\oracle\product\10.1.0\ra\flash_recovery_area
    db_recovery_file_dest_size= 10485760000
    undo_management = AUTO
    undo_tablespace = UNDOTBS1
    remote_login_passwordfile= EXCLUSIVE
    db_domain = megatel.hn
    dispatchers = (protocol=TCP)
    shared_servers = 1
    job_queue_processes = 10
    background_dump_dest = D:\ORACLE\PRODUCT\10.1.0\ADMIN\RA\BDUMP
    user_dump_dest = D:\ORACLE\PRODUCT\10.1.0\ADMIN\RA\UDUMP
    core_dump_dest = D:\ORACLE\PRODUCT\10.1.0\ADMIN\RA\CDUMP
    sort_area_size = 65536
    db_name = ra
    open_cursors = 300
    pga_aggregate_target = 203423744
    MMAN started with pid=3, OS id=1236
    RECO started with pid=8, OS id=768
    CJQ0 started with pid=9, OS id=1260
    Mon Aug 29 16:40:08 2005
    starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
    starting up 1 shared server(s) ...
    SMON started with pid=7, OS id=1256
    CKPT started with pid=6, OS id=1252
    Mon Aug 29 16:40:10 2005
    alter database mount exclusive
    PMON started with pid=2, OS id=1232
    LGWR started with pid=5, OS id=1248
    DBW0 started with pid=4, OS id=1244
    Mon Aug 29 16:40:13 2005
    Controlfile identified with block size 16384
    Mon Aug 29 16:40:17 2005
    Setting recovery target incarnation to 2
    Mon Aug 29 16:40:17 2005
    Successful mount of redo thread 1, with mount id 2665279661
    Mon Aug 29 16:40:17 2005
    Database mounted in Exclusive Mode.
    Completed: alter database mount exclusive
    Mon Aug 29 16:40:18 2005
    alter database open
    Mon Aug 29 16:40:18 2005
    Beginning crash recovery of 1 threads
    attempting to start a parallel recovery with 3 processes
    parallel recovery started with 3 processes
    Mon Aug 29 16:40:19 2005
    Started first pass scan
    Log resilvered from block #210 to block #212
    Mon Aug 29 16:40:19 2005
    Completed first pass scan
    210 redo blocks read, 131 data blocks need recovery
    Mon Aug 29 16:40:19 2005
    Started redo application at
    Thread 1: logseq 2213, block 3, scn 0.0
    Recovery of Online Redo Log: Thread 1 Group 1 Seq 2213 Reading mem 0
    Mem# 0 errs 0: D:\ORACLE\PRODUCT\10.1.0\RA\U02\ORADATA\RA\ONLINELOG\O1_MF_1_1GHVSJOX_.LOG
    Mem# 1 errs 0: D:\ORACLE\PRODUCT\10.1.0\RA\U03\ORADATA\RA\ONLINELOG\O1_MF_1_1GHVSJW8_.LOG
    Mon Aug 29 16:40:20 2005
    Completed redo application
    Mon Aug 29 16:40:20 2005
    Completed crash recovery at
    Thread 1: logseq 2213, block 213, scn 0.8340211
    131 data blocks read, 131 data blocks written, 210 redo blocks read
    Mon Aug 29 16:40:21 2005
    LGWR: STARTING ARCH PROCESSES
    ARC0 started with pid=15, OS id=2064
    ARC0: Archival started
    Mon Aug 29 16:40:21 2005
    LGWR: STARTING ARCH PROCESSES COMPLETE
    ARC1 started with pid=16, OS id=2076
    ARC1: Archival started
    Mon Aug 29 16:40:21 2005
    ARC0: Becoming the 'no FAL' ARCH
    ARC0: Becoming the 'no SRL' ARCH
    Mon Aug 29 16:40:21 2005
    ARC1: Becoming the heartbeat ARCH
    Mon Aug 29 16:40:21 2005
    LGWR: Primary database is in CLUSTER CONSISTENT mode
    Thread 1 advanced to log sequence 2214
    Maximum redo generation record size = 120832 bytes
    Maximum redo generation change vector size = 116476 bytes
    Private_strands 7 at log switch
    Thread 1 opened at log sequence 2214
    Current log# 2 seq# 2214 mem# 0: D:\ORACLE\PRODUCT\10.1.0\RA\U02\ORADATA\RA\ONLINELOG\O1_MF_2_1GHVSK69_.LOG
    Current log# 2 seq# 2214 mem# 1: D:\ORACLE\PRODUCT\10.1.0\RA\U03\ORADATA\RA\ONLINELOG\O1_MF_2_1GHVSKF3_.LOG
    Successful open of redo thread 1
    Mon Aug 29 16:40:21 2005
    MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
    Mon Aug 29 16:40:21 2005
    ARC0: Evaluating archive log 1 thread 1 sequence 2213
    Mon Aug 29 16:40:21 2005
    ARC1: Evaluating archive log 1 thread 1 sequence 2213
    ARC1: Unable to archive log 1 thread 1 sequence 2213
    Log actively being archived by another process
    ARC1: Evaluating archive log 1 thread 1 sequence 2213
    Mon Aug 29 16:40:22 2005
    SMON: enabling cache recovery
    Mon Aug 29 16:40:22 2005
    ARC1: Unable to archive log 1 thread 1 sequence 2213
    Log actively being archived by another process
    ARC1: Evaluating archive log 1 thread 1 sequence 2213
    ARC1: Unable to archive log 1 thread 1 sequence 2213
    Log actively being archived by another process
    Mon Aug 29 16:40:22 2005
    Committing creation of archivelog 'D:\ORACLE\PRODUCT\10.1.0\RA\FLASH_RECOVERY_AREA\ARC02213_0564762704.001'
    Mon Aug 29 16:40:23 2005
    Successfully onlined Undo Tablespace 1.
    Mon Aug 29 16:40:23 2005
    SMON: enabling tx recovery
    Mon Aug 29 16:40:23 2005
    Database Characterset is WE8MSWIN1252
    Mon Aug 29 16:40:23 2005
    Published database character set on system events channel
    Mon Aug 29 16:40:23 2005
    All processes have switched to database character set
    Mon Aug 29 16:40:25 2005
    Starting background process QMNC
    QMNC started with pid=17, OS id=2152
    Mon Aug 29 16:40:27 2005
    replication_dependency_tracking turned off (no async multimaster replication found)
    Mon Aug 29 16:40:28 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\udump\ra_ora_1304.trc:
    ORA-00600: internal error code, arguments: [kksfbc-reparse-infinite-loop], [], [], [], [], [], [], []
    Mon Aug 29 16:40:30 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\udump\ra_ora_1304.trc:
    ORA-00600: internal error code, arguments: [kksfbc-reparse-infinite-loop], [], [], [], [], [], [], []
    Mon Aug 29 16:40:31 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\udump\ra_ora_1304.trc:
    ORA-00600: internal error code, arguments: [kksfbc-reparse-infinite-loop], [], [], [], [], [], [], []
    Mon Aug 29 16:40:32 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\udump\ra_ora_1304.trc:
    ORA-00600: internal error code, arguments: [kksfbc-reparse-infinite-loop], [], [], [], [], [], [], []
    Error 600 happened during db open, shutting down database
    USER: terminating instance due to error 600
    Mon Aug 29 16:40:33 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\bdump\ra_mman_1236.trc:
    ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], []
    Mon Aug 29 16:40:33 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\bdump\ra_p002_1984.trc:
    ORA-00600: internal error code, arguments: [15784], [600], [], [], [], [], [], []
    ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], []
    Mon Aug 29 16:40:33 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\bdump\ra_p001_1980.trc:
    ORA-00600: internal error code, arguments: [15784], [600], [], [], [], [], [], []
    ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], []
    Mon Aug 29 16:40:33 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\bdump\ra_p000_1568.trc:
    ORA-00600: internal error code, arguments: [15784], [600], [], [], [], [], [], []
    ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], []
    Mon Aug 29 16:40:33 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\bdump\ra_reco_768.trc:
    ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], []
    Mon Aug 29 16:40:33 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\bdump\ra_smon_1256.trc:
    ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], []
    Mon Aug 29 16:40:33 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\bdump\ra_ckpt_1252.trc:
    ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], []
    Mon Aug 29 16:40:33 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\bdump\ra_lgwr_1248.trc:
    ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], []
    Mon Aug 29 16:40:34 2005
    Errors in file d:\oracle\product\10.1.0\admin\ra\bdump\ra_dbw0_1244.trc:
    ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], []
    Instance terminated by USER, pid = 1304
    ORA-1092 signalled during: alter database open...

  • Need Help with ORA-00604 - ORA-01219

    Hey i'm having a hard to understand the error messages generated by our Oracle database server. i'm in charge of the development of a .NET apps with an Oracle DB underneath.
    i tried to change the parameter values ( the java pool and the shared pool) and when i tried to apply the change from Enterprise manager the shutdown process didn't complete, the parameters values are all gone and i'm trying to log on thru SQL* Plus i'm getting the following errors
    ORA-00604 error occured at recusive SQL Level 1
    ORA-01219 database not open: queries allowed on fixed tables/views only
    is there a way to recover or to reload the previous parameters values? . i really need some help on this
    thanks in advance

    Take a look in the alert log for the database to see why the database did not open. The alert log can be found in ORACLE_BASE/admin/<dbsid>/bdump/alert_<dbsid>.log .
    You can try to open the database with the following:
    set ORACLE_SID=<dbsid>
    sqlplus /nolog
    connect / as sysdba
    alter database open;
    It is possible that the above will not open the database if there is something preventing the opening of the database. That information can be found in the alert log mentioned above.

  • Help with "ORA-06511: PL/SQL: cursor already open"

    I've tried numerous variations on this piece of code and I always get the same result. I'm sure this is painfully obvious to an experienced PL/SQL person.
    Any help will be appreciated!
    Thank You!
    1 DECLARE
    2 CURSOR EMP_CURSOR IS SELECT last_name from employees;
    3 current_last_name varchar2(25);
    4 BEGIN
    5 IF EMP_CURSOR%ISOPEN
    6 THEN
    7 dbms_output.put_line ('cursor is already open');
    8 close EMP_CURSOR;
    9 END IF;
    10 dbms_output.put_line ('opening cursor');
    11 OPEN EMP_CURSOR;
    12 FOR item in EMP_CURSOR LOOP
    13 FETCH EMP_CURSOR INTO current_last_name;
    14 EXIT WHEN EMP_CURSOR%NOTFOUND;
    15 dbms_output.put_line (item.last_name);
    16 END LOOP;
    17 CLOSE EMP_CURSOR;
    18* END;
    19 /
    DECLARE
    ERROR at line 1:
    ORA-06511: PL/SQL: cursor already open
    ORA-06512: at line 2
    ORA-06512: at line 12

    Mathieu,
    Log in as anotherSchema and grant select on 'IDsTable' to the current user.
    SQL> r
      1  create or replace function f1(theID varchar2) return mytype pipelined is
      2  out varchar2(30);
      3  cursor myCursor (x varchar2) is select * from scott.emp where job=x;
      4  begin
      5  for rec in myCursor(theID) loop
      6  pipe row(rec.ename);
      7  end loop;
      8  return;
      9* end;
    Warning: Function created with compilation errors.
    SQL> show errors
    Errors for FUNCTION F1:
    LINE/COL ERROR
    3/33     PL/SQL: SQL Statement ignored
    3/53     PL/SQL: ORA-00942: table or view does not exist
    6/1      PL/SQL: Statement ignored
    6/10     PLS-00364: loop index variable 'REC' use is invalid
    SQL> connect scott
    Enter password: *****
    Connected.
    SQL> grant select on emp to testuser;
    Grant succeeded.
    SQL> connect testuser
    Enter password: ****
    Connected.
    SQL> create or replace function f1(theID varchar2) return mytype pipelined is
      2  out varchar2(30);
      3  cursor myCursor (x varchar2) is select * from scott.emp where job=x;
      4  begin
      5  for rec in myCursor(theID) loop
      6  pipe row(rec.ename);
      7  end loop;
      8  return;
      9  end;
    10  /
    Function created.
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.2.0.3.0 - Production
    SQL>

  • Help with ORA-01403: no data found please.

    First off I'd like to apologise for my lack of PL/SQL experience, what follows may seem naive, but I guess we all have to start somewhere.
    I'm trying to create a function which determines an employee's Annual Holiday Entitlement by comparing their length of service against a lookup of entitlement values. Due to the complexity of the application I'm targeting there are a number of other factors to be take into consideration, but this is the basic idea of what I want to achieve.
    I've started by taking a working SQL Server 2005 function and converted this using the translation scratch pad in SQL Developer 1.5.1 I'm now hand cranking the subtleties into the script but when I debug the code I'm getting "ORA-01403: no data found" at almost every SELECT. In fact the only successful select is from the ABS_SYSTEM_CONTROLS table. I can handle the first few failures by setting default values in the variables that I'm trying to load, but this isn't an option when it comes to selecting the DATE_OF_START from the PERSON table.
    I've sure I've probably made some fundamental error, but can't spot it myself. Any help would be most welcome.
    I've included the entire script below for your entertainment ;-)
    Thanks
    Phil.
    create or replace
    function mygetannualholidayentitlement
    ( v_empNo in varchar2
    , v_inputDate in DATE
    ) return number as
       -- Declare variables here
       v_entitlement FLOAT(53);
       v_holidayPlan VARCHAR2(20);
       v_contServiceOption VARCHAR2(255);
       v_postNo CHAR(16);
       v_lengthOfService NUMBER(10,2) ; -- Need to give this a default value else the CURSOR (below) won't initialise.
       v_empStartDate DATE;
       -- Load up our loacal variable for each row in the loop and the final value is the one we want.
       v_selectedLOF FLOAT(53);
       v_selectedDateEffective DATE;
       v_selectedAmount FLOAT(53);
       v_effectiveDate DATE;
       -- Cursor declaration
       -- Holiday plan details are also keyed on DATE_EFFECTIVE.  Need to identify which row is active as at our @effectiveDate.
       CURSOR holDefCursor
         IS SELECT length_of_service,
       date_effective,
       amount
         FROM holiday_plan_def
          WHERE hplan_code = v_holidayPlan
         AND length_of_service < v_lengthOfService
         ORDER BY date_effective ASC,
       length_of_service ASC;
    BEGIN
       -- Initialise variables --
       -- truncate any hours/Mins & secs from effective date
       v_effectiveDate := trunc(v_inputdate);
       v_entitlement := 0;
       v_contServiceOption := 0;
       v_lengthOfService := 0;
       BEGIN
       SELECT HPLAN_CODE
         INTO v_holidayPlan
         FROM APPT_HOLIDAY_BALANCE
          WHERE emp_no = v_empNo
                  --          post_no = @postNo and
                  AND ( v_effectiveDate BETWEEN HOLIDAY_YEAR_START AND HOLIDAY_YEAR_END );
       EXCEPTION
       WHEN NO_DATA_FOUND THEN
          v_holidayplan:=NULL;
       WHEN OTHERS THEN
           raise_application_error(-20011,'Unknown Exception in MyGetAnnualHolidayEntitlement function.');
       END;
       -- Still no hoildayPlan? Then use the default plan code from ABS_SYSTEM_CONTROLS.
       IF v_holidayPlan IS NULL THEN
          SELECT HPLAN_CODE
            INTO v_holidayPlan
            FROM ABS_SYSTEM_CONTROLS ;
       END IF;
       BEGIN
        SELECT OPTION_VALUE
          INTO v_contServiceOption
          FROM PS_OPTIONS
           WHERE OPTION_NAME = 'CONTINUOUS_SERVICE_OPTION';
       EXCEPTION
       WHEN NO_DATA_FOUND THEN
          v_contServiceOption := 'N' ;
       WHEN OTHERS THEN
           raise_application_error(-20011,'Unknown Exception in MyGetAnnualHolidayEntitlement function.');
       END;
       IF v_contServiceOption = 'Y' THEN
       BEGIN
          -- Need to take into account the employees CONTINUOUS_SERVICE_DATE when calculating length of service
          BEGIN
          SELECT CONTINUOUS_SERVICE_DATE
            INTO v_empStartDate
            FROM person
             WHERE emp_no = v_empNo;
          EXCEPTION  
            WHEN NO_DATA_FOUND THEN
              v_empStartDate := NULL;
            WHEN OTHERS THEN
              raise_application_error(-20011,'Unknown Exception in MyGetAnnualHolidayEntitlement function.');
          END;
          -- If we can't get a CONTINUOUS_SERVICE_DATE we will fall back to PERSON.DATE_OF_START
          IF v_empStartDate IS NULL THEN
          BEGIN
             SELECT DATE_OF_START
               INTO v_empStartDate
               FROM PERSON
                WHERE emp_no = v_empNo;
          EXCEPTION  
            WHEN OTHERS THEN
              raise_application_error(-20011,'Unknown Exception in MyGetAnnualHolidayEntitlement function.');
          END;
          END IF;
       END;
       ELSE
       BEGIN
          -- Need to use employees DATE_OF_START when calculating length of service
          SELECT DATE_OF_START
            INTO v_empStartDate
            FROM PERSON
             WHERE emp_no = v_empNo;
       END;
       END IF;
       -- Now we can get length of service
       v_lengthOfService := sqlserver_utilities.datediff('MONTH', v_empStartDate, v_effectiveDate) / 12.00;
       OPEN holDefCursor;
       FETCH holDefCursor INTO v_selectedLOF,v_selectedDateEffective,v_selectedAmount;
       WHILE ( sqlserver_utilities.fetch_status(holDefCursor%FOUND) = 0 )
       LOOP
          BEGIN
             IF v_selectedDateEffective < v_effectiveDate THEN
                v_entitlement := v_selectedAmount;
             END IF;
             -- Get the next value.
             FETCH holDefCursor INTO v_selectedLOF,v_selectedDateEffective,v_selectedAmount;
          END;
       END LOOP;
       CLOSE holDefCursor;
       -- Return the result of the function
       RETURN v_entitlement;
    END;Edited by: user4395499 on 27-Oct-2008 04:04
    Edited by: user4395499 on 27-Oct-2008 04:05
    Edited by: user4395499 on 27-Oct-2008 07:10

    Your code is extremely procedural - whilst you could ultimately get it to work like this, it is not the most efficient way of doing it.
    You should think about reducing your code to one sql statement if at all possible - this reduces the amount of context switching that needs to take place (eg. Going from PL/SQL to SQL back to PL/SQL to SQL, etc) and is usually much easier to maintain and test. You could do this by joining the various tables together, (and you might want to think about using nvl() to combine the two queries on the PERSON table!).
    Also, you've labelled your parameters "v_" and your variables "v_" ... common convention uses "p_" for parameters, to allow for easy distinction between parameters passed in and variables declared during the course of the procedure/function.
    As to the char() defined column - is there any chance that you could change that? As you've found out, chars are usually not a good datatype to use! Storing numbers in a char/varchar2 column is a no-no too, as you then run the risk of having invalid numbers stored in the column.

  • Need help with ora-01036  illegal variable name/number

    Can you help me fix the following problem.
    I'm getting an oracle exceptioin while running the following.
    OracleParameter[] myParameters = new OracleParameter[] { new OracleParameter("SELECTEDREGIONS", OracleDbType.RefCursor, ParameterDirection.Output) };
    XmlReader xRdr = oraclehelper.ExecuteXmlReader(myConnection,CommandType.StoredProcedure,"TEST_TESTPACKAGE.TEST_GETREGIONS_SP",myParameters);
    the oracle helper function is
    public XmlReader ExecuteXmlReader(OracleConnection inConnection,
    CommandType inCommandType,
    string inCommandText,
    params OracleParameter[] inCommandParameters)
    //create a command and prepare it for execution
    OracleCommand cmd = new OracleCommand(inCommandText,inConnection);
    cmd.CommandType = inCommandType;
    if (inCommandParameters != null)
    foreach (OracleParameter op in inCommandParameters)
    cmd.Parameters.Add(op);
    cmd.BindByName = true;
    cmd.XmlCommandType = OracleXmlCommandType.Query;
    cmd.XmlQueryProperties.RootTag = "Result";
    cmd.XmlQueryProperties.RowTag = "Row";
    if (cmd.Connection.State != ConnectionState.Open) cmd.Connection.Open();
    XmlReader retval = null;
    //create the DataAdapter & DataSet
    retval = cmd.ExecuteXmlReader();
    // detach the OracleParameters from the command object, so they can be used again.
    cmd.Parameters.Clear();
    return retval;
    The stored proc is:
    CREATE OR REPLACE package GJUTRAS.test_TestPackage AS
    type sregions is REF CURSOR;
    procedure test_GetRegions_sp
    selectedregions out sregions
    procedure test_GetRegByDescrip_sp
    descript in varchar2,
    selectedregions out sregions
    end test_TestPackage;
    CREATE OR REPLACE package body GJUTRAS.test_TestPackage AS
    procedure test_GetRegions_sp
    selectedregions out sregions
    is
    begin
    open selectedregions for
    select * from ods.region;
    end test_GetRegions_sp;
    procedure test_GetRegByDescrip_sp
    descript in varchar2,
    selectedregions out sregions
    is
    begin
    open selectedregions for
    select * from ods.region where description = descript;
    end test_GetRegByDescrip_sp;
    end test_TestPackage;
    /

    The versions of the function that use text "select * from ods.region" work fine. It's using a stored procedure with ExecuteXmlReader that I can't seem to get working. The table is
    CREATE TABLE REGION (
    ID NUMBER(10) NOT NULL,
    CODE VARCHAR2(100 BYTE),
    ABBREV VARCHAR2(100 BYTE),
    NAME VARCHAR2(500 BYTE),
    EXTRA_FIELDS_ID NUMBER(10) NOT NULL,
    ACTIVE_FLAG VARCHAR2(1 BYTE) NOT NULL,
    DESCRIPTION VARCHAR2(4000 BYTE),
    COMMENTS VARCHAR2(4000 BYTE),
    KEYWORDS VARCHAR2(4000 BYTE),
    CHNG_REASON_TYPE_ID NUMBER(10),
    CHNG_REASON_CMNT VARCHAR2(4000 BYTE),
    BEG_DATE DATE NOT NULL,
    BEG_USER_ID NUMBER(10) NOT NULL,
    CREATOR_ID NUMBER(10) NOT NULL,
    CREATION_DATE DATE NOT NULL )

  • Need help with "ORA-00902: invalid datatype"  while creating a view

    I am using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options.....
    when I try ti create a view, I am getting ORA-00902 error.
    SQL> create view sales_view as
    2 select *
    3 from table(OLAP_TABLE('global DURATION session',
    4 'sales_type_table',
    5 '',
    6 'DIMENSION time_id FROM time
    7 DIMENSION channel_id FROM channel
    8 DIMENSION product_id FROM product
    9 DIMENSION customer_id FROM customer
    10 MEASURE sales FROM sales
    11 MEASURE units FROM units
    12 MEASURE extended_cost FROM extended_cost
    13 MEASURE forecast_sales FROM fcast_sales
    14 ROW2CELL olap_calc'));
    create view sales_view as
    ERROR at line 1:
    ORA-00902: invalid datatype
    ORA-06512: at "SYS.OLAPIMPL_T", line 23
    ORA-06512: at "SYS.OLAPIMPL_T", line 17
    ORA-06512: at line 4
    I am new to Oracle.... using document "40261_leveragingtools.pdf" as a guide against a cube created using "Global_AWM10g_Handson.doc".
    AWM displays data from cube without a problem.
    I would welcome any assistance.

    Can you provide the definition of sales_type_table? Also, Are all of the dimensions you have created of type TEXT?
    Swapan.

  • Help With Ora-19046:Out-of-line table cannot be shared by two top-level tab

    Hi!
    My tutor asked me to store and query the xml files in a "native" way in xml db. First I tried to register the schemas on which those xml files are based. There are about 30 of schemas asscociated with each other, and I have to use "FORCE" to register them , like this:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    'http://www.isotc211.org/gmd/metadataEntity.xsd',
    bfilename('ISOGMD', 'metadataEntity.xsd'),
    TRUE,
    TRUE,
    FALSE,
    TRUE,
    TRUE);
    END;
    Then no tables are created automaticly. And when I wanted to create a XML table based on thses schemas manually, it proped the error: ORA-19046:Out-of-line table cannot be shared by two top-level tab. This has confused me for about a week. Does anyone know what's wrong with the registration? Waiting eagerly on line! Thanks!

    First of all, i create a "filename.txt" that contains all my schemas' names. the names are:
    acquisitionInformation.xsd
    applicationSchema.xsd
    basicTypes.xsd
    catalogues.xsd
    citation.xsd
    codelistItem.xsd
    constraints.xsd
    temporalTopology.xsd
    topology.xsd
    units.xsd
    uomItem.xsd
    valueObjects.xsd
    xlinks.xsd
    there are 72 schemas. Then I register them using "force":
    GRANT EXECUTE ON utl_file to fld;
    create table test (
    fld1 VARCHAR2(50));
    declare
    isto_file utl_file.file_type;
    fp_buffer varchar2(4000);
    begin
    isto_file := utl_file.fopen('MYXMLDIR', 'filename.txt', 'R');
    loop
    begin
    utl_file.get_line (isto_file , fp_buffer );
    insert into test values(fp_buffer);
    Exception
    when no_data_found then
    exit;
    end;
    end loop;
    utl_file.fclose(isto_file);
    end;
    declare
    cursor my_cursor is select fld1 from test;
    v_name varchar2(50);
    begin
    open my_cursor;
    loop
    fetch my_cursor into v_name;
    dbms_xmlschema.registerSchema(
    schemaurl=>v_name,
    schemadoc=>bfilename('MYXMLDIR',v_name),
    local=>TRUE,
    gentables=>true,
    force=>true,
    csid=>nls_charset_id('AL32UTF8')
    exit when my_cursor%NOTFOUND;
    end loop;
    close my_cursor;
    end;
    at last, when I check the types generated during registration, I found that only a small number of types are automatically generated. When I try to create table manually ( based on certain element of one schema), it props errors, sometimes "31079. 00000 - "unable to resolve reference to %s \"%s\"" ", sometimes other errors.
    If I manually register them one by one from the base schema, then the registeration fail at some point. this is the script:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    'geometryAggregates.xsd',
    bfilename('XSD', 'geometryAggregates.xsd'),
    TRUE,
    TRUE,
    FALSE,
    TRUE);
    END;
    ERRORS
    22881. 00000 - "dangling REF"
    Is that something wrong with my schemas? I wonder how can i paste them here. there are 72 files.......

  • Need help with ORA-00936: missing expression

    11.2.0.3
    desc killsessionlog
    Name                                                  Null?    Type
    KILLTIME                                              NOT NULL DATE
    USERNAME                                              NOT NULL VARCHAR2(30)
    SID                                                   NOT NULL NUMBER
    SERIAL#                                               NOT NULL NUMBER
    CTIME                                                 NOT NULL NUMBER
    MACHINE                                                        VARCHAR2(64)
    TERMINAL                                                       VARCHAR2(30)
    PROGRAM                                                        VARCHAR2(48)
    ACTION                                                         VARCHAR2(64)
    MODULE                                                         VARCHAR2(64)want to test the code to kill the blocker
    SQL> create or replace procedure killblocker
      2  is
      3  stmt varchar2(1000);
      4  cursor c1 is
      5  select  s1.SQL_EXEC_START+l1.ctime killtime, s1.username,s1.sid,s1.serial#,l1.ctime ,s1.machine
    ,s1.TERMINAL, s1.PROGRAM,s1.ACTION,s1.MODULE
      6      from v$lock l1, v$session s1, v$lock l2, v$session s2
      7      where s1.sid=l1.sid and s2.sid=l2.sid
      8      and l1.BLOCK=1 and l2.request > 0
      9      and l1.id1 = l2.id1
    10      and l2.id2 = l2.id2
    11      and l1.ctime >0;
    12  begin
    13  for i in c1 loop
    14  EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION ''' || i.sid || ',' || i.serial# || '''';
    15  stmt := 'insert into killsessionlog values ('||i.killtime||','|| i.username||','||i.sid||','||i
    .serial#||','||i.ctime||','||i.machine||','||i.TERMINAL||','|| i.PROGRAM||','||i.ACTION||','||i.MODU
    LE||')'
    16  ;
    17  EXECUTE IMMEDIATE stmt;
    18  dbms_output.put_line('SID '||i.sid ||' with serial# '||i.serial#||' was killed');
    19    END LOOP;
    20  END;
    21  /
    Procedure created.created the blocker and blocked sessions.
    SQL> exec killblocker
    BEGIN killblocker; END;
    ERROR at line 1:
    ORA-00936: missing expression
    ORA-06512: at "NN.KILLBLOCKER", line 17
    ORA-06512: at line 1the first EXECUTE IMMEDIATE for killing the session worked, but the 2nd EXECUTE IMMEDIATE for the insert failed as above. Not able to figure the problem.
    TIA

    SQL> create or replace procedure killblocker
      2  is
      3  stmt varchar2(1000);
      4  cursor c1 is
      5  select  s1.SQL_EXEC_START+l1.ctime killtime, s1.username,s1.sid,s1.serial#,l1.ctime ,s1.machine
    ,s1.TERMINAL, s1.PROGRAM,s1.ACTION,s1.MODULE
      6      from v$lock l1, v$session s1, v$lock l2, v$session s2
      7      where s1.sid=l1.sid and s2.sid=l2.sid
      8      and l1.BLOCK=1 and l2.request > 0
      9      and l1.id1 = l2.id1
    10      and l2.id2 = l2.id2
    11      and l1.ctime >0;
    12  begin
    13  for i in c1 loop
    14  EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION ''' || i.sid || ',' || i.serial# || '''';
    15  stmt := 'insert into killsessionlog values (:killtime, :username, :sid, :serial#, :ctime, :machine, :TERMINAL, :PROGRAM, :ACTION, :MODULE)'
    16  ;
    17  EXECUTE IMMEDIATE stmt using i.killtime, i.username, i.sid, i.serial#, i.ctime, i.machine, i.TERMINAL, i.PROGRAM, i.ACTION, i.MODULE;
    18  dbms_output.put_line('SID '||i.sid ||' with serial# '||i.serial#||' was killed');
    19    END LOOP;
    20  END;
    21  / Gerard

  • Please HELP with ORA-19809: limit exceeded for recovery files

    Hi Gurus,
    I am not a DBA but a developer. Today my Oracle database 11g on my PC will not open and I am getting the errors,
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    I checked my alert logs and found these errors,
    Errors in file c:\oracle\diag\rdbms\orcl\orcl\trace\orcl_ora_2144.trc:
    ORA-19809: limit exceeded for recovery files
    ORA-19804: cannot reclaim 41072128 bytes disk space from 4039114752 limit
    ARCH: Error 19809 Creating archive log file to 'C:\ORACLE\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2011_04_08\O1_MF_1_120_%U_.ARC'
    Errors in file c:\oracle\diag\rdbms\orcl\orcl\trace\orcl_ora_2144.trc:
    ORA-16038: log 3 sequence# 120 cannot be archived
    ORA-19809: limit exceeded for recovery files
    ORA-00312: online log 3 thread 1: 'C:\ORACLE\ORADATA\ORCL\REDO03.LOG'
    USER (ospid: 2144): terminating the instance due to error 16038
    Instance terminated by USER, pid = 2144
    So I started searching for answers on this forum and found a suggestion using RMAN to delete all the archive logs,
    RMAN> connect target sys/*******
    RMAN> delete archivelog all;
    RMAN>crosscheck archivelog all;
    But I get these errors in RMAN,
    using target database control file instead of recovery catalog
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of delete command at 04/08/2011 11:20:58
    RMAN-06403: could not obtain a fully authorized session
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    So, please help me: How do I fix this problem since I can't start the instance?
    Thank you.
    Ben

    You need to increase the FRA by changing the parameter DB_RECOVERY_FILE_DEST_SIZE. Create a parameter file while being connected as Sys user and issue,
    sql>create pfile from spfile;It would create the pfile in the Oracle_Home/database folder. Edit that file and increase the parameter to a larger size-like double of it's current value. Save the file and issue,
    sql>startup pfile=<your location of the file>HTH
    Aman....

  • I need help with ORA-07445

    Hi all!
    I was executing every day one workflow which contains some mappings. This worked fine but one day it started crashing. The error I get is:
    ERROR ORA-03113: end-of-file on communication channel
    We traced the session and we saw that it also produced this error:
    ORA-07445: exception encountered: core dump [slmecpy()+96] [SIGSEGV] [Address not mapped to object] [0x000000000] [] []
    Does anyone know what can be happening??
    Thanks in advance
    Edited by: Julius84 on 18-may-2010 3:55

    Thanks, but I had tried doing it. I had regenerated the mapping and it doesn´t work.
    I have read in internet that it's a bug, but i don't understand: i haven't changed anything.
    Thanks again

  • Need help with ora-hash function

    I am doing a insert operation..in the actual view i came up with this expression ORA_HASH(c.cpt_code_grp_dscrptn
    ||c.cpt_code_grp_id) AS bwrse_link_idntfr
    i was given to insert browse_link_idntfr value as 2910441270
    how to proceed with the insertion in the actual table for those two columns?

    964145 wrote:
    I am doing a insert operation..in the actual view i came up with this expression ORA_HASH(c.cpt_code_grp_dscrptn
    ||c.cpt_code_grp_id) AS bwrse_link_idntfr
    i was given to insert browse_link_idntfr value as 2910441270
    how to proceed with the insertion in the actual table for those two columns?HUH?
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • Need a help with  ORA-04030

    ORA-04030 out of process memory when trying to allocate string bytes (string,string)
    When host application tries to connect to Oracle, client received this error also there are about 200 MB free memory. This situation takes place every several hours, so I need stop and then start Oracle to solve the problem.
    Any suggestions?
    Oracle 8.1.7 , Windows NT 2000 Server pack2

    This error can be cause by the optimizer chewing up all available user memory to while trying to develop an execution plan for a very complex or large query. try setting your optimzier_max_permutations=5000 in your init.ora. If this works, then you may want to increase it later.

Maybe you are looking for

  • Cannot send email to subdomain

    iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004) libimta.so 5.2 Patch 2 (built 19:30:12, Jul 14 2004) SunOS stud.usm.my 5.9 Generic_117171-17 sun4u sparc SUNW,Sun-Fire-V240 We have a domain xxx.com and a subdomain stud.xxx.com...the first dom

  • Error while calling sub template in XML Publisher

    Hi friends, For the Header part of my report,I create a sub template and i am trying to call it. I am calling the sub template using the following commands:- <?call@inlines:Header?> <?end call?> Then in the body ,I am importing this file using <?impo

  • Change Screen Resolution or not Change Screen Resolution?

    I mean is it possible to change screen resolution with Java? I read some topics (not in this forum) that is impossible. I know there is a method to set at full screen a frame with the favourite resolution but does it effectively exist a method to set

  • Create generic component to handle errors after using the function modules

    Hi, Please provide steps to create a generic component to handle the BAPI Return structure meesages after the function calls.. Please let me know how to pass the structure or internal table from one component to other. Thanks in Advance, SV Moderator

  • Connect BSO cube through EPMA

    Hi All, I have a requirement to deploy a BSO cube from EPMA. I already have this particular cube in EAS and now I need to connect it through EPMA so that we can update members among multiple apps at a time and deploy them instead of manually updating