We have a problem that it seens not supported in oracle 10g what could be the cause?
Post the query - per the 10g documentation:
...[it's] valid only in hierarchical queries.
Supporting asktom link about using SYS_CONNECT_BY_PATH with 10gR2...
Related
Is there any standard sql command that can show you the current RDBMS and version?
The reason for this question is that I am using a CMS remotely that use a SQL database, but I don't know which RDBMS is being used, so I thought maybe there is standard SQL command to print it, something similar to SQL server's ##version
This is not a direct answer to the question, but since there is no standard sql query or function to show the RDBMS, I will post the queries/functions/vars used to identify it.
-- SQL SERVER
SELECT ##version;
-- Postgres, mysql, mariadb
SELECT version();
-- Oracle
SELECT * FROM v$version;
-- sqlite
select sqlite_version();
Please pay attention that Mysql and Sqlite will show only the version and will not include engine name in contrast to other RDBMS.
I have an Oracle database from which I am selecting a table from a remote postgres database, pg. The column mydate is of type date.
select to_char(mydate,'mm-dd-yyyy') from "pg_table"#pg
For the above query, I am getting an error like
ORA-02070: database PG does not support TO_CHAR in this context
*Cause: The remote database does not support the named capability in the context in which it is used.
*Action: Simplify the SQL statement.
Why is this happening?
Try to use to_date to first make it an oracle date then use to_char to transform
select to_char(to_date(mydate),'mm-dd-yyyy' ) as "Date"
from "pg_table"#pg
Some functions are not supported by the linked server driver to the backend server. I'm having this happen right now where regex_replace is not supported by links to MSSQL. This is just an unfortunate byproduct of using a linked server.
I just found out that Oracle 12c supports correlating a query several levels deep which is unsupported in 11g and previous versions.
select
*
from
tab1 a
where
not exists
(select
*
from
(select
*
from
tab2 b
where a.X = b.X))
But I could not find this documented in Oracle website. Is there any other such hidden SQL features added to Oracle 12c? Are all such changes to SQL in 12c documented somewhere?
To explain this we need to dive into history a little bit.
Ability to use correlated sub-queries with more than 1 level was also in Oracle 10g R1 and it was properly documented (https://docs.oracle.com/cd/B14117_01/server.101/b10759/queries007.htm) back those days...
Oracle performs a correlated subquery when a nested subquery
references a column from a table referred to a parent statement any
number of levels above the subquery.
... but it was not properly working. :)
So starting with Oracle 10g R2 this functionality was disabled and documentation had changed.
Also (if you have an access) you can see Bug 15990897 : QUERY WITH CORRELATED VARIABLE USED IN 2ND LEVEL SUBQUERY FAILS WITH ORA-904 on Metalink (Fixed in Product Version 12.1.0.1.0). I'm not sure why it's considered as a bug given that it works according to documentation (10g R2, 11g R1, 11g R2) but that is how it is.
So, functionality was disabled after 10.1 and before 12.1 but documentation even for 12.2 (https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Using-Subqueries.html) says
Oracle performs a correlated subquery when a nested subquery
references a column from a table referred to a parent statement one
level above the subquery.
Cut a long story short, this functionality is enabled in 12c R1 and 12c R2 but documentation is not fixed and apparently there is no mentioning about this improvement in New Features guide.
PS. As far as I remember standard SQL 2003 allows correlation only to one level deep - everyone is welcome to check (http://www.wiscorp.com/sql_2003_standard.zip).
But Oracle has a lot of improvements above the standard anyway.
I searched the Vertica documentation for the keywords Version and Version Number.
But I couldn't really get any mention of SQL query to select the version of Vertica installed.
I thought there would be some system table that had some version information but couldn't find any.
Is it not possible to get the version of Vertica installed using an SQL query?
Or is it only possible to access version by logging into the Vertica host and checking some directory?
It can be found here: https://www.vertica.com/docs/latest/HTML/index.htm#Authoring/AdministratorsGuide/Diagnostics/DeterminingYourVersionOfVertica.htm
db=> SELECT VERSION();
VERSION
------------------------------------
Vertica Analytic Database v9.1.0-2
(1 row)
Edit from the comments: hopefully a link to a permanent page, which will not become obsolete when new versions come: https://www.vertica.com/blog/version-vertica-running/
Run below Query:
SELECT VERSION();
Sample Output:
Vertica Analytic Database v9.0.1-9
Drupal uses db_query_range() for the reason that not all databases support LIMIT,
can you name a few?
DB2, MSSQL, Oracle, and Informix all do not support LIMIT. As a matter of fact, it's not in the SQL standard. (The standard one is "FETCH FIRST" indeed)
Here is a good source for SQL comparisons: http://troels.arvin.dk/db/rdbms/#select-limit
Microsoft SQL Server does not support LIMIT. It supports the TOP statement which can be used to accomplish similar things. The primary limitation with TOP is the inability to specify an offset.
ms sql, oracle.
and actually LIMIT doesn't exists in ANSI SQL '92 which all modern databases should follow. so currently it's just an unnecessary extension/syntactic sugar/specific sql dialect
DB2, Oracle, and MS SQL Server do not support the LIMIT clause.
Google for <database name> LIMIT, and you'll get to know the equivalent supported clause for that database, or whether LIMIT itself is supported.
On the flip side, ANSI-92 SQL provides the ROW_NUMBER() window function for achieving this, which is supported on many databases. See SELECT (SQL) on Wikipedia.