Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Help with procedure syntax
Hi:
I am trying to learn the subtleties of programming the Oracle back end. My background is Sybase and MS SQL Server so some of the constructs in Oracle seem strange and the books I have don't offer enough lucid help. Well, here it goes:
This works:
create or replace procedure InsertName(namein in varchar2)
as
cursor mycursor is select lastname from res_hold where firstname =
namein;
myvar varchar2(30);
begin
open mycursor; loop fetch mycursor into myvar; insert into names (name) values (myvar); exit when mycursor%NOTFOUND; end loop;
This, replacing the myvar varchar2(30) with myvar mycursor%ROWTYPE does not.
create or replace procedure InsertName(namein in varchar2)
as
cursor mycursor is select lastname from res_hold where firstname =
namein;
myvar mycursor%ROWTYPE;
begin
open mycursor; loop fetch mycursor into myvar; insert into names (name) values (myvar); exit when mycursor%NOTFOUND; end loop;
The question is why?
Thanks in advance,
Carlos.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Tue Sep 21 1999 - 18:14:01 CDT
![]() |
![]() |