Error when Compiling a Stored Procedure
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Error when Compiling a Stored Procedure

  1. #1
    Join Date
    Sep 2009
    Posts
    1

    Error when Compiling a Stored Procedure

    Hello, I have written a stored procedure which compiles with the error message:

    PL/SQL: ORA-00922: missing or invalid option

    If I execute the script in Toad, it works. Below is the script

    SET ECHO OFF
    SET FEEDBACK OFF
    SET SPACE 0
    SET LINESIZE 2000
    SET PAGESIZE 0
    SET VERIFY OFF
    SET HEADING ON
    SET COLSEP |

    spool 'C:\Output_to_flat_file.txt'

    select * from T_TMP;
    SPOOL OFF

    any ideas?

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    they are all sqlplus commands - not commands you can put in a stored procedure

  3. #3
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Adding to Dave's post; please use PL/SQL commands when working on any kind of backend coding.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width