0

This is my script to ask the user to input data values for each item, now my question is if the first values are

Criminal_ID Last First Street City   State Zip   Phone V_status P_status
1015       Fenter Jim       Chesapeake VA  23320           N      N

and there is no Street or phone listed how do I run this and not get an error. It also says No value needs to be entered at the prompt if it should be set to the DEFAULT column value.

INSERT INTO Criminals 
    VALUES ('&Criminal_ID', '&Last', '&First', '&Street', '&City','&State','&Zip', '&Phone', '&v_status', '&p_status');

2 Answers 2

5

Here's the INSERT Syntax

    INSERT INTO Criminals (ColName1, ColName2, ColName3... etc)
    VALUES (Value1, Value2, Value3... etc)

Make sure that the number of columns equals the number of values separated by commas.

Sign up to request clarification or add additional context in comments.

Comments

0

Alternative answer, use DEFAULT in values-list:

INSERT INTO Criminals VALUES (Value1, Value2, DEFAULT, Value4, DEFAULT, ...)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.