Pergunta

I need to do some very specific web search, but in order to do that I need to know what's the technical name of the category/type of variables like NEW, OLD, USER ( the could be more ) that you can accessed inside a trigger in a RDBMS without having to declare them.

The question I want to post is "does <RDBMS> support <xxxx> variables in triggers ?" but I don't know what to put in the <xxxx> placeholder.

For example, variables like this :var in a query are called bind variables.

Foi útil?

Solução

I hope you were looking for a total lack of standardization!

PostgreSQL calls them "special variables".

IBM DB2 calls them "transitional variables".

Oracle calls them both "correlation names" and "pseudorecords".

Microsoft SQL server calls them "inserted and deleted tables".

SQLite does not appear to have a name for them.

I would suggest looking at the "CREATE TRIGGER" manual page for the databases you are interested in, and see if it supports the functionality that you're looking for. You may also need to look at the "CREATE [FUNCTION|PROCEDURE]" page, as some special variables that you're interested in (those other than NEW and OLD) may actually be among those available to all functions/procedures, and so might not appear on the trigger/procedure page.

Licenciado em: CC-BY-SA com atribuição
scroll top