dragonore
dragonore

Reputation: 803

Escape characters SQL on Names for Oracle?

Let say you wanted to grant privelages to a users to your database. Now suppose the users are Wilson and Grant. Well as you know "Grant" is a reserved word for SQL. But sometimes people do have a last name "Grant". How would you do that.

GRANT SELECT ON WAREHOUSE TO WILSON, _______________;

???

I'm using Oracle, but if you could tell me what it would be for mysql as well.

Upvotes: 0

Views: 44

Answers (1)

Barmar
Barmar

Reputation: 780688

In MySQL you put the names in quotes:

GRANT SELECT ON WAREHOUSE to 'grant'@localhost;

I'll bet it's similar in Oracle.

Upvotes: 2

Related Questions