ORA-00947: not enough values to choose from

Hi all

I created the type object and its type of nested table to hold the values.

But am getting error as follows:

Connected to Personal Oracle Database 10g Release 10.2.0.1.0 
Connected as hr

SQL> 
SQL> create or replace type t_obj as object
  2  ( id number,
  3    dt date
  4   );
  5  /

Type created

SQL> create or replace type t_obj_nt is table of t_obj; 
  2  /

Type created

SQL> set serveroutput on
SQL> 
SQL>  declare
  2   l_tab t_obj_nt;
  3  
  4   begin
  5  
  6    select level,(sysdate+ level) into l_tab
  7    from dual connect by level < 5;
  8  
  9   dbms_output.put_line(l_tab.count);
 10   end;
 11  /

declare
 l_tab t_obj_nt;


 begin


  select level,(sysdate+ level) into l_tab
  from dual connect by level < 5;


 dbms_output.put_line(l_tab.count);
 end;

ORA-06550: line 8, column 3:
PL/SQL: ORA-00947: not enough values
ORA-06550: line 7, column 3:
PL/SQL: SQL Statement ignored

SQL> 

Concerning

SID

CREATE or REPLACE type t_obj

AS

object

(

ID NUMBER,

DT DATE);

CREATE or REPLACE type t_obj_nt

IS

TABLE OF t_obj;

-Option 1

DECLARE

l_tab t_obj_nt;

BEGIN

-You get several lines.

SELECT t_obj (level, (sysdate + level)) in BULK COLLECT INTO l_tab FROM dual CONNECT BY level<>

