2 Replies - 1077 Views - Last Post: 16 September 2011 - 02:26 PM Rate Topic: -----

#1 Dany123  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 21
  • Joined: 16-August 11

Insert into sequence table

Posted 14 September 2011 - 02:19 AM

CREATE SEQUENCE customer_CUSTID_seq
INCREMENT BY 1
START WITH 1027
NOCACHE
NOCYCLE

table created


I created a sequence table using the method above, but i inserted rows in the sequence table which i created, with a method like this:-

INSERT INTO CUSTOMER (CUSTNAME,LASTNAME,MIDNAME,FIRSTNAME,STATE,SEX,ACCOUNT,SUBORDINATE,REGION
VALUES (customer_custid_seq.NEXTVAL,1020,'Franck','James','Mc''Lord','Ang','Male',000000993384847,'Godwin','East')

But i keep receiving this message all the time

Error starting at line 1 in command:
INSERT INTO CUSTOMER (CUSTID,LASTNAME,MIDNAME,FIRSTNAME,STATE,SEX,ACCOUNT,SUBORDINATE,REGION)
VALUES (customer_custid_seq.NEXTVAL, 1020,'Franck','James','Mc''Lord','Ang','Male',000000993384847,'Godwin','East')
Error at Command Line:1 Column:12
Error report:
SQL Error: ORA-00913: too many values
00913. 00000 - "too many values"
*Cause:
*Action:

Is This A Good Question/Topic? 0
  • +

Replies To: Insert into sequence table

#2 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 946
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: Insert into sequence table

Posted 14 September 2011 - 05:00 AM

You've specified 9 columns but really you're trying to enter 10. From the looks of it you want the sequence to create the customer's id. I'd suggest removing the value 1020 since I see no clear reason for it.
Was This Post Helpful? 0
  • +
  • -

#3 epriddy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 24-August 11

Re: Insert into sequence table

Posted 16 September 2011 - 02:26 PM

If this is a SQL table then you could, instead, create a identity column that starts at 1027...

Create table mytable
(TableKey int identity(1027,1)
,col1 int
,col2 datetime... etc.
)

Is this what you're needing?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1