0

I've created student table with student id , first name and last name .I've alos create trigger to generate student id

however when I want to inserte data to the student table I get this error
"not enough values "
here is my inserte statment
INSERT

INSERT INTO STUDENT (SID,FIRSTNAME,LASTNAME)
VALUES ('Joe','Ken);

3
Contributors
3
Replies
25
Views
3 Years
Discussion Span
Last Post by AndrisP
0

your asking for 3 values:
SID,FIRSTNAME,LASTNAME

and only passing 2 back to it 'Joe','Ken'

assuming sid is an auto_incrimenting field just leave it out from the insert statement

INSERT INTO STUDENT (FIRSTNAME,LASTNAME) VALUES ('Joe','Ken');

Edited by jstfsklh211

0

your asking for 3 values:
SID,FIRSTNAME,LASTNAME

and only passing 2 back to it 'Joe','Ken'

assuming sid is an auto_incrimenting field just leave it out from the insert statement

INSERT INTO STUDENT (FIRSTNAME,LASTNAME) VALUES ('Joe','Ken');

I tried what u said , but I still get "not enough values " .. do u think the trigger not working

0

It should be ok if SID is auto_increment or is default value for SID, but ERROR if not

Edited by AndrisP

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.