Skip to content

DEFINE

DEFINE customer_id = 10;
SELECT * FROM customers WHERE id = &customer_id;
UNDEFINE customer_id;
idfirst_namelast_nameemail
10JohnDoejohn.doe@example.com

In the example, the DEFINE command is used to create a substitution variable named customer_id with a value of 10. This substitution variable is then referenced in the SELECT statement using an ampersand & just before the variable name to retrieve the customer record with id 10. The UNDEFINE statement at the end removes the substitution variable.