Exclamation mark in SQL (Oracle)

oracle, sql

Solution

It's a query that has originated on a remote database. The database where you've seen this query in V$SQL has been referenced in the query on the remote database using the @DB_NAME syntax

The remote database has pushed the query to your database for execution, but to answer the query, your database needs to pull some information back from the remote database. This is where the @! comes in, basically it's a reference back to the database where the query originated from

For example, create a test database link, even to the same database, and run this:

alter system flush shared_pool;
select sysdate from dual@myself;
select sql_text from gv$sql where sql_fulltext like '%@!%';

SQL_TEXT
--------
SELECT SYSDATE@! FROM "DUAL" "A1"

Problem

Looking at V$SQL in my database, I have just found a strange query that looks like : ``` UPDATE "MYTABLE" "A1" SET "SOMECOLUMN" = ( SELECT "A2"."ANOTHERCOLUMN" FROM "ANOTHERTABLE"@! "A2" WHERE "A2".ROWID=:B1 ) ``` Does anyone know the meaning of the syntax @! I have never seen something like it before in Oracle Thanks

Original source

Related problems