Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Stored Procedure problem
In article <Js4x4.53$2h7.18246_at_newnews.hk-r.se>,
"Samuel Wikberger" <ia97swi_at_student.hk-r.se> wrote:
> Hi,
>
> I have a problem when I try to create a Stored Procedure in my
Oracle8i. I
> have tried the following:
>
> CREATE OR REPLACE PROCEDURE my_proc
> AS
> CURSOR my_cursor IS
> SELECT name FROM Person
> WHERE name LIKE '%c%';
> BEGIN
> FOR i IN my_cursor LOOP
> RDBMS_OUTPUT.PUT_LINE(i.name);
> END LOOP;
> END my_proc;
> /
>
> This won't work and I get an error message that looks something like
> "Procedure created with compilation errors".
> If anyone knows how to solve this problem, I would be very happy.
>
> /Samuel
> Few things:
o in sqlplus run : set serveroutput on
o run your create script
o run show errors that should tell you more about what's going on
o your trouble could be that RDBMS_OUTPUT package does not exit
try DBMS_OUTPUT.PUT_LINE('fish');
SQL> CREATE OR REPLACE PROCEDURE my_proc
2 as
3 CURSOR my_cursor IS
4 select name from person where name like '%c';
5 begin
6 for i in my_cursor loop
7 dbms_output.put_line('fis');
8 end loop;
9 end my_proc;
10 /
Procedure created.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Mar 07 2000 - 05:31:14 CST
![]() |
![]() |