Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).

×
Oracle

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

Journal by Chacham

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:

If you think the system is working, ask someone who's waiting for a prompt.

Working...