Guido
04-20-2007, 06:14 PM
...the SQL standard? The other day I was talking about some SQL query with a friend of mine, he use MSSQL and I use MySQL, and in some points it seems that we were speaking completely different languages.I think that's really bad, SQL has an standard!What about if you must change the DBMS?
WickedSmaht
04-20-2007, 06:21 PM
ANSI SQL is indeed a standard, and all of those databases DO follow it. However, a standard is just a subset of the commands a database provides, it's the "bare minimum". For example, an analogy for an automobile could say "it must have 4 wheels, a drivetrain, reliable steering and braking, and headlamps/signal lamps" From there, you could build all the cars on the road, but they could be vastly different implementations. The declarative portion of SQL is standardized (the SELECT,UPDATE,DELETE,INSERT) at the core. Each database can implement extensions to provide crucial capabilities. Oracle's "CONNECT BY" or DB2's "FIRST x ROWS ONLY" and SQLServer's "TOP x" are custom extensions that each deemed worthy of the product. Stored procedure languages are NOT standardized. This is because SQL is a declartive language. Stored procedures are (as implied) "procedural". No vendor would agree to such a standard, because they all have massive frameworks for different capabilities in their procedural libraries. Also, they support different platform sets, so it would be hard to standardize a lot of it. You wouldn't want a handheld database to bloat out with all of the framework included in an enterprise server database, so what portions do you include in the standard? Each product may solve a situation a different way. This is because, when the committees work out a standard, they can only agree to so much without causing someone to have to change their existing products. To migrate a product's support for a standard (like javascript, CSS, SQL, etc) takes a long time. You are telling your customers "please rewrite all your code now that we're following the standard". Your customers may get angry and abandon your upgrade or your product altogether. Research the support of CSS in browers via the ACID tests (ACID2, etc). There are standards for C/C++, Javascript, CSS, Java, ODF (coming) , XML and thousands of other computer things (including hardware). They all have custom extensions by certain vendors. Changing a database can be difficult, but in many cases, there are tools to do such a thing. For individual syntax changes, you may be able to script the changes automatically. Good luck!
www.webstandards.org (http://www.webstandards.org/action/acid2/http://en.wikipedia.org/wiki/SQLhttp://builder.com.com/5100-6388-1046268.html)
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.