Re: SQL*PLUS Variable assignment

From: Alan Anderson <aranders_at_kosepc01.delcoelect.com>
Date: 1995/09/11
Message-ID: <432elr$qsg_at_kocrsv08.delcoelect.com>#1/1


snowden_at_haven.ios.com (Roger Snowden) writes:
>Is it even possible to dynamically assign variables in sql*plus? We have
>a developer that wants to create a spool file name dynamically,
>constructed from SYSDATE, like: 0905something.rpt.

The best I've been able to do is to have a wrapper script create another script with the SPOOL command in it and then call that script, something like:

SPOOL FOO.SQL
SELECT 'SPOOL ' || to_char ( SYSDATE, 'MMDD' ) || 'something.rpt' FROM DUAL; SELECT 'SELECT * FROM BAR WHERE D < 500' FROM DUAL; SPOOL OFF _at_FOO

HOST DELETE FOO.SQL

  • === === === = = = === === === === = = === = = = === = = === = # Alan Anderson # Ignorance can be fixed, but stupidity is permanent. # (I do not speak for Delco Electronics, and DE does not speak for me.)
Received on Mon Sep 11 1995 - 00:00:00 CEST

Original text of this message