Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Forcing decode() evaluation

Forcing decode() evaluation

From: Richard Christensen <richard_at_crl.crl.com>
Date: 10 Nov 1998 08:16:28 GMT
Message-ID: <728sos$521$3@nnrp1.crl.com>


Granted I am more of a C programmer than a SQL*PLUS programmer, maybe that is where I am having my problem.

I have the following lines of code that do work.



rem define cheat1="ANSI_M11PS1"
rem host PRINT/QUEUE=&&cheat1 /COPIES=&&ask_copies DIFFUSION_PASSDOWN.LIS

rem define cheat2="PRINT/QUEUE=&&cheat1 /COPIES=&&ask_copies DIFFUSION_PASSDOWN.LIS"
rem host &&cheat2



Now when I try to use a decode statement within a define statement, it isn't evaluated before the host statement. I have tried the following:

define ask_Printer = 1
define ask_copies = 1

define a='decode(&&ask_Printer,1,"ANSI_M11PS1")' define b='&&a'
host PRINT/QUEUE='&&a' /COPIES=&&ask_copies DIFFUSION_PASSDOWN.LIS host PRINT/QUEUE='&&b' /COPIES=&&ask_copies DIFFUSION_PASSDOWN.LIS

When the quotes all work out, VMS complains about not knowing what decode( means. Thus I know that the decode statment is not being evaluated.

As a side note. How does one print out variable in SQL to debug code. Talk about frustration.

--
--

         /\                  /\       .       /\____
 _-_    /  \       _/\      /  \     /\      /      \        /\ 
/   \  /    \     /   \  /\/    \   /  \_/\_/   Y    \  /\/\/  \
  u  \/      \___/     \/        \ /                  \/        \
----------------------------------v--------------------------------
Richard Christensen                                          KC7JPQ     
Austin, TX
richard_at_crl.com Received on Tue Nov 10 1998 - 02:16:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US