PL/SQL: ORA-00947

Hi,
I have a package body as given below
CREATE OR REPLACE PACKAGE BODY DF AS
    FUNCTION T24_GetCOPYBatchKeyAndDate(RECKEY VARCHAR2)
        RETURN RTNVAL
        IS
        RTNVAL1 RTNVAL; 
        DELPOS    INTEGER;
        LISTSTRING VARCHAR2(4000);
    BEGIN
        SELECT XMLRECORD INTO LISTSTRING FROM V_F_RO_COPY_KEYLIST WHERE RECID = RECKEY;
        LISTSTRING := TRIM(LISTSTRING);
        WHILE LENGTH(LISTSTRING) <> 0
        LOOP
          DELPOS := INSTR(LISTSTRING, ' ');
          IF DELPOS = 0 THEN
             DELPOS := LENGTH(LISTSTRING) + 1;
          END IF;
    --SELECT SUBSTR(LISTSTRING, 9, DELPOS - 9) INTO RTNVAL FROM DUAL;
    SELECT TO_DATE(SUBSTR(LISTSTRING, 1, 8),'YYYYMMDD'), SUBSTR(LISTSTRING, 9, DELPOS - 9) INTO RTNVAL1 FROM DUAL;
          LISTSTRING := SUBSTR(LISTSTRING, DELPOS+1, LENGTH(LISTSTRING)-DELPOS);
        END LOOP;
        RETURN(RTNVAL1);
    END T24_GetCOPYBatchKeyAndDate;
END DF;
but i get compilation errors below is the error can anyone let me know whats the exact problem here and earlier i used this fucntion as PIPILINED and PIPE_ROW(RTNVAL).
It was working fine now i wanted to test this without pipeline fucntion.
SQL> SHOW ERRORS;
LINE/COL ERROR
19/5     PL/SQL: SQL Statement ignored
19/105   PL/SQL: ORA-00947: not enough values
SQL>

Now...if you do a BULK inside the loop, then the collection get's overwritten every loop iteration.
So going back to the original post
replacing
WHILE LENGTH(LISTSTRING) <> 0
LOOP
DELPOS := INSTR(LISTSTRING, ' ');
   IF DELPOS = 0 THEN
      DELPOS := LENGTH(LISTSTRING) + 1;
   END IF;
   SELECT TO_DATE(SUBSTR(LISTSTRING, 1, 8),'YYYYMMDD'), SUBSTR(LISTSTRING, 9, DELPOS - 9)) INTO RTNVAL1 FROM DUAL;
   LISTSTRING := SUBSTR(LISTSTRING, DELPOS+1, LENGTH(LISTSTRING)-DELPOS);
END LOOP;
with
WHILE LENGTH(LISTSTRING) <> 0
LOOP
DELPOS := INSTR(LISTSTRING, ' ');
   IF DELPOS = 0 THEN
      DELPOS := LENGTH(LISTSTRING) + 1;
   END IF;
   RTNVAL1.EXTEND();
    RTNVAL1(RTNVAL1.COUNT()) := DATEKEYPAIR(TO_DATE(SUBSTR(LISTSTRING, 1, 8),'YYYYMMDD')
                                                                         , SUBSTR(LISTSTRING, 9, DELPOS - 9));
   LISTSTRING := SUBSTR(LISTSTRING, DELPOS+1, LENGTH(LISTSTRING)-DELPOS);
END LOOP;
should help
hth

