Forum Stats

  • 3,840,123 Users
  • 2,262,569 Discussions


Suppress echoing of variable substitution

I have SET ECHO OFF in my script, and use PROMPT to label the results and it works great.

I added a variable with DEFINE, and the substitution echoes to the results window. Is there a way to suppress this?

Best Answer


  • Hi,

    I just tried this using SQL*Plus and with echo off it also echoes the select statement with "old" and "new" showing the substitution variable. I have not tried it with SQL*Cl to see what they do, but we implemented most of these features to mimic what sqlplus does.

    I assume you are trying to omit some sensitive data from the output? I can check with the SQL*Plus team to see if there is a way to achieve your goals if you let me know what your objective is.

  • User_CF2IC
    User_CF2IC Member Posts: 10 Green Ribbon

    I'm just trying to reduce the number of lines in the results window. SET ECHO OFF helps a lot.

    In my example, I just have one substitution variable, but by the time I expand this out, there will be lots of variables and it makes the output really busy and hard to read. A single heading using PROMPT that says in English what the query is doing would be my preference instead of the SQL and all the variable substitutions.

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,169 Employee
    Answer ✓


    I did a little research and figured it out..

    Just add:


  • User_CF2IC
    User_CF2IC Member Posts: 10 Green Ribbon

    Brilliant! Thank you so much!!