A View Inside My Head

Jason's Random Thoughts of Interest
posts - 86, comments - 178, trackbacks - 22

Knowledge++ [0]

I'm constantly learning new things. I think it is human nature to do so. The sad thing is that a lot of what I learn either becomes trivialized or forgotten, so I don't appreciate that a discovery was made after the fact.

I'd like to change that. I'd like to share my little eye-opening discoveries with whoever has the time to read about them. Thus, I've started a new category on this blog that I call "Knowledge++".

Today's discovery involves ORACLE... you know, the other RDBMS out there in the wild. :-)

My current project uses an Oracle 10g backend. The other day, I realized that PL/SQL does not have a RIGHT() function, as T-SQL does. The alternative method used by Oracle to return the rightmost characters of a string is to use the SUBSTR() function, specifying a negative number for the 'length' parameter.

SUBSTR('123456789', -3) would give you '789'!

My discovery source: http://www.ispirer.com/doc/sqlways38/Output/SQLWays-1-069.html

Print | posted on Wednesday, January 14, 2009 8:25 PM | Filed Under [ Knowledge++ ]

Comments have been closed on this topic.

Powered by: