How to declare variable and use it in the same Oracle SQL script?
I want to write reusable code and need to declare some variables at the beginning and reuse them in the script, such as: DEFINE stupidvar = 'stupidvarcontent'; SELECT stupiddata FROM stupidtable WHERE stupidcolumn = &stupidvar; How can I declare a variable and reuse it in statements that follow such as in using it SQLDeveloper. Attempts Use a DECLARE section and insert the following SELECT statement in BEGIN and END; . Acces the variable using &stupidvar . Use the keyword DEFINE and access the variable. Using the keyword VARIABLE and access the the variable. But I am getting all kinds of