Compilation error [message #478689] |
Tue, 12 October 2010 01:14 |
swapnil_naik
Messages: 269 Registered: December 2009 Location: Mumbai
|
Senior Member |
|
|
I create a simple form....where i display a record 10.
On that form i create a two button i.e. view, add
When i pressed view button i want to show data on form
so i create a trigger on view button
Code is this :
DECLARE
CURSOR C1 IS
SELECT NO,NAME,FLG FROM TEST0;
BEGIN
OPEN C1;
LOOP
FETCH C1 INTO CUR1 ;
EXIT WHEN C1%NOTFOUND;
TEST0.NO = CUR1.NO ;
TEST0.NAME = CUR1.NAME ;
TEST0.FLG = CUR1.FLG ;
END LOOP;
CLOSE C1;
END;
My data block name is test0...
but when i complinig i get a error
which is
encountered symol '=' when one of the expecting following
I didnt get where i mistake
please help me
|
|
|
|
|
|
|
Re: Compilation error [message #478695 is a reply to message #478693] |
Tue, 12 October 2010 01:34 |
|
deepakmannazhi
Messages: 137 Registered: February 2010 Location: Dubai, UAE
|
Senior Member |
|
|
Check the code below
DECLARE
CURSOR c1
IS
SELECT NO, NAME, flg
FROM test0;
cur1 c1%rowtype
BEGIN
OPEN c1;
LOOP
FETCH c1
INTO cur1;
EXIT WHEN c1%NOTFOUND;
test0.NO := cur1.NO;
test0.NAME := cur1.NAME;
test0.flg := cur1.flg;
END LOOP;
CLOSE c1;
END;
here cur1 is cursor variable, a record of type cursor. You must declare a record of cursor type. otherwise use cursor for loop
DECLARE
CURSOR c1
IS
SELECT NO, NAME, flg
FROM test0;
BEGIN
FOR cur1 IN c1
LOOP
test0.NO := cur1.NO;
test0.NAME := cur1.NAME;
test0.flg := cur1.flg;
END LOOP;
CLOSE c1;
END;
This may be more help full to you http://plsql-tutorial.com/plsql-explicit-cursors.htm
Regards
Deepak
[Updated on: Tue, 12 October 2010 01:35] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|