Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Oracle

Journal Chacham's Journal: Oracle: CHAR-padding on compare with a larger literal & LIKE

There are a few Oracle blogs that cover the basics. A simple query to prove a point, test the boundaries, or review a basic action. Like Laurent Schneider's or Andrew Clarke's.

Andrew has an entry on CHARs. CREATE a TABLE using a CHAR(2) or higher, and query it with a literal. I thought that Oracle would only pad the literal until it matches the CHAR. Wrong! It pads the smaller value to the larger. What's the difference? If the literal has *more* spaces than the COLUMN allows. I though that would be an inequality, but Oracle pads the *TABLE's* value to match the literal before the comparison.

Then Laurent comments that with LIKE there is no such automatic padding, with *a historical note.

Kudos to those two.

---
*proudly leaving off the "n".

This discussion has been archived. No new comments can be posted.

Oracle: CHAR-padding on compare with a larger literal & LIKE

Comments Filter:

"And remember: Evil will always prevail, because Good is dumb." -- Spaceballs

Working...