0

I've got the following query in my Java code. But when I run it, it says a syntax error in the query.

What am I doing wrong here?

"Inset into department ( dept_name, dept_desc ) values ('" + deptName + "','" + deptDesc + "')"

2 Answers 2

4

Its INSERT not Inset . This is a simple typo. Replace the word.

"Inset into department ( dept_name, dept_desc ) values ('" + deptName + "','" + deptDesc + "')"
 ^^^^^^
Sign up to request clarification or add additional context in comments.

Comments

1

For future reference, as a beginner, using an SQL formatter might help point out the error for nagging issues like these.

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.