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

Home -> Community -> Usenet -> c.d.o.misc -> Re: creating a stored procedure gets error

Re: creating a stored procedure gets error

From: sybrandb <sybrandb_at_gmail.com>
Date: Thu, 07 Jun 2007 06:27:00 -0700
Message-ID: <1181222820.535125.319710@q69g2000hsb.googlegroups.com>


On Jun 7, 3:11 pm, sunadmn <suna..._at_gmail.com> wrote:
> All I am trying to build a stored procedure inside 10g and I keep
> getting this error:
>
> SQL> @"C:\Documents and Settings\x591833\Desktop\LastDay.sql"
>
> Warning: Procedure created with compilation errors.
>
> SQL> set arraysize 1
> SQL> set maxdata 60000
> SQL> show errors procedure LastDay
> Errors for PROCEDURE LASTDAY:
>
> LINE/COL ERROR
> -------- ----------------------------------------------------
> 4/3 PL/SQL: SQL Statement ignored
> 4/7 PL/SQL: ORA-00922: missing or invalid option
>
> This is the query:
>
> CREATE OR REPLACE PROCEDURE LastDay
> IS
> BEGIN
> set echo off
> set heading off
> COLUMN COUNT FOLD_AFTER 1
> COLUMN GOOD_COUNT FOLD_AFTER 1
> COLUMN FAIR_COUNT FOLD_AFTER 1
> COLUMN PERIOD FOLD_AFTER 1
> select 'COUNT: '||ONLINEFX.EVERYDAY_SUMMARY.COUNT,'GOOD_COUNT: '||
> ONLINEFX.EVERYDAY_SUMMARY.GOOD_COUNT,'FAIR_COUNT: '||
> ONLINEFX.EVERYDAY_SUMMARY.FAIR_COUNT,'UNACCEPTABLE_COUNT: '||
> ONLINEFX.EVERYDAY_SUMMARY.UNACCEPTABLE_COUNT
> from ONLINEFX.EVERYDAY_SUMMARY
> where ONLINEFX.EVERYDAY_SUMMARY.PERIOD = to_char(sysdate-1, 'YYYY-MM-
> DD');
> END;
>
> Does anyone have any idea what may be going on here?
>
> Thanks,
> -Steve

set echo off
set heading off
and the four columns commands are all sql*PLUS commands. There aren't SQL, so you can't use them in PL/SQL.

Apart from that, why aren't you using the solution you were provided 1 or 2 days ago, and on which I took the trouble to explain to you?

--
Sybrand Bakker
Senior Oracle DBA
Received on Thu Jun 07 2007 - 08:27:00 CDT

Original text of this message

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