Replace all '&' parameters of a query in SQLDeveloper

1

I have a query that uses multiple times the same parameter, in SQLDeveloper, calls Replacement Variable (VS), for example, &empresa .

If you use this VS with the query below:

SELECT
    *
FROM
    pedido
WHERE empresa   = &empresa;

SQLDeveloper before executing the query, asks for the value of the VA, then it informs and it performs the query.

  

Problem:
  If you create a more complex query, using the same VA more than once, SQLDeveloper asks for the VA value all the time. I would like to know if there is a way to ask only once.

Q: I do not want to use another variable to save the VA value and then use the variable in several places.

    
asked by anonymous 07.06.2017 / 22:19

1 answer

1

Using syntax &variavel , the value assigned to it is temporary, that is, it will only be used in the current SQL clause.

If you use syntax &&variavel , the value assigned is permanent, that is, you can use the same variable in several SQL clauses.

documentation can help you.

    
07.06.2017 / 22:42