-2

I have created a table with only one column

Create Table RLID_MARK
(
RLID Int )

I want to Add multiple values in Column RLID using

insert into RLID_MARK (RLID)
values( '43230335' ,    '20936450' ,    '39685560' ,    '50833640' ,    '78406124' ,)

but its showing

Error report - SQL Error: ORA-00913: too many values
00913. 00000 -  "too many values"
*Cause:    
*Action:

Kindly help me to get exact method. thnk you in advance

  • The question needs clarifying. Do you want a single row with a multi-valued column (= column RLID should be a list of values) ? Or should each value go in a different row ? And if so you have been given several answers. – Albert Godfrind Dec 2 at 13:39
  • can't really support putting multiple values in a single field - this violates almost everything normalization tries to optimize – eagle275 Dec 2 at 14:52
  • What problem are you trying to solve with this approach? – Tom V - Team Monica Dec 3 at 6:34
2

from 9i onward oracle knows insert all ..

use the following syntax:

INSERT ALL
   INTO RLID_MARK (RLID) VALUES (43230335)
   INTO RLID_MARK (RLID) VALUES (20936450)
   INTO RLID_MARK (RLID) VALUES (39685560)
   INTO RLID_MARK (RLID) VALUES (50833640)
   INTO RLID_MARK (RLID) VALUES (78406124)
SELECT 1 FROM DUAL;

this only carries the overhead of repeating the column names per insert line ..if that is still too much writing - you can use PLSQL

declare
   procedure ins
      (v_RLID INTEGER)
   is
   begin
      insert into RLID_MARK 
      (RLID)
      values
      (v_RLID);
   end;
begin
   ins (43230335);
   ins (20936450);
   ins (39685560);
   ins (50833640);
   ins (78406124);
end;
/

Not the answer you're looking for? Browse other questions tagged or ask your own question.