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'
)

Tags: Database

Similar Questions

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

  • 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

  • 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

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

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

  • iphone 5 c upwards - not enough memory error

    Plugging my iPhone 5 c to synchronize with iTunes on my desktop (you want to create a restore point) but I get an error message of not having enough free space on my computer - try to delete files and remove the trash.
    I did it, but he has not made a difference (trash is empty and iPhone has 11 GB of free space). I tried to reset the phone, turning the computer power switch & always occurs the same message.
    iPhone software 9.3.4 and iTunes is 12.3.2 - I know the new ios 10, which I don't want to download as we have very limited her download limit.
    Any suggestions?

    Hey there BonesKel,

    I understand that you have a problem with your ability to upgrade to iOS 10 because you cannot create a backup on your computer. Looks like you have enough free space on your iPhone, but you have not enough free space on the computer to allow a backup of your iPhone to reside there. I have a story for you that will help you to free disk space on your computer, allowing you to create a backup iOS through iTunes and continue the update process:

    OS X El Capitan: increase the disk space

    Don't forget that you can always use iCloud to keep a backup of your device iOS as well:

    iCloud: back up your device iOS to iCloud

    Thank you for coming to Apple Support communities and have a great day.

  • cannot make back-up = not enough space. error code 0 x 80070070.

    cannot make back-up = not enough space.  error code 0 x 80070070. does take 60G, but I have 400G external HD. !  What should do?

    The error pops up because there is not enough space in the system reserved partition...

    Download and run the Aomei Partition Manager...

    http://www.disk-partition.com/partition-software.html

    Then, run it.

    The goal is to take a small amount of C to the FRONT of the C partition and add it to the system reserved partition.

    So, select C and the RESIZING option.

    Remove about 200 MB and apply the change. No matter if it's a little more than 200 mb.

    It will take some time to apply because everything has to be mixed on C.

    When you're finished, return to the Partition Manager and select the system reserved partition and the ability to RESIZE.

    Add the free space on the partition system and apply the change BUT does NOT give a letter of the system reserved partition.

    Once rebooted, you should be able to continue your work and get some people make mistakes...

  • mmap:not enough space error

    I use mmap for the cache and I often get the following errors:

    BDB0126 mmap: not enough space


    BDB0061 PANIC: not enough disk space


    Unable to join the BDB1546 environmennt

    The cache size is 100 MB in 4 segments. How an I solve this problem.

    It requires no contiguous memory.   I suggested to reduce the number of segments not increase them.

    Thank you

    Mike

  • Time Machine-not enough space error

    Hi all

    I had to unplug my computer and move it to another room and now after all hang up, I get this message "not enough space for full backup". There are about 150 GB to 2 TB disk space as it is filled with iTunes and Time machine backups.

    I guess it's because ever since I hooked everything back up Time Machine think it is made the first backup of everything rather than pick up where he left off when he made the last backup?

    Please tell me that I shouldn't let it save it for the first time again. It took an eternity to accomplish this last time as the computer kept going to sleep.

    Thanks for any help,

    Al

    Start with 18 in the 1st article linked.

    Troubleshooting of Time Machine

    Solving the problems of Time Machine

  • Cannot install XP service packs - not enough space error

    Hi, Gilchrist, I lost my XP Pro according to the headder. When I try and reinstall it from the original disk, XP pro installed. The problem is when I try and install SP2 or SP3 States screen that there is not enough hard disk space. He reads that 2012 mb instead of the 6.45 GB. All ideas now to overcome this obstacle.

    Best regards.

    * Title *.
    Problems reinstalling with XP pro after April 21 of McAfee update debachle. Inability to read 6.4 GB hard drive.

    Have you contacted McAfee Support help yet?

    The foregoing despite...

    Personal data backup (which none should be considered 100% reliable at this point) then format the HARD disk and do a clean install of Windows.  Please note that another repair facility (upgrade AKA on-site) will NOT fix it!

    HOW to do a clean install of Windows XP: see method 1 and http://michaelstevenstech.com/cleanxpinstall.html#steps in http://support.microsoft.com/kb/978307

    Once installed the clean, you will have the equivalent of a "new computer" in order to take care of everything on the next page before connecting the machine to the internet or one local network (i.e. other computers) otherwise and before using a flash drive or the SD card that is not brand new, or has not been freshly formatted:

    4 steps to help protect your new computer before going online
         http://www.Microsoft.com/security/pypc.aspx

    Other useful references include:

    HOW to get a computer that is running Windows XP Gold (no Service Pack) fully patched (after a clean install)
    http://groups.Google.com/group/Microsoft.public.windowsupdate/MSG/3f5afa8ed33e121c

    HOW TO get a computer that is running Windows XP SP1 (a) or SP2 fully patched (after a clean install)
    http://groups.Google.com/group/Microsoft.public.WindowsXP.General/MSG/a066ae41add7dd2b

    Tip: After getting the computer fully patched, download/install KB971029 manually: http://support.microsoft.com/kb/971029

    NB: No matter what Norton or McAfee free trial which is preinstalled on the computer when you bought will be reinstalled (but invalid) when Windows is reinstalled. You MUST uninstall the trial for free and download/run the appropriate removal tool before installing updates, Service Packs Windows or IE upgrades and before installing your new anti-virus application (which will require WinXP SP3 must be installed).

    Norton Removal Tool
         FTP://ftp.Symantec.com/public/english_us_canada/removal_tools/Norton_Removal_Tool.exe

    McAfee Consumer product removal tool
         http://download.McAfee.com/Products/Licensed/cust_support_patches/MCPR.exe

    See also:

    Risks & benefits of P2P file sharing
    http://www.Microsoft.com/protect/data/downloadfileshare/filesharing.aspx
    http://blogs.technet.com/MMPC/archive/2008/10/06/the-cost-of-free-software.aspx

    Measures to help prevent spyware
    http://www.Microsoft.com/security/spyware/prevent.aspx

    Measures to help prevent computer worms
    http://www.Microsoft.com/security/worms/prevent.aspx

    Avoid fake security software!
    http://www.Microsoft.com/security/antivirus/rogue.aspx

    If these procedures look too complex - and there is no shame in admitting this isn't your cup of tea - take the machine to a local, good reputation and stand-alone computer (that is, not BigBoxStoreUSA or Geek Squad) repair facility.

    Or start a new thread in this forum for further assistance: http://social.answers.microsoft.com/Forums/en-US/xprepair/threads

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Unable to create restore point not enough space error code 0 x 80070070

    My D recovery drive is almost full. I have over 900 GB on my c drive and I have 600 GB free on an external drive. always says not enough space. What is the remedy. Thanks Frank

    Looks like it has to do with one of the partitions on your hard drive.

    Go to start > Control Panel > system and security > administrative tools > computer management > disk management. From there you should be able to see what drives you have connected and all partitions (reserved for the IE system, recovery, etc.)

    Can you tell me what operating system the computer brand you use and on your drive C: drive, which partitions there (and how many MB each partition has?

  • Not enough memory error

    All,

    I get an error when I try to start a 4th guest who says that I don't have enough memory.  I'm pretty sure that this is not the case.  My pc has 16 GB of ram and clients are configured with 2 GB of memory each.  Because three guests starts very well, by my calculations I use 6 GB.  Some Go for Windows & workstation figure in overhead and I'd still be able to on the 4th guest.

    When I had only 8 GB of RAM, I was able to turn two of the guests going up to 16 GB should get at least a two other guests when they are set up to 2 GB each.  This should be only 8 GB of RAM for the guests, leaving the other 8 GB for Windows and work stations.

    Am I missing something?

    Workstation = 7.1.4 build-385536

    Windows 7 x 64 with SP1

    Adam

    Take a look at this - should help the optimization of memory for my computer: http://www.techrepublic.com/blog/virtualization-coach/all-about-memory-optimization-in-vmware-workstation/155

  • Troubleshooting not enough memory error

    I get an error of memory and while there are tons of posts about this on the forums, I had a few more questions. First of all, I have two cRIOs and think that the error would have been thrown by one of them. Is it still possible if? I'm trying to narrow down what exe, the error may be in. Secondly, is there an order of actions they take when they get these errors to help out them?

    Found the REAL problem! I was not reading my header correctly, this resulted in type casting the bad data bytes. Every now and then I would be casting of data type byte that when type cast from a string to an I32 caused a number about 17 million. I guess that the TCP read trying to malloc memory (or new if its c ++ ) and has been unable to do. That's why I got the low-memory error. When I started to read my TCP bytes correctly, the error disappeared.

Maybe you are looking for