HOLYBIBLETHE
HOLYBIBLETHE

Reputation: 153

SQL*Plus shows invalid character with single quotes

What' the error with this syntax?

SELECT empno, sal*.075, ROUND(sal*.075, 2) bonus FROM emp WHERE ename LIKE ‘%A%’;

The sql statement which gives no error is the one written below.

SELECT empno, sal*.075, ROUND(sal*.075, 2) bonus FROM emp WHERE ename LIKE '%A%';

enter image description here

Upvotes: 2

Views: 2070

Answers (3)

user2001117
user2001117

Reputation: 3777

You have used ‘%A%’. SQL doesn't accept this character - this should be '%A%'.

I could not find this in my keyboard.

Upvotes: 0

syed mohsin
syed mohsin

Reputation: 2938

Problem with the 1st is the single quote. SQL doesn't accept that quote. I dont find the one in my keyboard. May be you copied the query from somewhere.

Upvotes: 0

Andomar
Andomar

Reputation: 238296

‘%A%’;

v.s.

'%A%';

The first has fancy ' characters. The usual cause for that is Outlook's AutoCorrect.

Upvotes: 5

Related Questions