Re: Where do SQL/PL programs execute from ?

From: Prince Kumar <gspk_at_yahoo.com>
Date: 22 Dec 2003 15:34:52 -0800
Message-ID: <629275ba.0312221534.4b867907_at_posting.google.com>


You can always do this.

SQL> declare

      <your decalarations>
     begin
       <you pl/sql stuff>
     end ;

/

You can have your PL/SQL in a file and call it from SQL*Plus.

SQL> _at_<your pl_sql file>
/

Also make sure to have the server output on, to see your dbms_output results.

Regards,
Prince.

GUEST <a_at_b.com> wrote in message news:<MPG.1a4fda86377a3864989680_at_nntp.slnt.phub.net.cable.rogers.com>...
> On 19 Dec 2003 23:49:14 -0800 faheemrao_at_yahoo.com says...
> > One way to execute it to make it a stored procedure at the end of code
> > and another end;
> > like this
> > creat or replace procedure Test is
> >
> > cursor bc is select * from bank;
> > > cursor brc (bn bank.b#%type) is select t#, city from branch where bn =
> > > branch.b#;
> > > cursor cc (cbn bank.b#%type, ctn branch.t#%type) is
> > > select distinct customer.c#, customer.name, customer.status,
> > > customer.city, account.balance from customer, account
> > > where account.c# = customer.c# and account.b# = cbn and account.t# =
> > > ctn;
> > > begin
> > > dbms_output.put_line
> > > ('+==============================================+');
> > > dbms_output.put_line('| Bank# Name City
> > > |');
> > > dbms_output.put_line
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > cursor bc is select * from bank;
> > > cursor brc (bn bank.b#%type) is select t#, city from branch where bn =
> > > branch.b#;
> > > cursor cc (cbn bank.b#%type, ctn branch.t#%type) is
> > > select distinct customer.c#, customer.name, customer.status,
> > > customer.city, account.balance from customer, account
> > > where account.c# = customer.c# and account.b# = cbn and account.t# =
> > > ctn;
> > > begin
> > > dbms_output.put_line
> > > ('+==============================================+');
> > > dbms_output.put_line('| Bank# Name City
> > > |');
> > > dbms_output.put_line
> >
> > and remove the declare keyword
>
> Ok thanks I'll give it a try...
Received on Tue Dec 23 2003 - 00:34:52 CET

Original text of this message