Re: input into pl-sql from sql*plus
Date: 7 Aug 1994 16:21:53 GMT
Message-ID: <3231n1$qte_at_sbctri.sbc.com>
> In a previous article, joefw_at_eosdev2.gsfc.nasa.gov (Joe Fulson-Woytek) says:
>
> >The PLSQL (Version1 with Oracle6) manual has nice examples
> >with PRO*C where a C variable is used inside an embedded
> >PLSQL block. I'd like to do the same thing with SQL*PLUS,
> >but can't find a way to pass the info into the block.
> >Any ideas?
Cann't really think of something you might want to "pass" into a PL*Sql block that you couldn't obtain inside the block but here goes anyway.
Is this what ya want?
connect test/testing
column test_bind_var noprint new_value test_bind_var
select max(salary) test_bind_var
from salaries
/
declare
cursor c1 is
select sysdate
from dual;
begin
for r1 in c1 loop
insert into salary_snapshot (timestamp, max_salary)
values (r1.sysdate, &&test_bind_var);
end loop
end;
/
-- David R. Thrash dthrash_at_sbctri.sbc.com Compuserve: 76217,1304 Thrash & Company 9102 Garland Road, Suite 216 Voice: 214.327.1972 Dallas, Texas 75218 Facsimile: 214.327.3510Received on Sun Aug 07 1994 - 18:21:53 CEST