5 Replies Latest reply on Oct 21, 2016 7:16 PM by thatJeffSmith-Oracle

    COLUMN ... NEW_VALUE and substitution variable - does not work

    37559030-843c-492c-b819-ecba18644dd7

      Hi,

       

      I work in Oracle SQL Developer v4.1.1.19 and I have problems with substitution variable filled with COLUMN command.

       

      I want to use substitution variable which will be filled with date of yesterday (in ISO 8601).

      Today is day '20161021', so I want to get '20161020' value and store it into substitution variable, say ld (like last day).

       

      I have used these 3 commands:

       

      SET DEFINE ON

      CLEAR COLUMNS

      COLUMN last_day NEW_VALUE ld

      SELECT TO_CHAR (SYSDATE-1, 'YYYYMMDD') last_day FROM dual;

       

      The last SELECT will return '20161020' value. It is fine.

      But I can not then use ld variable!

       

      When I use SELECT &ld FROM dual;

      I did not get  '20161020' value.

      I get dialog window with "Enter Substitution Variable" title and "Enter value for ld" text.

       

      Can anybody give me any advice?

      Maybe the problém is inside some settings in Oracle SQL Developer? I do not know.

       

      Mirek