dbms_output.put_line (l_tab. (Count);

END;

Tags: Database

Similar Questions

  • ORA-00947 not enough values, why?

    In this code, why do I get "ORA-00947 not enough of values, it has the same number of columns, just a select statement."

    Help, please.
    type list_employee_type is table of employee_tmp%rowtype;
    
     procedure search_by_jobId (jobId IN varchar2,  list_employee_rtn OUT list_employee_type,
            success OUT boolean, exception_msg OUT varchar2)
            is        
         begin    
           select * into list_employee_rtn from employee_tmp where job_id = jobId ;       
        end search_by_jobId;

    >
    still do not understand, can you please give me more details?
    >
    SQL does NOT include PL/SQL types. This is a PL/SQL type:

    type list_employee_type is table of employee_tmp%rowtype;
    

    You can use in SQL:

    select * into list_employee_rtn from employee_tmp where job_id = jobId 
    

    You must use a SQL type

    And the full exception you was probably one like this:
    >
    ORA-06550: line 7, column 22:
    PLS-00642: types of local collections not allowed in SQL queries
    ORA-06550: line 7, column 40:
    PL/SQL: ORA-00947: not enough values
    ORA-06550: line 7, column 8:
    PL/SQL: SQL statement ignored
    >
    PLS-00642 is the exception that said you that you used the wrong type.

    Here are the types SQL based on the SCOTT. EMP table

    -- type to match emp record
    create or replace type emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
      )
      /
    
    -- table of emp records
    create or replace type emp_table_type as table of emp_scalar_type
      /
    

    Now you can use "emp_table_type" in a PL/SQL procedure, and in the select statement.

  • ORA-00947: not enough values error collect in bulk

    Hi guys,.

    I'm trying to COLLECT in a PL/SQL table, but I get ORA-00947: not enough values error message, even if the table has 4 values and select 4 values. Am I missing something?

    I have to add something to this?

    I've included the types of database objects that I created on the database.

    I have commented on the Original code and used the table DOUBLE just to make simple workout.

    /*

    CREATE or REPLACE TYPE Usage_Groups_for_coda_rec as

    object

    (Usage_Group_ID NUMBER (10),)

    Coda_comment VARCHAR2 (45).

    Amount NUMBER,

    Deduction_amount NUMBER);

    CREATE OR REPLACE

    TYPE USAGE_GROUPS_FOR_CODA_TAB AS

    TABLE OF Usage_Groups_for_coda_rec;

    */

    declare

    -CURSOR c_adj_roy_trans

    -EAST

    -SELECT DISTINCT rotr.on_behalf_of_soc_nbr, rotr.right_type

    -OF royalty_transaction rumble

    -WHERE rotr.ps_adjust_royalty_flg = cm_default.get_yes;

    CURSOR c_adj_roy_trans

    IS

    SELECT '052', 'P '.

    DOUBLE;

    t_uge_Grp_for_coda_tab USAGE_GROUPS_FOR_CODA_TAB; -the type of table was created on the database

    Start

    FOR r_adj_roy_trans IN c_adj_roy_trans LOOP

    -SELECT rotr.usage_group_id as Usage_Group_ID,

    -cm_coda_account_default.get_canc_adj_coda_comment | '- CAE' as Coda_comment,

    -SUM (NVL (rotr.gross_amt, 0) + NVL (rotr.reciprocal_deduction_amt, 0)) as an amount

    -SUM (rotr.reciprocal_deduction_amt) as Deduction_amount

    -COLLECT LOOSE t_uge_Grp_for_coda_tab

    -OF royalty_transaction rumble

    -WHERE rotr.ps_adjust_royalty_flg = cm_default.get_yes

    - AND rotr.on_behalf_of_soc_nbr = r_adj_roy_trans.on_behalf_of_soc_nbr

    - AND rotr.right_type = r_adj_roy_trans.right_type

    -Rotr.usage_group_id group;

    SELECT 6874534 as Usage_Group_ID,

    "This is a test - CAE" as Coda_comment.

    100 as an amount

    50 as Deduction_amount

    LOOSE COLLECTION t_uge_Grp_for_coda_tab

    DOUBLE;

    /*

    IF l_uge_Grp_for_coda_tab. COUNT > 0 THEN

    cm002p.std_coda_post_cashing_out_bulk (p_on_behalf_of_society_number = > r_adj_roy_trans.on_behalf_of_soc_nbr,)

    p_right_type = > r_adj_roy_trans.right_type,

    p_Usage_Groups_for_coda_tab = > t_uge_Grp_for_coda_tab,

    p_reverse_posting_direction = > FALSE,

    p_posting_override_direction = > NULL,

    p_cohi_id = > NULL

    );

    END IF;

    */

    END LOOP;

    end;



    Here's what you need to do:


    SELECT Usage_Groups_for_coda_rec(6874534, "It is a test - CAE", 100, 50)

    LOOSE COLLECTION t_uge_Grp_for_coda_tab

    DOUBLE;

    You try bulk collect into a collection of Usage_Groups_for_coda_recs, then you will need to make type compatible using the implicit of the type constructor.

  • PL/SQL: ORA-00947: not enough values error message

    Hi all I get Error (25.63): PL/SQL: ORA-00947: not enough error message values when executing after the insert statement. I am new to Oracle SPs, if someone could help me solve the problem.

    Insert in estimate (ID, mValue) values ('select (where pm.ID is null then 10))
    of other pm.ID
    End ID), m1.mID, (case when mValue < 1 and m1.mID in (1.7))
    then mValue * 100
    of another mValue
    mValue end) of
    Scott. Left outer join METRICS m1
    Scott. (PROJECTMETRIC h m1.mID = pm.ID and pm.ID = 10)');

    The syntax to insert rows into a table of a subquery is as follows:

    insert into table (col1, col2, ...)
    select ... , ..., ....
    from ..., ....
    where ....
    /
    
  • Get 'not enough values error' in bulk collect

    I want to insert all the rows in the employees table in the tmp table which has the structure.

    Purpose: Try just feature fired block to create a return to the top of a table.

    Problem: My code is to not "enough of values" error please report if mistaken.

    structure of the employees table:

    SQL > desc employee;

    Name                                      Null?    Type

    ----------------------------------------- -------- ----------------------------

    EMPLOYEE_ID NOT NULL NUMBER (6)

    FIRST NAME VARCHAR2 (20)

    LAST_NAME NOT NULL VARCHAR2 (25)

    EMAIL NOT NULL VARCHAR2 (25)

    PHONE_NUMBER VARCHAR2 (20)

    HIRE_DATE NOT NULL DATE

    JOB_ID NOT NULL VARCHAR2 (10)

    SALARY NUMBER (8.2)

    COMMISSION_PCT NUMBER (2.2)

    MANAGER_ID NUMBER (6)

    DEPARTMENT_ID NUMBER 4

    tmp table structure:

    SQL > tmp desc;

    Name                                      Null?    Type

    ----------------------------------------- -------- ----------------------------

    EMPLOYE_ID NUMBER (6)

    FIRST NAME VARCHAR2 (20)

    LAST_NAME NOT NULL VARCHAR2 (25)

    EMAIL NOT NULL VARCHAR2 (25)

    PHONE_NUMBER VARCHAR2 (20)

    HIRE_DATE NOT NULL DATE

    JOB_ID NOT NULL VARCHAR2 (10)

    SALARY NUMBER (8.2)

    COMMISSION_PCT NUMBER (2.2)

    MANAGER_ID NUMBER (6)

    DEPARTMENT_ID NUMBER 4

    SQL > select * from tmp;

    no selected line

    Code:

    declare

    type rec is the employee table % rowtype

    index by pls_integer;

    a rec;

    Start

    Select * bulk collect in a

    employees;

    ForAll i in a.first... a.Last

    Insert into tmp values (a (i));

    end;

    /

    Result:

    SQL > declare

    2

    3 type rec is the employee table % rowtype

    4 index of pls_integer;

    5 a rec;

    6

    7. start

    8 remove tmp;

    9 select * bulk collect in a

    10 employees;

    11 ForAll i in a.first... a.Last

    12 insert into tmp values (a (i));

    13 end;

    14.

    Insert into tmp values (a (i));

    *

    ERROR on line 12:

    ORA-06550: line 12, column 13:

    PL/SQL: ORA-00947: not enough values

    ORA-06550: line 12, column 1:

    PL/SQL: SQL statement ignored

    Remove parentheses

    insert into tmp values a(i);
    

    or call the individual columns

    insert into tmp( employee_id, first_name, ... )
     values( a(i).employee_id, a(i).first_name, ... );
    

    Justin

  • Fresh fired for FORALL does not not enough values error

    Hello

    I am trying to copy data from one table to the other which have a different number of columns. I do the following. But he threw not enough values error.

    Table A has more than 10 million records. So I use bulk collect instead of using insert into select from.

    TABLE A (has the more columns - 25)
    Number of C1
    number of C2
    VARCHAR2 C3
    C4 varchar2
    ...
    ...
    ...
    C25 varchar2

    TABLE B (less than columns - like 7)
    Number of C1
    number of C2
    VARCHAR2 C3
    C4 varchar2
    number of C5
    date of C7
    C10 varchar2

    declare

    TYPE c IS REF CURSOR;

    c V_c;

    v_Sql VARCHAR2 (2000);
    Table TYPE is table B % ROWTYPE;
    L_data table;


    Start

    v_Sql: = 'SELECT c1, c2, c3, c4, c5, c7, c10 OF A ORDER BY c1;

    V_c OPEN FOR v_Sql;

    LOOP
    Fetch the v_c COLLECT LOOSE ldata LIMIT 100000;

    FORALL i in 1... lData. Count
    INSERT
    B
    VALUES ldata (i);

    END LOOP;
    COMMIT;

    exception
    WHILE OTHERS THEN
    ROLLBACK;
    dbms_output.put_line ('Exception occurred' |) SQLERRM);
    END;


    When I run this, I get
    PL/SQL: ORA-00947: not enough values

    Any suggestions please. Thanks in advance.

    Table A has more than 10 million records. So I use bulk collect instead of using insert into select from.

    That makes sense to me. An INSERT... SELECT will be more effective, easier to manage, easier to write and easier to understand.

    INSERT INTO b( c1, c2, c3, c4, c5, c7, c10 )
      SELECT c1, c2, c3, c4, c5, c7, c10
        FROM a;
    

    will be faster, use fewer resources, much less error-prone and have a more obvious use when a maintenance programmer coming that any PL/SQL block that does the same thing.

    If you insist on the use of PL/SQL, what version of Oracle are you using? You should be able to do something like

    DECLARE
      TYPE b_tbl IS TABLE OF b%rowtype;
      l_array b_tbl;
    
      CURSOR a_cursor
          IS SELECT c1, c2, c3, c4, c5, c7, c10 FROM A;
    BEGIN
      OPEN a_cursor;
      LOOP
        FETCH a_cursor
         BULK COLLECT INTO l_array
        LIMIT 10000;
    
        EXIT WHEN l_array.COUNT = 0;
    
        FORALL i IN l_array.FIRST .. l_array.LAST
          INSERT INTO b
            VALUES l_array(i);
      END LOOP;
      COMMIT;
    END;
    

    At least, that eliminates the infinite loop and the unnecessary dynamic SQL. If you are using older versions of Oracle (it is always useful to display this information at the front), the code may need to be a little more complex.

    Justin

    Published by: Justin cave on January 19, 2011 17:46

  • Not enough values error

    I get this error in the following query. What could be the problem?

    Insert into Identification@Indus_Link
    (Vno,
    Employeecode,
    Employeeno, Employeename, Fathername, Nicno, Fathernicno, Dob, city, District, address, telephone, Mobile, Entrydate, Jobtitle, Jobnature, Joiningdate, Confirmationdate, rest, Issuspended, Eobino, Ssno, Shiftcode, Jobtype, Accountno, Departmentid, Educationcode, experience, Eobi, Ntn, Identification_Mark, sex, Fromdate, so far
    )
    Values (IDSEQ, EMPCODE, EMPNO,
    (Select Employeename, Fathername, Nicno, Fathernicno, date of birth, city,
    Neighborhood, address, telephone, Mobile, Entrydate,
    Current_Designation (Employeecode),
    Current_Jobnature (Employeecode), Joiningdate,
    Still, Issuspended, Eobino, Confirmationdate, Ssno,
    Current_Shift (Employeecode),
    Current_Jobtype (Employeecode), Peru,
    Current_Department (Employeecode), Educationcode,
    Eobi, Ntn, Identification_Mark, sex, experience
    FromDate, so far
    Identification
    Where Employeecode = '911145')
    )

    The values are enough.

    No, they are not... that's what means the error message...

    Willy says:
    IDSEQ,
    EMPCODE,
    EMPNO,

    are variables.

    Yes I know.. I was referring to the SELECT... This should be a scalar subquery

    SQL> create table test
      2  (id number
      3  ,name varchar2(50)
      4  ,lastname varchar2(50)
      5  )
      6  /
    
    Table created.
    
    SQL>
    SQL> insert into test
      2  values (1, (select 'something', 'other' from dual))
      3  /
    insert into test
                *
    ERROR at line 1:
    ORA-00947: not enough values
    
    SQL>
    SQL>
    SQL> insert into test
      2  values (1, 'something', 'other')
      3  /
    
    1 row created.
    
    SQL> 
    

    do this instead:

    insert ...
    Select IDSEQ, EMPCODE, EMPNO,Employeename, Fathername, Nicno, Fathernicno, Dob, City,
    District, Address, Phone, Mobile, Entrydate,
    Current_Designation (Employeecode),
    Current_Jobnature (Employeecode), Joiningdate,
    Confirmationdate, Rest, Issuspended, Eobino, Ssno,
    Current_Shift (Employeecode),
    Current_Jobtype (Employeecode), Accountno,
    Current_Department (Employeecode), Educationcode,
    Experience, Eobi, Ntn, Identification_Mark, Gender,
    Fromdate, Todate
    From Identification
    Where Employeecode = '911145'
    )
    
  • ORA-38729: not enough flashback database data log do FLASHBACK.

    Hello

    I'm trying to flashback database just for an hour. My flash_back_retention is set to 1440 (1 day), db_recovery_file_dest_size is set to 200G (and is used only 9 G). I could see newspapers of flashback for the last 2 days and logs archiving during 7 days available on ASM. But I'm not able at the database of flashback for another 10 minutes.

    SQL > flashback to timestamp to_date database (January 6, 2012 22:10 ',' MON-DD-YYYY HH24:MI:SS');
    database of Flash back to timestamp to_date (January 6, 2012 22:10 ',' MON-DD-YYYY HH24:MI:SS')
    *

    SQL > select * from v$ flashback_database_log;

    OLDEST_FLASHBACK_SCN OLDEST_FLASHBAC RETENTION_TARGET FLASHBACK_SIZE
    -------------------- --------------- ---------------- --------------
    ESTIMATED_FLASHBACK_SIZE
    ------------------------
    2.3219E + 12 5 FEBRUARY 12 1440 9567993856
    4230193152


    SQL > select flashback_on from gv$ database;

    FLASHBACK_ON
    ------------------------------------------------------
    YES


    SQL > show parameter recov

    VALUE OF TYPE NAME
    ------------------------------------ --------------------------------- ------------------------------
    db_recovery_file_dest string + DGSSD
    great db_recovery_file_dest_size whole 200G
    recovery_parallelism integer 0

    It is not the problem of the logs archiving or flashback logs. Can you please give me advice?


    Thank you
    Krmreddy.

    Hello
    You wrote: * "I try flashback database just for an hour." But you have issued

    You wrote:
    SQL> flashback database to timestamp to_date('06-JAN-2012 22:10:00','DD-MON-YYYY HH24:MI:SS'); 
    

    January 6, 2012, is a month now!

    Edited by: Manguilibe Feb 6 KAO. 2012 21:55

  • create the database fails with ORA-27102 - not enough memory

    Hello

    I have server Solaris 10 with 16 GB of ram. On that, there are 10 databases (8 of them 9.2.0.7 and 2 of them 10.2.0.4) running - but they have a small LVO-300 mb each (about even smaller 200 MB or more). Now, I have to create two more data on this database. When I try to create the db, it fails with the error:

    Connect to an instance is idle.
    ORA-27102: out of memory
    SVR4 error: 22: invalid argument

    And the journal of alerts meesages as below:
    Starting ORACLE instance (normal)
    Tue May 26 07:37:39 2009
    WARNING: EINVAL creation of segment size 0 x 0000000029002000
    Difficulty shm parameters in/etc/System or equivalent

    See also the output of this command:

    prctl - n Project.Max - shm-memory - i user.root of the project
    project: 1: user.root
    NAME PRIVILEGE VALUE FLAG ACTION BENEFICIARY
    Project.Max - shm-memory
    3.92 GB privilege - deny-
    system 16.0EB max deny-

    Now, I tried to change that with this command (as suggested in the installation guide):
    prctl - n v Project.Max - shm-memory - 8 GB - r-i user.root of the project

    but I still don't have the same error. So I refer to Metalink document 399895.1. It is said that manually change the settings in/etc/System. This requires a reboot and I had prior to do this restart tomorrow. But my question is: what are the values that I should put in this file? + as suggested in the note, if I put the values below? -

    For example, a value of the sample (mentioned in the note) are: for entry system/etc/setting SHMMAX = 6 GB.

    Set shmsys:shminfo_shmmax = 6442450944
    Set semsys:seminfo_semmni = 1024
    Set semsys:seminfo_semmsl = 1024
    Set shmsys:shminfo_shmmni = 100

    or should I put some other values (for all parameters as semmni, semmsl etc.)? I missed that I should be by specifying values.

    Thank you

    Published by: orausern on May 26, 2009 07:24

    Published by: orausern on May 26, 2009 07:27

    I'm not a Unix system administrator, but I think that your steps are correct - pl check with your Unix system administrator

    Srini

  • PL/SQL: ORA-00947

    Hello

    I have a package body as shown 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 IN LISTSTRING OF 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) IN THE DOUBLE RTNVAL1;
    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 someone let me know what is the problem here and earlier, I used this function 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: statement ignored
    19/105 PL/SQL: ORA-00947: not enough values
    SQL >

    I think you should do a

    SELECT TO_DATE (SUBSTR (LISTSTRING, 1, 8), 'YYYYMMDD'), SUBSTR (LISTSTRING, 9, DELPOS - 9) BULK COLLECT INTO RTNVAL1 FROM DUAL;

    that your target is an array, which must be initialized and expanded what is done by a transaction block.

    HTH

  • ORA-00947 strange

    Hi all

    I have a query in a procedure as follows:

    Select min (Ref. INNER_CODE REFERENCE_V_INNER_CODE), item.COMPONENT_V_ID bulk collect into highest_quality_table
    starting T_ITEM, ref T_REFERENCE
    where (point. ITEM_V_CODE, item.COMPONENT_V_ID) in
    (select...)
    and point. ITEM_V_QUALITY_LEVEL = REF. REFERENCE_V_CODE_NAME
    Item.COMPONENT_V_ID group

    Is compiled successfully if I use a locally defined type for highest_quality_table:
    TYPE highest_quality_row_type IS RECORD (INNER_CODE T_REFERENCE. TYPE OF REFERENCE_V_INNER_CODE %, COMPONENT_V_ID T_COMPONENT.COMPONENT_V_ID%TYPE);
    TYPE highest_quality_table_type IS TABLE OF THE highest_quality_row_type;
    highest_quality_table highest_quality_table_type;

    But then I tried to define this type at the level of the schema:
    create or replace type as object highest_quality_row_type (INNER_CODE NVARCHAR2 (20), COMPONENT_V_ID NVARCHAR2 (8))
    create or replace type highest_quality_table_type to table of highest_quality_row_type

    After that, the query fails to compile with the strange ORA-00947 (not enough values).
    No idea why it could happen?

    Published by: 850271 on April 6, 2011 06:55

    Because RECORD! = OBJECT. If you in bulk collect in the array of objects your SQL must select object of this type. Change Select this option for:

    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.

  • MapBuilder: Import of Shapefile in Oracle Spatial failed: ORA-00947

    I'm trying to use the MapBuilder 11 g to import a .shp file.

    I'm their import to a pre-existing table and column SDO_GEOMETRY.

    I have two file types different .shp, 8307 SRID and 4326.
    When you try to import a file any SRID 8307 Shapefiles, I get the message: ORA-00913 too many values for each record # tried to convert
    When you try to import some SRID 8307 and SRID 4326 files, I get the message: ORA-00947: not enough values for each record # tried to convert

    I was not able to import any .shp successfully yet.

    Is there a problem with the .shp file, or is it another problem?

    Thank you!

    It is possible that pre-existing table definitions differ from those in shapefiles. for example, the database table is something like
    roads)
    number of road_id
    road_name varchar2 (64).
    the sdo_geometry form)
    While the shp and dbf file corresponding
    road_id, road_name, road_length, form
    Too many values error

    Interchanging the two defs should give not enough values error

    Load the shapefile into a new table. Does it work. If Yes, then copy the new table in that pre-existing and delete a new.
    E.g. roads shapefiles loading in the new table roads_shp (road_id, road_name, road_length, shape)
    Insert the roads select road_id, road_name, roads_shp form.
    drop table roads_shp;

  • DataExport problem-ODBC layer error: [21S 01] - ORA - 00947

    Hello

    I have a planning application from where I want to transfer data to Oracle DB in the table "t". I have 11 dimension in the planning application, so I created 12 columns in the table "t"(11 pour les membres de la dimension et le 1 col valeur) 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),
    number of l)

    I created a wire protocol dsn. But when I run the following calcscript.

    Difficulty (jan, AFA 08 budget)
    DATAEXPORT 'DSN' "xz" "t" "tstschma", "password";
    ENDFIX

    then he demonstrated below - error

    [Mon Jul 13 00:04:10 2009] Local/essdb/Plan1/admin/Info (1021000)
    Connection to SQL Server database is established

    [Mon Jul 13 00:04:10 2009] Local/essdb/Plan1/admin/Info (1012695)
    DataExport cannot do insert of batch for the relational table. The driver ODBC or the RDBMS does not support the insert commands. Export SQL for registration by registration

    [Mon Jul 13 00:04:10 2009] Local/essdb/Plan1/admin/Info (1021013)
    Layer ODBC error: [S 21, 01] == > [[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)
    Layer ODBC error: Native [947] error Code

    [Mon Jul 13 00:04:10 2009] Local/essdb/Plan1/admin/Error (1012085)
    Impossible to export the data to the SQL [t] table. Check the Essbase server log and the console of the system to determine the cause of the problem.

    [Mon Jul 13 00:04:10 2009] Local/essdb/Plan1/admin/Info (1021002)
    SQL connection is released

    [Mon Jul 13 00:04:10 2009] Local/essdb/Plan1/admin/Warning (1080014)
    Transaction [0 x 920001 (0x4a5a097a.0x7918)] abandoned due to the State [1012085].

    [Mon Jul 13 00:04:10 2009] Local/essdb/Plan1/admin/Info (1012579)
    Total time elapsed Calc [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 something wrong...


    Thank you and best regards.

    Hello

    Everything depends on you dense dimension used in your export, it will use one column for each Member.
    For example, if the dense dimension on the export was time and you were doing an export from level 0 (Level0 time members are Jan: Dec)
    So we should do a column for each dimension and 12 columns for each of the periods (Jan: Dec)

    The best way out is to export to a file first in a column, and you will see how the table should be addressed.

    Columns must exactly match the exported data.

    Take a look at this post, it something you can meet this way:- Re: DATAEXPORT command periods in columns in rare

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • ORA-00947 enough values but enough of values is returned.

    I know it sounds pretty obvious, but I am at a loss.

    I created a package with some types, and everything has been very good compilation. However, when I ran the new feature, I got an error:
    ORA-21700: object does not exist or is marked for deletion

    After a little research, I realized that the types must be declared outside of the package.

    As soon as I did it, I suddenly started getting error "not enough of values" on any of my. I compared the number of columns returned and the number of columns in the type, and they match.

    Here is my code of type:
    CREATE OR REPLACE TYPE  TSA_CUSTOM.Lost_Plan as object ( 
       LP_Key number,  -- The member key of the plan that is going away
       LP_Type varchar2(20),
       LP_Dept varchar2(12),
       LP_SubDept varchar2(12),
       LP_Class varchar2(12),
       LP_VendorName varchar2(50)
       );
       
    CREATE OR REPLACE TYPE  TSA_CUSTOM.Target_Plan as object (    
       Tgt_Key number, -- The member key of the plan that the Lost plan data will be moving to
       Tgt_Dept varchar2(12),
       Tgt_SubDept varchar2(12),
       Tgt_Class varchar2(12),
       Tgt_VendorName varchar2(50)   
       );   
       
    CREATE OR REPLACE  TYPE  TSA_CUSTOM.Output_Plan as object ( 
       LP_Result varchar2(8), -- Either 'MOVED' or 'DROPPED'
       LP_Key number,  -- The member key of the plan that is going away
       LP_Type varchar2(20),
       LP_Dept varchar2(12),
       LP_SubDept varchar2(12),
       LP_Class varchar2(12),
       LP_VendorName varchar2(50),
       Tgt_Key number, -- The member key of the plan that the Lost plan data will be moving to
       Tgt_Dept varchar2(12),
       Tgt_SubDept varchar2(12),
       Tgt_Class varchar2(12),
       Tgt_VendorName varchar2(50)   
       );
    /  
       -- table of lost plans
    CREATE OR REPLACE TYPE TSA_CUSTOM.Lost_Plans as table of tsa_custom.Lost_Plan;
       
    CREATE OR REPLACE TYPE TSA_CUSTOM.Target_Plans as table of tsa_custom.Target_Plan;
       
    CREATE OR REPLACE TYPE TSA_CUSTOM.Output_Plans as table of tsa_custom.Output_Plan;
    /
    and this is one of the incriminated code snippets:
    function Calc_Lost_Plan_Moves return tsa_custom.Output_Plans pipelined
    is
    -- define the lost plan recordset
    v_LP_Store tsa_custom.Lost_Plans;
    
    v_Tgt_Store tsa_custom.Target_Plans;
    
    v_Output_Store tsa_custom.Output_Plans;
    
    Begin
    
    -- Get all the vendor class lost plans
    select ep.ra_member_key , 'Vendor Class', ep.dept_cd, ep.subdept_cd, ep.class_cd, ep.vendor_name_id bulk collect into v_LP_Store 
    from (select distinct ra_member_key , dept_cd, subdept_cd, class_cd, vendor_name_id, class_member_id
          from tsa_custom.v_ep_vendor_class) ep
        ,(select distinct 'CL'||class_hier_cd as class_cd, vndr_nm 
          from mdm_publish.v_planning_master) mdm
    where ep.class_member_id   = mdm.class_cd(+)
    and   ep.vendor_name_id    = mdm.vndr_nm(+)
    and   mdm.class_cd is null;
    Any help would be appreciated.

    Thank you!
    John

    Hello

    v_LP_store is defined as an array of objects, then you will need to collect objects in there, not the columns in bulk:

    select TSA_CUSTOM.Lost_Plan(
             ep.ra_member_key
           , 'Vendor Class'
           , ep.dept_cd
           , ep.subdept_cd
           , ep.class_cd
           , ep.vendor_name_id
           )
    bulk collect into v_LP_Store
    from
      ...
    

    I created a package with some types, and everything has been very good compilation. However, when I ran the new feature, I got an error:
    ORA-21700: object does not exist or is marked for deletion

    Sometimes, this error is resolved by simply disconnecting the session and reconnect.

    After a little research, I realized that the types must be declared outside of the package.

    Are you sure?
    Packed types can be used to support the pipeline functions (defined in the same package).
    Oracle will create transparent and manage objects corresponding SQL types.

    Edited by: odie_63 Dec 18. 2012 20:15

  • ORA-01034: ORACLE not available &amp; ORA-00838: specific MEMORY_TARG value

    Hi all

    I'm trying to load data into the database. And I was asked to run the commands below:
    ALTER system set sga_target = 1365M scope = spfile;
    ALTER system set pga_aggregate_target = 1365M scope = spfile;
    ALTER system set olap_page_pool_size is 0 scope = spfile;.
    change all of the "_olap_parallel_update_small_threshold" system is 2147483647 scope = spfile;.
    change all of the "_olap_page_pool_hi" system is 30 scope = spfile;.
    ALTER system set job_queue_processes is 5 scope = spfile;.
    stop immediately;
    start-up
    but I got error below...
    SQL > startup;
    ORA-00838: MEMORY_TARGET determined value is too small, must be at least 2
    736 M
    SQL > show sga parameter
    ORA-01034: ORACLE not available
    Process ID: 0
    Session IDs: serial number 0: 0
    what should I do to get my database without losing my data?

    Thanks for your time.

    user12296343 wrote:
    Thanks for your reply, I get following error.

    SQL > create spfile from pfile;
    Created file.
    SQL > startup
    ORA-27102: out of memory
    OSD-00022: additional error information
    S/O-error: (OS 8) not enough memory is available to process this command.

    What should I do now? I have 3 GB of ram and I cannot increase it. What is the default values? I would like to replace their return...

    Thanks for your time...

    alert_SID.log file show settings whose default value used to start the DB.
    If you can find in this file of a start of the DB which took place before today,
    Then you can use these lines, values, the parameters to make new pfile & then a new spfile.
    In the future, you should ALWAYS do a manual copy of the spfile, before changing anything

Maybe you are looking for