Re: Inputting into PL/SQL From SQL*Plus
Date: 14 May 94 10:58:55 EST
Message-ID: <1994May14.105855.1_at_corp02.d51.lilly.com>
In article <2qm51k$3q0_at_netserv.unmc.edu>, moswald_at_netserv.unmc.edu (Mike Oswald) writes:
> Mike Oswald (moswald_at_netserv.unmc.edu) wrote:
> : Has anyone tried to used SQL*Plus substitution variables in a PL/SQL
> : block? What I'm trying to do is pass a &&1 or &1 to the PL/SQL block
> : select statment.
> : If you have any ideas...let me know.
> : Thanks.
> : -Mike
>
>
> To explain further...I have records in the database that have duplicates...
> Until the new database is up and running I have to find a way to count
> the number of MAU's and MAU Ports available.
>
> Example: Token Ring #240 has the following MAU & ports.
>
> 01/01 Each Mau can have 8 ports...but the database has
> 01/02 allowed the data entry person to do what they want.
> 01/03
> ...etc...
> 02/01
> 02/02
> ...etc...
>
> What's happening...is that there are records like 01/01, 01/01, 01/01, etc.
> This is okay...SORT OF...
>
> I need to SELECT <blah> MINUS dups. Any ideas?
>
> -Mike
This suggestion might be too simple, but why not use DISTINCT to get rid of duplicates?
SELECT DISTINCT <blah> ...
You can use SPL*Plus & variables in an anonymous PL/SQL block. For example:
accept t_owner -
prompt 'Enter the table or view owner: '
declare
t_owner varchar2(30) := upper('&t_owner');
...
begin
...
end;
.
/
-- Bob Swisshelm | swisshelm_at_Lilly.com | 317 276 5472 Eli Lilly and Company | Lilly Corporate Center | Indianapolis, IN 46285Received on Sat May 14 1994 - 17:58:55 CEST