Righteous Wrath Online Community

General => Lobby => Topic started by: Darren Dirt on April 17, 2007, 10:53:33 AM

Title: comparing RDBMS syntax
Post by: Darren Dirt on April 17, 2007, 10:53:33 AM
I found this brief reference that lists a dozen syntax quirks and "things to know" amongst the various more popular database systems...

http://search.cpan.org/~timb/dbd-summaries/

e.g. is it UCASE or UPPER when you need to use the LIKE command (which is usually case sensitive)...

http://search.cpan.org/~timb/dbd-summaries/dbd-oracle.pod#Case_Sensitivity_of_LIKE_Operator
http://search.cpan.org/~timb/dbd-summaries/dbd-mysql-msql.pod#Case_Sensitivity_of_LIKE_Operator
http://search.cpan.org/~timb/dbd-summaries/dbd-db2.pod#Case_Sensitivity_of_LIKE_Operator

now you know.
Title: Re: comparing RDBMS syntax
Post by: Mr. Analog on April 17, 2007, 11:17:21 AM
Here's something interesting from the world of DB2...
QuoteThe UCASE or UPPER function is identical to the TRANSLATE function except that only the first argument (char-string-exp) is specified.

In a Unicode database, if a supplied argument is a graphic string, it is first converted to a character string before the function is executed.

So, in the world of DB2 it doesn't matter what you use, it's just calling the TRANSLATE SYSFUN :)

One thing I used to like playing with in MS SQL Server was the SOUNDEX value, I helped write a spell checker a while back. It was a lot of fun to find near matches, etc.
Title: Re: comparing RDBMS syntax
Post by: Darren Dirt on April 17, 2007, 11:46:41 AM
Yeah, I recall spending like 3 hours looking at sample code on the web that used SOUNDEX for various things, including a pretty basic but neato website search engine that had a "thesaurus" and did auto-correcting of your mistyped search terms.


BTW I found it interesting that though DB2/Oracle/MySQL claim to be ANSI SQL compliant (or whatever) they don't have standard syntax for things you'd expect to be obviously core requirements, like UPPER (or is it UCASE, or UPPERCASE, or TOUPPER, or TOUPPERCASE... hmmm... ;) )

Thank goodness for web references for quirks like these -- as Einstein said... (http://www.google.com/search?q=I%20never%20bother%20to%20memorize%20anything%20I%20can%20look%20up) ;D
Title: Re: comparing RDBMS syntax
Post by: Mr. Analog on April 17, 2007, 11:53:04 AM
Quote from: Darren Dirt on April 17, 2007, 11:46:41 AM
Yeah, I recall spending like 3 hours looking at sample code on the web that used SOUNDEX for various things, including a pretty basic but neato website search engine that had a "thesaurus" and did auto-correcting of your mistyped search terms.


BTW I found it interesting that though DB2/Oracle/MySQL claim to be ANSI SQL compliant (or whatever) they don't have standard syntax for things you'd expect to be obviously core requirements, like UPPER (or is it UCASE, or UPPERCASE, or TOUPPER, or TOUPPERCASE... hmmm... ;) )

Thank goodness for web references for quirks like these -- as Einstein said... (http://www.google.com/search?q=I%20never%20bother%20to%20memorize%20anything%20I%20can%20look%20up) ;D

DB2 (8.1) extends most ANSI compliant syntax into existing system functions so, you can use either UCASE or UPPERCASE but it's just going to call another system function (good to know if you run into any threading issues on complex subqueries).
Title: Re: comparing RDBMS syntax
Post by: Darren Dirt on April 17, 2007, 04:57:55 PM
lol, I just found out that UCASE() or UPPER() are equivalent in DB2. I presume one is just an alias for the other.

Anyway, might be a good reference for comparing features for anyone who cares...
Title: Re: comparing RDBMS syntax
Post by: Mr. Analog on April 17, 2007, 09:32:16 PM
Quote from: Darren Dirt on April 17, 2007, 04:57:55 PM
lol, I just found out that UCASE() or UPPER() are equivalent in DB2. I presume one is just an alias for the other.

Anyway, might be a good reference for comparing features for anyone who cares...


Yes, it calls the TRANSLATE system function. ;)