Search code examples
sqloracleoracle-sqldeveloper

Set define off permanent


When running queries in SQL Developer and using the character & in my literals, a popup appears asking me to provide a variable. I then execute SET DEFINE OFF; and I can run my query for the rest of the session.

Is there any way to configure Oracle so it can never ask for manual variables when containing the & character?


Solution

  • Create a text file on your PC which contains set define off and any other set-up instructions you might want.

    Then in SQL developer, go to the Tools menu and pick the Preferences... option. In the panel on the left click on Database.

    SQL Developer preferences - Database section

    Then either type the path to the file you created, or click Browse and navigate to the file in the 'Select connection startup script' dialog that appears.

    That script will then be run every time you connect to any database.