Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to run PL/SQL?

Re: How to run PL/SQL?

From: <markp7832_at_my-deja.com>
Date: Thu, 04 Nov 1999 14:20:21 GMT
Message-ID: <7vs4n1$ov2$1@nnrp1.deja.com>


In article <7vrql0$dka$1_at_justice.csc.cuhk.edu.hk>,   "Jeff Lee" <kit_at_cintec.cuhk.edu.hk> wrote:
> Hi,
>
> Do you have experience on PL/SQL?
> Could you share with me how can I get my script work?
>
> Jeff
>

Jeff, could you be a little more specific? You can execute a pl/sql script from sqlplus by issuing the command 'start script_name'

You can place both sqlplus commands and pl/sql into the same script, but you can not inter-mix the two sets of commands, example:

set echo off <== sqlplus commands and comments rem
rem SQL*Plus scripts
rem
set serveroutput on <== Display output of dbms_output in sqlplus spool myspool
declare <== Start of pl/sql; sqlplus not allowed v_date varchar2(08);

--                     Display the Date
begin
select to_char(sysdate,'YYYYMMDD')
into v_date
from sys.dual;
dbms_output.put_line('The date is '||v_date);
end;                            <== End of pl/sql
/                               <== Execute pl/sql
spool off                       <== Back in sqlplus

You can execute a stored procedure from sqlplus using the execute command: execute procedure_name(parameters.....) ;

I hope his helps.
--
Mark D. Powell -- The only advice that counts is the advice that  you follow so follow your own advice --

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Nov 04 1999 - 08:20:21 CST

Original text of this message

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