0

I wrote query in servlet as....

"select Order_No from " + yard + "where Id= '" + idd + "'";

where yard is variable for table name and idd is variable for Id but i still get an error so please tell me my mistack and write proper query example for me...

3 Answers 3

3

No space after table name

"select Order_No from " + yard + " where Id= '" + idd + "'";
Sign up to request clarification or add additional context in comments.

Comments

0

I guess idd is not string, you need not write it within ''. Your code could be like this.

    "select Order_No from " + yard + "where Id=" + idd + "";

Comments

0

I guess there is a space issue between yard and where clause. Try this "select Order_No from " + yard + " where Id='" + idd + "'";

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.