Similar Messages

  • ERROR in PROCEDURE  PL/SQL: ORA-00947: not enough values

    Hi all i am creating a Procedure in which i am getting very strange ERROR
    h4. i am using Oralce 11g, SQL Developer 3
    my scenario is :
    CREATE SEQUENCE tt_TMPMEASURESOURCE_ID
    START WITH 1
    INCREMENT BY 1;
    CREATE TABLE tt_TMPMEASURESOURCE
    ID NUMBER(10,0) ,
    OBJNAME VARCHAR2(200) ,
    PRSP NUMBER(10,0) ,
    SOURCEID NUMBER(10,0) ,
    SOURCENAME VARCHAR2(100) ,
    FIX NUMBER(3,0) ,
    MNAME VARCHAR2(1000) ,
    MDESC VARCHAR2(1000)
    CREATE OR REPLACE TRIGGER tt_TMPMEASURESOURCE_ID_TRG
    BEFORE INSERT
    ON tt_TMPMEASURESOURCE
    FOR EACH ROW
    BEGIN
    SELECT tt_TMPMEASURESOURCE_ID.NEXTVAL INTO :NEW.ID
    FROM DUAL;
    END;
    INSERT INTO TT_TMPMEASURESOURCE
    *(OBJNAME,PRSP,SOURCEID,SOURCENAME,FIX,MNAME,MDESC)*
    values ('rajnish',43,54,'anish',4,'apple','kumar');
    output :
    +1 row inserted+
    h4. select * from TT_TMPMEASURESOURCE;
    h3. 1     rajnish     43     54     anish     4     apple     kumar
    creating and compiling Procedure
    create or replace procedure tem_test
    as
    begin
    INSERT INTO tt_TmpMeasureSource
    *(OBJNAME,PRSP,SOURCEID,SOURCENAME,FIX,MNAME,MDESC)*
    VALUES ( v_ObjName, v_PrespectiveID, v_SourceID, v_SourceName, v_FIX, v_MName, v_MDesc );
    when compiling
    Error(63,16): PL/SQL: SQL Statement ignored
    Error(63,28): PL/SQL: ORA-00947: not enough values
    i am do not understand that when Trigger A trigger is allready there for 1st column
    then why its giving me this error?
    please help me out
    thanks

    i got my solutions
    creating and compiling Procedure
    create or replace procedure tem_test
    as
    begin
    INSERT INTO tt_TmpMeasureSource
    *(OBJNAME,PRSP,SOURCEID,SOURCENAME,FIX,MNAME,MDESC)*
    VALUES ( v_ObjName, v_PrespectiveID, v_SourceID, v_SourceName, v_FIX, v_MName, v_MDesc );
    it was a typography mistake
    this line was missing in Original procedure
    *(OBJNAME,PRSP,SOURCEID,SOURCENAME,FIX,MNAME,MDESC)*thanks

  • DataExport problem-ODBC Layer Error: [21S01]-ORA-00947

    Hi,
    I have one planning application from which I want to transfer data to Oracle DB in the table "t". I have 11 dimension in the planning application, so I have created 12 columns in the table "t"(11 for dimension-members and 1 col for value) with the following script---
    create table t (
    a varchar2(100),
    b varchar2(100),
    c varchar2(100),
         d varchar2(100),
         e varchar2(100),
    f varchar2(100),
         g varchar2(100),
         h varchar2(100),
    i varchar2(100),
    j varchar2(100),
         k varchar2(100),
         l number)
    I have created a wire protocol dsn. But when I execute the following calcscript ---
    fix (jan,budget,fy08)
    DATAEXPORT "DSN" "xz" "t" "tstschma" "password" ;
    ENDFIX
    then it is showing error below---
    [Mon Jul 13 00:04:10 2009]Local/essdb/Plan1/admin/Info(1021000)
    Connection With SQL Database Server is Established
    [Mon Jul 13 00:04:10 2009]Local/essdb/Plan1/admin/Info(1012695)
    DataExport can not do batch insert to relational table. The ODBC driver and/or RDBMS doesn't support batch insert. Using record by record SQL export
    [Mon Jul 13 00:04:10 2009]Local/essdb/Plan1/admin/Info(1021013)
    ODBC Layer Error: [21S01] ==> [[DataDirect][ODBC Oracle Wire Protocol driver][Oracle]ORA-00947: not enough values]
    [Mon Jul 13 00:04:10 2009]Local/essdb/Plan1/admin/Info(1021014)
    ODBC Layer Error: Native Error code [947]
    [Mon Jul 13 00:04:10 2009]Local/essdb/Plan1/admin/Error(1012085)
    Unable to export data to SQL table [t]. Check the Essbase server log and the system console to determine the cause of the problem.
    [Mon Jul 13 00:04:10 2009]Local/essdb/Plan1/admin/Info(1021002)
    SQL Connection is Freed
    [Mon Jul 13 00:04:10 2009]Local/essdb/Plan1/admin/Warning(1080014)
    Transaction [ 0x920001( 0x4a5a097a.0x7918 ) ] aborted due to status [1012085].
    [Mon Jul 13 00:04:10 2009]Local/essdb/Plan1/admin/Info(1012579)
    Total Calc Elapsed Time for [datexprt.csc] : [0.062] seconds
    [Mon Jul 13 00:04:10 2009]Local/essdb/Plan1/admin/Info(1013274)
    Calculation executed
    Please guide me if I am doing anything wrong...
    Thanks & Regards.

    Hi,
    It all depends on you dense dimension being used in your export, it will use a column for each member.
    For example if the dense dimension on the export was period and you were doing a level 0 export (level0 members of time are Jan:Dec)
    Then there would need to be a column for each dimension and 12 columns for each of the periods (Jan:Dec)
    The best way to work it out is to export to a file first in column format and you will see how the table needs to look.
    The columns have to exactly match the data being exported.
    Take a look at this post, it something you may experience as well :- Re: DATAEXPORT command- Periods in the columns when sparse
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • ORA-00947 Error on straight SELECT with INNER JOINs

    I have a REAL bizarre situation. I have a SQL SELECT Statement that is joining a few tables. I actually have a WHERE clause where I am filtering by a coulmn within one of the joins. However, if I try to SELECT that coulmn, I am getting an Oracle error ORA-00947. I can even SELECT * and get ALL the columns back form ALL the tables I'm joing on, including the one that is not allowing me just to select it.
    Has anyone ever seen anything like this before???
    I appreciate your review and am hopeful for a reply.
    Thanks.
    PSULionRP

    Jez....Not sure if I need to worry about proprietary stuff here...Here's the SQL and the column I'm trying to select is CDM_SUPPLIER_UTILITY.SUPPLIER_CD.
    When I do that is when I get the ORA-00947 error. And our version is...
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    SELECT CDM_CALENDAR.CALENDAR_DT,
    CDM_OFFER.SUPPLIER_NAME,
    CDM_SUPPLIER_UTILITY.SUPPLIER_CD,
    ABS(SUM(CDM_MONEY.TRANSACTION_AMT))
    FROM CDEDM.CDM_TRANSACTIONS CDM_TRANSACTIONS
    INNER JOIN CDEDM.CDM_MONEY CDM_MONEY
    ON CDM_MONEY.TRANSACTION_FK = CDM_TRANSACTIONS.TRANSACTION_GK_PK
    INNER JOIN CDEDM.CDM_OFFER CDM_OFFER
    ON CDM_OFFER.OFFER_GK_PK = CDM_MONEY.OFFER_FK
    INNER JOIN CDEDM.CDM_CALENDAR CDM_CALENDAR
    ON CDM_CALENDAR.CALENDAR_DT_PK = CDM_MONEY.TRANSACTION_DT_FK
    INNER JOIN CDEDM.CDM_BILL_ACCOUNTS CDM_BILL_ACCOUNTS
    ON CDM_BILL_ACCOUNTS.BILL_ACCT_GK_PK = CDM_MONEY.BILL_ACCOUNTS_FK
    INNER JOIN CDEDM.CDM_SUPPLIER_UTILITY CDM_SUPPLIER_UTILITY
    ON CDM_SUPPLIER_UTILITY.SUPPLIER_UTILITY_GK_PK = CDM_BILL_ACCOUNTS.SUPPLIER_FK
    WHERE CDM_SUPPLIER_UTILITY.SUPPLIER_CD = 'MC2'
    AND CDM_CALENDAR.CALENDAR_DT BETWEEN NEXT_DAY(trunc(SYSDATE-12),'Saturday')
    AND NEXT_DAY(trunc(SYSDATE-5),'Saturday')
    AND CDM_TRANSACTIONS.TRAN_DECODE IN
    'Debit/Bill Installment Billing',
    'Debit/Bill Electric Service',
    'Debit by Transfer of Payment TO Uncollec',
    'Debit Miscellaneous Electric',
    'Credit for Transfer TO Uncollectible',
    'Credit for Tranfer FROM Uncollectible',
    'Credit Miscellaneous Electric',
    'Credit Alteration',
    'Credit Allowance',
    'Bill Consumption On An Inactive Meter'
    AND CDM_MONEY.TRANSACTION_LEVEL_CD IN
    'A',
    GROUP BY CDM_CALENDAR.CALENDAR_DT,
    CDM_OFFER.SUPPLIER_NAME,
    CDM_SUPPLIER_UTILITY.SUPPLIER_CD

  • Strange ORA-00947

    Hello all,
    I have a query in a stored procedure as follows:
    select min(ref.REFERENCE_V_INNER_CODE) INNER_CODE, item.COMPONENT_V_ID bulk collect into highest_quality_table
    from T_ITEM item, T_REFERENCE ref
    where (item.ITEM_V_CODE, item.COMPONENT_V_ID) in
    ( select ... )
    and item.ITEM_V_QUALITY_LEVEL=ref.REFERENCE_V_CODE_NAME
    group by item.COMPONENT_V_ID
    It's compiling successfully if I use a locally defined type for highest_quality_table:
    TYPE highest_quality_row_type IS RECORD ( INNER_CODE T_REFERENCE.REFERENCE_V_INNER_CODE%TYPE, COMPONENT_V_ID T_COMPONENT.COMPONENT_V_ID%TYPE );
    TYPE highest_quality_table_type IS TABLE OF highest_quality_row_type;
    highest_quality_table highest_quality_table_type;
    But then I tried to define such type on the level of schema:
    create or replace type highest_quality_row_type as object ( INNER_CODE NVARCHAR2(20), COMPONENT_V_ID NVARCHAR2(8) )
    create or replace type highest_quality_table_type as table of highest_quality_row_type
    After that the query fails to compile with the strange ORA-00947 (not enough values).
    Any idea why could it happen ?
    Edited by: 850271 on 06-Apr-2011 06:55

    Because RECORD != OBJECT. If you bulk collect into table of objects your SQL must select object of that type. Change select to:
    select  highest_quality_row_type(min(ref.REFERENCE_V_INNER_CODE),item.COMPONENT_V_ID)
      bulk collect
      into highest_quality_table
      from  T_ITEM item,
            T_REFERENCE ref
      where (item.ITEM_V_CODE,item.COMPONENT_V_ID) in ( select ... )
        and item.ITEM_V_QUALITY_LEVEL=ref.REFERENCE_V_CODE_NAME
        group by item.COMPONENT_V_ID
    /SY.

  • PL/SQL :ORA-04052 with Database link

    i have created a database link in my producation database as following
    CREATE PUBLIC DATABASE LINK <NAME>
    CONNECT TO <USER>
    IDENTIFIED BY <P/W>
    USING <CONNECT STRING OF TARGET DATABASE
    oracle version 9.0.2.8
    OS : Windows 2003 EE R2 SP2
    Using oracle failsafe 3.3.4 with windows cluster
    Problem Description :
    whenever i run my pl/sql procecdure to pull the data from the target database i get the following error
    ERROR at line 3
    ORA-06550:line 3 column 2
    PL/SQL : ORA-04052: error occured when looking up remote object _<SCHEMA>.<TABLE>@<DATABASE LINKE NAME>_
    ORA-00604 : ERROR occured at recursive SQL level 1
    ORA-03106 : fatal tow-task communication protocol error
    ORA-02063: preceding line from <DATABASE LINK NAME>
    I have tested the same way in the test environment the same oracle version as well the OS but without oracle failsafe and windows cluster
    the script goes smoothly with out any errors.
    i have google and checked the OTN for all available solutions but still nothing its not getting throw
    i will be very thankful for your replys and solutions
    any farther clarification i am ready
    thanks in advance

    Hi,
    This forum is for issues connecting to non-Oracle databases. As the problem is using PL/SQL to connect to another Oracle database then it would be better to post a thread in the PL/SQL forum -
    PL/SQL
    If you are trying to connect to a non-Oracle database then please give us the details of which non-Oracle database and the software you are trying to use to connect.
    Regards,
    Mike

  • PL/SQL: ORA-22806: not an object or REF  when Using Record in Package

    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
    I have declared a record type in my package
    create or replace
    PACKAGE MYPKG AS
      TYPE MYREC IS RECORD (VAL1 varchar2(20), val2 date);
      PROCEDURE display_error (pSQLERRM number);
      PROCEDURE P_LOAD_DATA (pStartDate Date, pEndDate Date);
      FUNCTION  F_EPI(refno1 in NUMBER,  refno2 in NUMBER) return MYREC;
    END MYPKG;
    --In My Package Body
    FUNCTION  F_EPI(refno1 in NUMBER,  refno2 in NUMBER) return MYREC is
            F_param MYREC;
            BEGIN
            select myvarchar2, mydate into MYREC from MYTable
              where myrefno1 = refno1
              and myrefno2 = refno2
            Exception
              when others then
              display_error(SQLERRM);
              RETURN F_param;
            END F_EPI ;
      PROCEDURE P_LOAD_DATA (pStartDate Date, pEndDate Date) IS
    insert into atable(myvarchar, mydate)
    select F_EPI(refno1,refno2).val1,F_EPI(refno1,refno2).val2 from tab2;
    END P_LOAD_DATA;
    I get errors
    Error(187,7): PL/SQL: SQL Statement ignored
    Error(225,7): PLS-00382: expression is of wrong type
    Error(225,7): PL/SQL: ORA-22806: not an object or REF
    When I compile the package.
    When I try to call the function from SQL I get an Invalid datatype error.

    Hi,
    Before posting any query/plsql blocks, please ensure that you have written it clean and complete with less syntax errors. ( at least general syntax errors, you can avoid). Then somebody can have an interest to check your logical error.
    About your posting, refer below solution step-by-step. It may help you, about what you are looking for? By the way, you must be knowing, what you are going to to do with. I haven't concentrated about your requirement; as it was not missing in your posting.
    drop table test;
    create table test(myvarchar varchar2(20), mydate date);
    create or replace
        package mypkg as
          type myrec is record (val1 varchar2(20), val2 date);
          --procedure display_error (psqlerrm in number); -- if you are passing sqlerrm, then parameter needs to be string type
       procedure display_error (psqlerrm in varchar2);
          procedure p_load_data (pstartdate in date, penddate in date);
          function  f_epi(refno1 in number,  refno2 in number) return myrec;
       end mypkg;
    Package created.
    --in my package body
    create or replace 
    package body mypkg as -- added
    procedure display_error (psqlerrm in varchar2) -- if you are declared a proc/func in spec, it needs to define in pkg body
    is
    begin
         null; -- you should know, what to do here
      dbms_output.put_line('Err -'||sqlerrm);
    end display_error;
    function  f_epi(refno1 in number,refno2 in number)
    return myrec
    is
    f_param myrec;
    begin
       -- select myvarchar2, mydate into MYREC from mytable
      --  where myrefno1 = refno1
      --  and myrefno2 = refno2;
        select ename, hiredate into f_param from emp -- added demo logic by using emp
        where empno = refno1
         and  mgr  = refno2;
        return f_param;  -- added
    exception
       when others then
         raise; -- if you are using OTHERS then, just raise it
       display_error(sqlerrm);  
       --return f_param; -- what is this?
    end f_epi;
    procedure p_load_data (pstartdate in date, penddate in date) -- you must be knowing the use of 2 params ???
    is
        v_rec myrec; -- added
    begin -- Added
       --insert into atable(myvarchar, mydate)
      -- select f_epi(refno1,refno2).val1,f_epi(refno1,refno2).val1 from tab2;
       -- demo logic added with static params to call f_epi
       v_rec:= f_epi(7499,7698);
       insert into test values v_rec;
        --null; 
    end p_load_data;
    end mypkg;
    Package body created.
    SQL> exec mypkg.p_load_data(null,null);
    PL/SQL procedure successfully completed.
    SQL> select * from test;
    MYVARCHAR            MYDATE
    ALLEN                20-FEB-81
    Thanks!

  • PL/SQL: ORA-00984: column not allowed here

    I am Trying to compile this procedure, but i get error, could please anybody help me out.
    Thanks.
    SQL> create or replace procedure FOF_sport_setup(
    2 v_model_cd in varchar2, -- model_cd used in many place
    3 v_portfolio_name in varchar2, -- portfolio name
    4 v_src_acct_nbr in varchar2, -- source account number for port
    5 v_src_fund_nbr in varchar2, -- source fund number
    6 v_fmr_fund_nbr in varchar2, -- fidelity fund number
    7 v_src_cd in varchar2, -- source code
    8 v_last_mod_id in varchar2 -- your corp id
    9 )
    10 as
    11 v_new_portf_id number(12);
    12
    13 begin
    14
    15 select max(portf_id) into v_new_portf_id from portfolios;
    16
    17 insert into portfolios
    18 (portf_id,
    19 portf_cd,
    20 portf_name,
    21 portf_typ_cd,
    22 inception_date,
    23 sub_product_cd,
    24 product_cd,
    25 product_line_cd,
    26 bus_line_cd,
    27 dly_perf_restr_ind,
    28 portf_mgr_id,
    29 seed_acct_nbr,
    30 use_epas_ind,
    31 epas_drop_perf_ind,
    32 src_acct_nbr,
    33 src_fund_nbr,
    34 fmr_fund_nbr,
    35 src_cd,
    36 last_mod_id,
    37 last_mod_dt)
    38 values
    39 (new_portf_id,
    40 v_model_cd,
    41 v_portfolio_name,
    42 "RETAIL",
    43 v_inception_date,
    44 "FREE",
    45 "FREE",
    46 "FREE",
    47 "PAS",
    48 "Yes",
    49 3,
    50 "31635C101",
    51 "N",
    52 "Y",
    53 v_src_acct_nbr,
    54 v_src_fund_nbr,
    55 v_fmr_fund_nbr,
    56 v_src_cd,
    57 v_last_mod_id,
    58 sysdate);
    59
    60 end;
    61 /
    Warning: Procedure created with compilation errors.
    SQL> show errors procedure FOF_sport_setup
    Errors for PROCEDURE FOF_SPORT_SETUP:
    LINE/COL ERROR
    17/2 PL/SQL: SQL Statement ignored
    51/3 PL/SQL: ORA-00984: column not allowed here
    SQL>

    create or replace procedure FOF_sport_setup(
    v_model_cd in varchar2, -- model_cd used in many places for portf_id,
    v_portfolio_name in varchar2, -- portfolio name
    v_inception_date in varchar2,
    v_src_acct_nbr in varchar2, -- source account number for portfolio table in sport db
    v_src_fund_nbr in varchar2, -- source fund number
    v_fmr_fund_nbr in varchar2, -- fidelity fund number
    v_src_cd in varchar2, -- source code
    v_last_mod_id in varchar2 -- your corp id
    as
    v_new_portf_id number(12);
    begin
    select max(portf_id) into v_new_portf_id from portfolios;
    insert into portfolios
    (portf_id,
    portf_cd,
    portf_name,
    portf_typ_cd,
    inception_date,
    sub_product_cd,
    product_cd,
    product_line_cd,
    bus_line_cd,
    dly_perf_restr_ind,
    portf_mgr_id,
    seed_acct_nbr,
    use_epas_ind,
    epas_drop_perf_ind,
    src_acct_nbr,
    src_fund_nbr,
    fmr_fund_nbr,
    src_cd,
    last_mod_id,
    last_mod_dt)
    values
    (v_new_portf_id,
    v_model_cd,
    v_portfolio_name,
    'RETAIL',
    to_date('v_inception_date'),
    'FREE',
    'FREE',
    'FREE',
    'PAS',
    'Yes',
    3,
    '31635C101',
    'N',
    'Y',
    v_src_acct_nbr,
    v_src_fund_nbr,
    v_fmr_fund_nbr,
    v_src_cd,
    v_last_mod_id,
    sysdate);
    end;
    =====================
    The procedure got created without any errors, when i am trying to execute the procedure i am getting errors.
    this is the parameters which i am passing:
    exec FOF_sport_setup('01213', 'PAS International Fund of Funds', '2/15/2006', '01213', 'IFOFB', 'IFOFB', 'FPCMS', 'a382077')
    SQL> exec FOF_sport_setup('01213', 'PAS International Fund of Funds', '2/15/2006', '01213', 'IFOFB',
    'IFOFB', 'FPCMS', 'a382077')
    BEGIN FOF_sport_setup('01213', 'PAS International Fund of Funds', '2/15/2006', '01213', 'IFOFB', 'IF
    ERROR at line 1:
    ORA-01858: a non-numeric character was found where a numeric was expected
    ORA-06512: at "SPORT.FOF_SPORT_SETUP", line 15
    ORA-06512: at line 1
    ===============
    the description for the table is below
    ===========
    SQL> desc portfolios
    Name Null? Type
    PORTF_ID NOT NULL NUMBER(25)
    PORTF_CD VARCHAR2(10)
    PORTF_NAME VARCHAR2(60)
    STRATEGY_CD VARCHAR2(10)
    CO_STOCK_LEV_CD VARCHAR2(10)
    EFF_DATE DATE
    PORTF_WEB_NAME VARCHAR2(60)
    PORTF_TYP_CD VARCHAR2(10)
    INCEPTION_DATE DATE
    CLOSE_DATE DATE
    SUB_PRODUCT_CD VARCHAR2(10)
    PRODUCT_CD VARCHAR2(10)
    PRODUCT_LINE_CD VARCHAR2(10)
    BUS_LINE_CD VARCHAR2(10)
    BUS_GRP_CD VARCHAR2(10)
    PLAN_CD VARCHAR2(10)
    ADVISOR_CD VARCHAR2(10)
    RISK_LEVEL_CD VARCHAR2(10)
    DLY_PERF_RESTR_IND VARCHAR2(3)
    SUB_PORTF_IND CHAR(1)
    PORTF_MGR_ID NUMBER(25)
    SEED_ACCT_NBR VARCHAR2(9)
    OBJECTIVE VARCHAR2(255)
    PORTF_COMPOSITION_DESC VARCHAR2(50)
    LGL_GRP VARCHAR2(30)
    USE_EPAS_IND VARCHAR2(3)
    EPAS_MODEL_NAME VARCHAR2(50)
    EPAS_DROP_PERF_IND VARCHAR2(3)
    SRC_ACCT_NBR VARCHAR2(15)
    SRC_FUND_NBR VARCHAR2(6)
    FMR_FUND_NBR VARCHAR2(6)
    NET_ASSETS NUMBER(25,8)
    SEED_MKT_VAL NUMBER(25,10)
    ACCT_MKT_VAL NUMBER(25,10)
    TOTAL_ASSETS NUMBER(25,10)
    NET_OTHER_ASSETS NUMBER(25,8)
    ACCRUED_INCOME NUMBER(25,10)
    ACCRUED_INTEREST NUMBER
    LIABILITIES NUMBER(25,10)
    SHARES_OUTSTANDING NUMBER(25,10)
    PRINCIPAL_CASH NUMBER(25,10)
    INCOME_CASH NUMBER(25,10)
    INVESTIBLE_CASH NUMBER(25,10)
    SHIP_DATE DATE
    REBALANCE_IND CHAR(1)
    OUTBOUND_IND VARCHAR2(5)
    LGL_MSG_CD CHAR(1)
    LAST_SETTLE_DATE DATE
    LAST_TRD_DATE DATE
    LAST_ALLOC_DATE DATE
    STATUS_CD CHAR(1)
    SRC_CD NOT NULL VARCHAR2(5)
    LAST_MOD_ID NOT NULL VARCHAR2(10)
    LAST_MOD_DT NOT NULL DATE
    PORTF_MGD_CD VARCHAR2(10)
    ==========

  • PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got NUMBER

    Hi all,
    Wondering if you could assist? I'm exploring User Types and having a small problem. I'm getting the above error for a user type I have created which I'm calling in a function. Here's what my code looks like which I'm running the 'scott' schema for testing purposes
    SQL> CREATE OR REPLACE TYPE NBR_COLL AS TABLE OF NUMBER;
    2 /
    Type created.
    SQL> create or replace FUNCTION first_rec_only
    2 (
    3 NUM_ID IN NUMBER
    4 ) RETURN NUMBER IS
    5 v_num NBR_COLL;
    6 BEGIN
    7 select deptno into v_num from dept;
    8 RETURN v_num(v_num.FIRST);
    9 END first_rec_only;
    10 /
    Warning: Function created with compilation errors.
    SQL> show errors
    Errors for FUNCTION FIRST_REC_ONLY:
    LINE/COL ERROR
    7/4 PL/SQL: SQL Statement ignored
    7/11 PL/SQL: ORA-00932: inconsistent datatypes: expected UDT got
    NUMBER
    SQL>
    Any clues to what I'm doing wrong? Cheers.

    The deptno column is a number, you cannot directly select a number into your type, you need to use your type's constructor.
    Something like:
    CREATE OR REPLACE FUNCTION first_rec_only (NUM_ID IN NUMBER) RETURN NUMBER IS
       v_num NBR_COLL;
    BEGIN
       SELECT nbr_coll(deptno) INTO v_num from dept;
       RETURN v_num(v_num.FIRST);
    END first_rec_only;Note that although this will compile, it will throw ORA-01422: exact fetch returns more than requested number of rows when you run it. you need to either use the input parameter as a predicate on your query against dept, use rownum = 1 in the query or use bulk BULK COLLECT INTO, depending on what exactly you want to accomplish.
    John

  • PL/SQL ORA-00936 missing expression

    Hello all,
    I'm having an issues and need help with this script... Please help, thanks.
    error:
    ====
    31 32 /
    AST_UPDATED_BY,LAST_UPDATE_LOGIN) values(i,'ERROR_LOG_ID'||i, 'PROCEDURE_NAME'||i||, 'REQUEST_ID' |i||, 'PROCESS_NAME' ||i||, 'ERROR_TYPE'|i|, 'MESSAGE_DETAILS' ||i||, 'ERROR_TIMESTAMP' |i|, 'STATUS' ||i||, 'CREATED_BY' ||i||, 'CREATION_DATE' ||i||, "to_char(last_update_date, 'dd-Mon-yyyy hh:mi:ss')" |i|, 'LAST_UPDATED_BY' ||i||, 'LAST_UPDATE_LOGIN');
    ERROR at line 28:
    ORA-06550: line 28, column 84:
    PL/SQL: ORA-00936: missing expression
    ORA-06550: line 27, column 1:
    PL/SQL: SQL Statement ignored
    script.
    ====
    declare
    CURSOR c_iostats IS
    SELECT * from XXFRO.XXFRO_ERRORS;
    ERROR_LOG_ID NUMBER;
    PROCESS_NAME VARCHAR2(50);
    ERROR_TYPE VARCHAR2(20);
    STATUS VARCHAR2(20);
    MESSAGE_DETAILS VARCHAR2(2000);
    ERROR_LOG_ID NUMBER;
    PROCEDURE_NAME VARCHAR2(50);
    REQUEST_ID NUMBER;
    PROCESS_NAME VARCHAR2(50);
    ERROR_TYPE VARCHAR2(20);
    MESSAGE_DETAILS VARCHAR2(2000);
    ERROR_TIMESTAMP DATE;
    STATUS VARCHAR2(20);
    CREATED_BY NUMBER;
    CREATION_DATE DATE;
    LAST_UPDATE_DATE DATE;
    LAST_UPDATED_BY NUMBER;
    LAST_UPDATE_LOGIN NUMBER;
    Begin
    for i in 1..1000000 LOOP
    insert into IO_TEST(ERROR_LOG_ID
    ,PROCEDURE_NAME
    ,REQUEST_ID
    ,PROCESS_NAME
    ,ERROR_TYPE
    ,MESSAGE_DETAILS
    ,ERROR_TIMESTAMP
    ,STATUS,CREATED_BY
    ,CREATION_DATE
    ,LAST_UPDATE_DATE
    ,LAST_UPDATED_BY
    ,LAST_UPDATE_LOGIN)
    values(i,'ERROR_LOG_ID'||i, 'PROCEDURE_NAME'||i||, 'REQUEST_ID' |i||, 'PROCESS_NAME' ||i||, 'ERROR_TYPE'|i|, 'MESSAGE_DETAILS' ||i||, 'ERROR_TIMESTAMP' |i|, 'STATUS' ||i||, 'CREATED_BY' ||i||, 'CREATION_DATE' ||i||,'LAST_UPDATE_DATE' ||i||, 'LAST_UPDATED_BY' ||i||, 'LAST_UPDATE_LOGIN');
    END LOOP;
    end;
    Thanks,
    HCDBA

    Hi,
    Why are you using the concat(||) Symbol after i in the expression String 'CREATED_BY' ||i||. When you are padding between
    two text we use so.
    Ex: If you want to concat 'i' between String we use
    DBMS_OUTPUT.PUT_LINE('Five is between '|| i || 'and Six');The Insert Statement should be re-written as
    INSERT INTO io_test
                (error_log_id, procedure_name, request_id,
                 process_name, ERROR_TYPE, message_details,
                 error_timestamp, status, created_by,
                 creation_date, last_update_date,
                 last_updated_by, last_update_login
         VALUES (i, 'ERROR_LOG_ID' || i, 'PROCEDURE_NAME' || i,
                  'REQUEST_ID' || i, 'PROCESS_NAME' || i, 'ERROR_TYPE' || i,
                  'MESSAGE_DETAILS'
                  || i, 'ERROR_TIMESTAMP' || i, 'STATUS' || i,
                  'CREATED_BY' || i, 'CREATION_DATE' || i,
                  'LAST_UPDATE_DATE' || i, 'LAST_UPDATED_BY' || i,
                 'LAST_UPDATE_LOGIN'
                );Thanks,
    Shankar

  • PL/SQL: ORA-00942: table or view does not exist

    Hi
    i have logged into my schema and trying to access the database "DAD" which has the table name "SCHOOL"
    i wrote a function which should give me new_sno when i give it the old_sno
    and i have this errors , pls help
    CREATE OR REPLACE FUNCTION ORIG_SN(OSNO in Number,OTN in Number)
    RETURN Number IS
    NEW_SNO Number:=0;
    BEGIN
    SELECT new_sno AS NEW_SNO
    FROM DAD.SCHOOL
    WHERE ORIG_SNO = OSNO AND ORIG_TN = OTN;
    RETURN NEW_SNO;
    END ORIG_SN;
    Warning: Function created with compilation errors.
    Errors for FUNCTION ORIG_SN:
    LINE/COL ERROR
    5/1 PL/SQL: SQL Statement ignored
    6/15 PL/SQL: ORA-00942: table or view does not exist
    Thanks in advance ..

    Try this,
    CREATE VIEW SCHOOL_VIEW AS SELECT * FROM DAD.SCHOOL;and then change your function like
    CREATE OR REPLACE FUNCTION ORIG_SN(OSNO in Number,OTN in Number)
    RETURN Number IS
    my_new_sno Number:=0;
    BEGIN
    SELECT new_sno INTO my_new_sno FROM SCHOOL_VIEW WHERE ORIG_SNO = OSNO AND ORIG_TN = OTN;
    RETURN my_new_sno;
    END ORIG_SN;and see if it is getting created without any errors.
    -Arun
    Edited by: Arunkumar Ramamoorthy on Aug 15, 2009 1:56 AM

  • PL/SQL: ORA-00904:

    Hello..
    We have custom package which is working fine since long time. But all at once we are getting compilation errors.. The following are the error messages that we are getting
    233/13 PL/SQL: SQL Statement ignored
    248/20 PL/SQL: ORA-00904: "SLIP_TYPE": invalid identifier
    254/13 PL/SQL: SQL Statement ignored
    262/20 PL/SQL: ORA-00904: "SLIP_TYPE": invalid identifier
    527/16 PL/SQL: SQL Statement ignored
    593/36 PL/SQL: ORA-00904: "SLIP_DATE": invalid identifier
    597/16 PL/SQL: SQL Statement ignored
    636/36 PL/SQL: ORA-00904: "SLIP_DATE": invalid identifier
    The same package is working fine in all the other instances .

    I don't know what else to suggest, so I'll point you to the error code:
    ORA-00904:     string: invalid identifier
    Cause:     The column name entered is either missing or invalid.
    Action:     Enter a valid column name. A valid column name must begin with a letter, be less
    than or equal to 30 characters, and consist of only alphanumeric characters and the
    special characters $, _, and #. If it contains other characters, then it must be
    enclosed in double quotation marks. It may not be a reserved word.And here you can see how an ORA-00904 happens.
    SQL> create table pos_header
      2  ( slip_date date
      3  , slip_type varchar2(1)
      4  )
      5  /
    Tabel is aangemaakt.
    SQL> create procedure test1
      2  as
      3  begin
      4    update pos_header
      5       set slip_date = sysdate
      6     where slip_type = 'A'
      7    ;
      8  end;
      9  /
    Procedure is aangemaakt.
    SQL> show err
    Er zijn geen fouten.
    SQL> exec test1
    PL/SQL-procedure is geslaagd.
    SQL> alter table pos_header drop column slip_type
      2  /
    Tabel is gewijzigd.
    SQL> exec test1
    BEGIN test1; END;
    FOUT in regel 1:
    .ORA-06550: line 1, column 7:
    PLS-00905: object RWK.TEST1 is invalid
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    SQL> alter procedure test1 compile
      2  /
    Waarschuwing: procedure is gewijzigd met compilatiefouten.
    SQL> show err
    Fouten voor PROCEDURE TEST1:
    LINE/COL ERROR
    4/3      PL/SQL: SQL Statement ignored
    6/10     PL/SQL: ORA-00904: "SLIP_TYPE": invalid identifierHope this helps assuring you that the column is missing and I hope you'll find out the table and schema where this column is missing.
    Regards,
    Rob.

  • PL/SQL: ORA-04052: error occurred when looking up remote object.

    Hi All,
    I'm getting the following error message while executing a PL/SQL Block.
    PL/SQL: ORA-04052: error occurred when looking up remote object UPLDUSER.filestatushistory@FTS
    ORA-00604: error occurred at recursive SQL level 1
    ORA-03106: fatal two-task communication protocol error
    ORA-02063: preceding line from FTSStatement
    declare
    v_coun number;
    begin
    select count(*) into v_coun
    from updluser.filestatushistory@fts;
    end;Back ground of the situation as follows,
    My DataBase version 10.2.0.3 DB Name :DB1
    Table Owner : UPLDUSER
    Table Name : FILESTATUSHISTORY
    I have a report user on the same database and I have grant all on the above table to report user
    Report User : RPT_FTS
    SQL> GRANT ALL ON FILESTATUSHISTORY_V TO RPT_FTS;Now Please find the below database details where I'm getting subjected error.
    Database version : 9.2.0.8
    DB Name : DB2
    User Name : RPT_REPORTS
    I Have create a dblink from RPT_REPORTS to RPT_FTS on DB1 and the dblink works fine. But getting the above error while running it.
    but When I do the same other 10.2.0.3 db , the above PL/SQL block works fine without any problem.
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Now the strange about this is that I have Created a new table on DB1 db like below;
    SQL> CREATE TABLE UPLDUSER.ABC AS SELECT * FROM FILESTATUSHISTORY;and retry my code on DB2 (9.2.0.8) after changing the table to ABC and it worked. Now I don't know whats wrong with a original table(FILESTATUSHISTORY).
    To over come the problem and a work-a-round method I create a view on the DB1 (RPT_FTS) like the below
    SQL> CREATE VIEW FILESTATUSHISTORY AS SELECT * FROM UPLDUSER.FILESTATUSHISTORY;and was able to run the PL/SQL block Remotely.
    Just wants To know what whould have been the cause for this .
    Cheers
    Kanchana

    Hi Kanchana,
    Perhaps following link of google search has answer to your query
    ORA-04052. The search result contains some useful articles whose URLs I shan't post in the forums.
    HTH!
    *009*

  • PL/SQL: ORA-01744: inappropriate INTO

    Hi,
    Iam pasted this code this error coming ...
    any one can help me plz....
    select PI.PEN_NUMBER||''(''||(PEN_CAPACITY-(SELECT nvl(SUM(NO_OF_HEAD_IN_PEN),0) from LOT_PEN WHERE PEN_ID=PI.PEN_ID))||'',''||PEN_CAPACITY||'')'' D, PEN_ID R FROM PEN_ID PI'
    report error:
    ORA-06550: line 1, column 100:
    PL/SQL: ORA-01744: inappropriate INTO
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored

    Yes you can:
    CREATE TABLE PEN_ID ( PEN_NUMBER NUMBER, PEN_CAPACITY NUMBER, PEN_ID NUMBER PRIMARY KEY );
    CREATE TABLE LOT_PEN ( NO_OF_HEAD_IN_PEN NUMBER, PEN_ID NUMBER PRIMARY KEY );
    SELECT pi.pen_number || '(' || (pen_capacity - (SELECT nvl(SUM(no_of_head_in_pen)
                                                              ,0)
                                                      FROM lot_pen
                                                     WHERE pen_id = pi.pen_id))
                      || ',' || pen_capacity || ') ' d
          ,pen_id r
      FROM pen_id pi;
    0 rows selected.However, are you trying to use this in PL/SQL? and getting PLS-00427: an INTO clause is expected in this SELECT statement ?
    I'm confused why you have two single quotes rather than one throughout and a trailing quote at the end, is this dynamic SQL? is there some other context of which you are not making us aware?

  • PL/SQL: ORA-00904: invalid identifier (DG4ODBC 11.2.0.2 & MySQL)

    I have a PL/SQL script processing information between Oracle database and MySQL database. My script ran perfectly with DG4ODBC 11.1.0.7. Then we upgraded Oracle to 10.2.0 and DG4ODBC 11.2.0.2. Now if I run my script from Solaris command line like ./myscript.shl, I get the following errors:
    PL/SQL: ORA-00904: "cmswhit_moodle1"."mdl_grade_grades"."finalgrade": invalid identifier
    PL/SQL: ORA-00904: "cmswhit_moodle1"."mdl_question_states"."attempt": invalid identifier
    The strange thing is if I run the same query by cut and paste into sqlplus from command line, the query works perfectly without any problems.
    What is the cause of this problem?
    Any help would be greatly appreciated.
    Jeffrey

    Hi Klaus,
    The problem was solved after I updated MySQL ODBC to a new version from 5.1.8 to 5.1.13.
    Summary of the problem and its solution:
    The Problem: It appears that dg4odbc 11.2.0.2 requires a newer version of MyODBC. Previously I used MyODBC 5.1.8 which ran into problems with dg4odbc 11.20.0.2.
    The Solution: After I updated MyODBC to 5.1.13, my PL/SQL scripts all work.
    I need to point out that with MyODBC 5.1.8, I can run queries and updates from SQL*Plus console, but now PL/SQL scripts.
    I'll close this thread.
    Once again, thank you and happy holidays.
    Jeffrey

Maybe you are looking for

  • 12-way secondary color correction

    I earlier submitted a feature request asking for the "primary" 12-way color controls to be available on seconday layers in SpeedGrade. Is there any other way to restrict a primary layer's precise controls to an HSL key (or to its outside)? It would b

  • Condition type for CST

    All SAP Gurus, Which condition type to be used for CST? (for example as we use JMOP for excise duty). Regards,

  • Images in Emails

    I have a strange one, I used to be able to see images within my emails, but now I am getting a little blue question mark. It seems to be mainly on my imap account for 1and1 but it sometimes appears on my .me account too? Anyone else had this?

  • Unwanted layer created with text

    I added a blank layer and added some text to it. But after returning to the layers view, I see that an extra blank layer has appeared in addition to the text layer. This is a problem because I will exceed the maximum number of layers. How do I preven

  • Highly impressed with ACR 7.2RC1 !

    Highly impressed with ACR 7.2RC1 ! In a separate thread in the Bridge forum I posted screen shots showing what ACR 7.2RC1 was able to pull out of a nearly all-black accidental-camera-discharge shot.  It's by no means an artistic quality image, as it