2

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.

6
  • 1
    MS SQL Server calls inserted and deleted "special tables", and doesn't have a particular-to-triggers keyword for the current user. "Contextual keyword"? "Virtual table"? – AakashM Jul 29 '14 at 14:31
  • There are as many valid answers as there are database engines. – user22815 Jun 7 '15 at 16:13
  • I'm voting to close this question as off-topic because it is an implementation question. – user22815 Jun 7 '15 at 16:14
  • @Snowman The question is a request for a technical term for an specific concept. How is that an implementation question? – Tulains Córdova Jun 7 '15 at 16:35
  • @user61852 just like the accepted answer states, there are multiple types of terms based on the implementation. Sometimes they are variables, sometimes they are tables, sometimes records. The terms truly are implementation-specific. – user22815 Jun 7 '15 at 16:41
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.