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 -> Re: Basic SQL Code Help

Re: Basic SQL Code Help

From: Joost Ouwerkerk <joost.ouwerkerk_at_sickkids.on.ca>
Date: Tue, 24 Nov 1998 15:40:25 GMT
Message-ID: <365ad00e.501066241@resunix.sickkids.on.ca>


Try something like this, an SQL script which executes other existing SQL scripts depending on user choice:

SET VERIFY OFF;
SET PAGESIZE 0; PROMPT MENU;

PROMPT -------------------;

PROMPT;
PROMPT 1. Sales Report;
PROMPT 2. Production Report;
PROMPT 3. Employee Report;

PROMPT;
ACCEPT choice PROMPT 'Enter Choice: ';

set termout off;
SPOOL temp.sql;

SELECT decode('&choice','1','@sales;',
                        '2','@product;',
                        '3','@employee;','??Invalid Selection')
FROM DUAL;
SPOOL OFF;
SET TERMOUT ON;
SET PAGESIZE 1000;
@TEMP; Joost Ouwerkerk
Toronto, Canada

On Mon, 23 Nov 1998 21:07:08 -0500, Ryan Jennings <c2mxrsj1625_at_fre.fsu.umd.edu> wrote:

>I need to construct a menu in an [**.sql] format, start it, prompt the
>user for input given a set of options, depending on user input, the user
>may see different tables and views. Have tried if ifelse statements,
>prompt and accept, prompt works but is only half of the problem please
>help.
>
Received on Tue Nov 24 1998 - 09:40:25 CST

Original text of this message

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