We are developing software that generates and executes SQL queries for Oracle and SQL Server using ODBC drivers. We are researching the possibility to expand to DB2, but I read that there are several versions available. DB2 for LUW, for iSeries and for z/OS.
Are there any differences in SQL of SQL/PLSQL functionality in these versions?
As a ISV, is it possible to get a development environment for DB2 for iSeries or z/OS
As many other answers already say, there are differences between the members of the DB2 family. All DB2 are SQL-99 complaint, and each member has specific features of the following SQL standards (2003, 2006, 2008, 2011). Also, some extra features have been added to each member, for example autonomous transaction or modules in LUW.
There is a group in IBM called SQL Language Council (SLC) and its purpose is to discuss about the DB2 family compatibility. The following articles written by the SQL architects (Serge Rielau and Rick Swagerman) talk about that:
More family matters: Selected common SQL features for developers of portable DB2 applications
Family matters: The SQL Reference for Cross-Platform Development
This group creates a document called SQL Reference for Cross-Platform Development that describe the compatibility between members of the family. The current version is 4.0, and it groups the features of the current DB2 versions.
Also, a recent series of articles in DeveloperWorks talk about the features in each member of the family. That gives you the portability between DB2:
Selected common SQL features for developers of portable DB2 applications
Selected common SQL features for developers of portable DB2 applications (Previous v4)
More info:
DB2 UDB Family On Common Ground
Information on this can be found here:
http://www-01.ibm.com/software/data/db2/linux-unix-windows/index.html
And here
http://troels.arvin.dk/db/rdbms/
However all mentions DB2 versions conform to SQL-92 so the SQL standards are the same across the board
Related
I have a SQL query I want to optimize, so I asked the database owner what version of SQL they were using (since ordinary methods didn't seem to have support). They answered that my version of SQL is not decided by them but by my local SQL client. They claimed to use a system called "DB2", with support for multiple SQL dialects.
I then went on to ask our IT department which version of SQL our client was using (that client being Squirrel SQL). After some fiddling around they logged on to the database, queried it and reported the version of SQL to be DB2.[sequence of decimals].
This is probably a stupid question, but would someone mind clarifying this?
Is the version of SQL I'm using determined by the database I'm accessing or by my SQL client?
If the version of SQL is decided by the database, then which version of SQL is DB2 associated with? Does it use its own version?
"They answered that my version of SQL is not decided by them but by my local SQL client"
That's complete and utter nonsense - those people apparently have no idea what they are talking about.
The SQL dialect that is understood by the server is only defined by that server. The client has absolutely nothing to do with that. If the database server doesn't support some specific feature, no SQL client will change that.
There is an industry standard called ANSI SQL that database vendors implement. Then on top of that they tack on non-standard proprietary stuff, extra commands, keywords, procedural stuff like stored procedures and triggers and cursors, that are not covered by a standard but which they expect will provide useful features that will differentiate them from the competition.
For Db2 11’s compliance with standards see https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.common.doc/doc/c0011215.html. The actual spec is behind a paywall so this is not that helpful. See https://www.whoishostingthis.com/resources/ansi-sql-standards/#sql-ansi-standards-for-database-administration for an explanation of ANSI SQL standards.
Different db2 products (Z/OS, LUW) might have different extensions. Z/OS has to do horrible mainframey stuff that LUW can do without. But you wouldn’t be given a choice, you have to use the commands implemented by the database that you are connected to. The SQL client doesn’t have a role in this.
I want to monitor Oracle database using SQL queries from internal tables. Are there any differences between Oracle for UNIX/Windows/Linux/OS?
In particular, do these tables exist and have the same structure in every platform? Do they change between 10g and 11g?
V$SYSSTAT
V$SESSTAT
v$session
I don't have access to test environments of production systems to check the tables differences.
Yes, internal system views for the same Oracle version are the same on different platforms.
System views might be different between Oracle releases.
You can look for the information in Oracle documentation. It's hard to find anything there but since it's published on-line you can use Google or any other search engine and search for "Oracle 10g V$SYSSTAT", "Oracle 11g V$SYSSTAT", etc.
For instance, docs for V$SYSSTATon 10g show the table exists and gives a list of column names, types and other relevant details. It doesn't mention that this information depends on the OS so we can assume it's universal.
word on the street is that Perl is defined not by a spec but by whatever the current interpreter version happens to accept. Now, let's consider an SQL dialect like TSQL. Is there a published spec of it that would allow making a validator equivalent to the one inside SQL Server? Are there such validators already in existence as open source? And the same question for Oracle.
Ok, so for MySQL I am guessing that validator could be extracted directly from the MySQL codebase. Nevertheless, do they in fact publish the spec itself in case I wanted to make my own validator?
You seem to have an idea of what to do for MySQL. I can't really say much about Oracle apart from that it mostly implements ANSI SQL and the PL/SQL procedural language extensions to SQL can mostly be found here for Oracle 9i.
For SQL Server:
Microsoft Books On Line (BOL) is the official reference spec. There are different pages for different versions of SQL Server, however.
There are a few projects relating to this.
http://www.sqlparser.com/ - This has .NET, Java, COM and VCL versions for Oracle, DB2, Mysql and SQL Server / Sybase (T-SQL). Quite reasonably priced too.
http://www.codeproject.com/Articles/1136/SharpHSQL-An-SQL-engine-written-in-C (c#)
http://antlr.org/ - This looks like a good bet.
I often use this site for formatting of SQL but it also does some validation although it's fairly crude:
http://www.dpriver.com/pp/sqlformat.htm
This is a similar site:
http://www.tsqltidy.com/
I would suggest that writing a validator for SQL even in just one of its variations is a massive undertaking. You could look at the various ISO/IEC standards for ANSI SQL. ANSI SQL-92 is very widely implemented, but there is a SQL:2008 standard as well.
You'd have to pay for the documentation for those standards though and they aren't cheap.
Good luck.
Is there a Toad type application for Sybase? I can't seem to find a single one! I've tried using VS 2008 but can't see the sproc source.
Am assuming Sybase ASE.
Ships with Sybase Central and SQL Advantage as part of the client tools. Sybase Central lets you manage and create tables, views, sprocs etc. SQL Advantage lets you run SQL...
Sybase Workspace is a new tool for ASE, I've never tried it. http://www.sybase.com/products/modelingdevelopment/workspace
ASE ISQL is a free tool that is also useful for running sql, but is less useful for modifiying stored procedures etc. (More of a SQL Advantage replacement). http://code.google.com/p/aseisql/
If you have money to spend then there's also Embarcadero's DBArtisan. http://www.embarcadero.com/products/dbartisan. I've used this and it's pretty good, although their support for MSSQL and Oracle is better than the Sybase support.
RazorSQL has very good Sybase support. Edit / view stored procedures, etc.
SqlDbx at http://www.sqldbx.com/. Very light-weight software promising a lot of editor features. This requires Sybase Open Client to be installed on your workstation.
But I'll recommend using Oracle SQL Developer. I'm presently working through a JDBC connection to a Sybase ASE database using this tool. This seems to be Eclipse-based, but is quite responsive and allows you to view source code for functions and procs too.
Looks like Quest now offers a Sybase version of Toad.
DBeaver is open-source and appears to work fine.
Try Embarcadero Rapid SQL. I recommend you the 7.4 version over 7.6 because it is more stable. Embarcadero Rapid SQL XE is the recent version.
Embarcadero Rapid SQL XE enables
developers and DBAs to produce high
performing SQL code at lightening
speeds. With support for all major
database platforms from a single
interface, teams can standardize on
one powerful heterogeneous SQL IDE
tool.
Squirrel SQL is open source and works pretty well
I'm using CAST SQL-Builder from CAST Software, the debugger in this tool saved me a lot of time.
My team is looking into geospatial features offered by different database platforms.
Are all of the implementations database specific, or is there a ANSI SQL standard, or similar type of standard, which is being offered, or will be offered in the future?
I ask, because I would like the implemented code to be as database agnostic as possible (our project is written to be ANSI SQL standard).
Is there any known plan for standardization of this functionality in the future?
Currently, there are more than one specifications followed by popular proprietary and open source implementations of spatial databases:
The OpenGIS - Simple Features for SQL
ISO SQL Multimedia Specification for Spatial - ISO/IEC 13249-3:2006 - Information technology -- Database languages -- SQL multimedia and application packages -- Part 3: Spatial
PostGIS, Oracle, Microsoft SQL Server and to some limited degree MySQL, all the databases implement the standard interfaces to manipulate spatial data. However, in spite of this fairly standardized features, all databases usually differ on simple SQL level what may make the database-agnostic implementation of your solution tricky. You likely need to survey the features you are interested and compare what various vendors provide.
For example GIS extensions for MySQL and for PostgreSQL both follow OpenGIS "Simple Features Specification for SQL" standard.
I haven't tried it, but Google tells me FDO is "an open-source API for manipulating, defining and analyzing geospatial information regardless of where it is stored". It's listed on osgeo.org - a point in its favour in my opinion.
There are providers for MySQL & Oracle. Disappointingly though SQL Server and Postgis aren't listed on the FDO providers page.
The only standard I know of is http://www.opengeospatial.org/standards/sfs and I don't know how well all the spatial database extensions implement it.
there are a number of geo-databases which are accessible with hibernate spatial
Oracle10g
Postgresql
MySQL
using an abtraction layer like hibernate is a good idea anyways, if you plan to write a database agnostic application. hibernatespatial fills this gap for geo features.