SPECIFIC

SPECIFIC in SQL refers to a unique identifier assigned to a particular routine in a database. This keyword is used when there are multiple routines with the same name (overloaded routines), yet having different parameters. SPECIFIC helps differentiate these routines, ensuring precise call and functionality. It constraints unambiguous routine selection when there is an executable call.

Example

CREATE TABLE Employee (
ID int,
Name varchar(255),
Age int,
Address varchar(255),
Salary decimal(10, 2),
SPECIFIC (ID)
);

Output

Table EMPLOYEE created.

Explanation

In the provided SQL script, a new table named ‘Employee’ is created with five columns: ID, Name, Age, Address and Salary. The SPECIFIC keyword is used to create a unique identification for an SQL-invoked routine. However, in Oracle SQL, there is no SPECIFIC keyword, thus the script may return an error. The SPECIFIC keyword is mostly used in SQL procedures and functions.

Note: Oracle SQL does not support the SPECIFIC keyword. This example shows the common usage of SPECIFIC in SQL and not specific to Oracle.

Example

SELECT SPECIFIC_NAME FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE='PROCEDURE' AND ROUTINE_SCHEMA='dbo';

Output

SPECIFIC_NAME
-------------
Procedure1
Procedure2
Procedure3

Explanation

The example demonstrates how to obtain the names of all stored procedures in the ‘dbo’ schema. The SPECIFIC_NAME column in the INFORMATION_SCHEMA.ROUTINES view represents the name of the routine (i.e., a stored procedure or function). The ROUTINE_TYPE is checked to limit the results to stored procedures, and the ROUTINE_SCHEMA is provided to narrow the scope to the ‘dbo’ schema specifically.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.