Re: PL/SQL run from SQL*Plus

From: Martin Jarvis <smj_at_jbecpor.demon.co.uk>
Date: Mon, 8 Mar 1993 08:29:15 +0000
Message-ID: <C3KA8r.E48_at_jbecpor.demon.co.uk>


mcgrathm_at_vax1.tcd.ie wrote:

: Hi Folks,
 

: I wish to run a PL/SQL script from SQL*PLUS. However
: I am getting error messages such as:-
:
 

: Unknown command beginning "Cursor .." rest of line ignored
 

: This occurs for each of the PL/SQL commands. I have appended the script
: below.
 

: My Questions are (1) Can PL/SQL be run as a script from SQL*PLUS ?
: (2) If so, what are the syntax requirements to do this ?
: (3) What system changes are needed.
 

: All help will be very welcome.
 

: Many Thanks,
:
: Michael.

: declare CURSOR C1 IS
: SELECT I.SESSION_CODE,req_TIME,X_LENGTH,FULL_SESS,
: START_TIME,MINS,EXAM_DATE
: FROM I.INVIG_SESSION I,X_SESSION X
: WHERE I.SESSION_CODE = X.SESSION_CODE
: AND X.SESSION_CODE IN (SELECT SESSION_CODE
: FROM INVIG_SESSION
: WHERE INVIG_SESSION.STUD_NO = '123456');

: CREC C1%ROWTYPE;
: FINISH NUMBER;
: BEGIN   

: OPEN C1;
: LOOP
: FETCH C1 INTO CREC;
: EXIT WHEN CREC%NOTFOUND;
: MESSAGE (CREC.I.SESSION_CODE);
: END LOOP;
: END; : / Yes you can run PL/SQL scripts in SQL*Plus. Do you have the TPO option installed ? Regards,

Martin


   Martin Jarvis                         |    John Brown E & C Ltd,
   smj_at_jbecpor.demon.co.uk               |    1 Buckingham Street, 
   Martin Jarvis /JBEC-Portsmouth, IT | Portsmouth, Hampshire, UK
Received on Mon Mar 08 1993 - 09:29:15 CET

Original text of this message