ORA-06550: line 15, column 5: PLS-00103: Encountered the symbol "IF" when expecting one of the follo [message #632864] |
Fri, 06 February 2015 06:14 |
|
orcle_us
Messages: 21 Registered: February 2015
|
Junior Member |
|
|
Hi
I am working on a project and I encountered this error ORA-06550: line 15, column 5:
PLS-00103: Encountered the symbol "IF" when expecting one of the following:
; <an identifier> <a double-quoted delimited-identifier>
current delete exists prior <a single-quoted SQL string>
my code is
declare
cursor c is select * from short_input;
v_count number(2,2);
v_blood char(2) := 'B';
begin
for r in c
v_count:=1;
loop
if (r.no_of_blood_samples)>=1
then
dbms_output.put_line(r.sn||r.patient_id||' '||v_blood.v_count);
else c%notfound
then
raise no_data_found;
end if;
v_count:=v_count+1;
close c;
end loop;
end;
i have also tried by not specifying c%notfound
declare
cursor c is select * from short_input;
v_count number(2,2);
v_blood char(2) := 'B';
begin
for r in c
v_count:=1;
loop
if (r.no_of_blood_samples)>=1
then
dbms_output.put_line(r.sn||r.patient_id||' '||v_blood.v_count);
end if;
v_count:=v_count+1;
close c;
end loop;
end;
ORA-06550: line 16, column 4:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
loop
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
Can anyone help please?
Many thanks
Lalit : Added code tags, however the formatting is still missing. Please do so yourself in future, read How to use [code] tags
[Updated on: Fri, 06 February 2015 06:23] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Re: ORA-06550: line 15, column 5: PLS-00103: Encountered the symbol "IF" when expecting one of the follo [message #632870 is a reply to message #632867] |
Fri, 06 February 2015 07:13 |
|
orcle_us
Messages: 21 Registered: February 2015
|
Junior Member |
|
|
hi
when concatenating a string and a number, i am getting error
ORA-06502: PL/SQL: numeric or value error: number precision too large
ORA-06512: at line 7
06502. 00000 - "PL/SQL: numeric or value error%s"
*Cause: An arithmetic, numeric, string, conversion, or constraint error
occurred. For example, this error occurs if an attempt is made to
assign the value NULL to a variable declared NOT NULL, or if an
attempt is made to assign an integer larger than 99 to a variable
declared NUMBER(2).
*Action: Change the data, how it is manipulated, or how it is declared so
that values do not violate constraints.
my code is
declare
cursor c is select * from short_input;
v_count number(2,2);
v_blood char(2);
v_concat varchar2(10);
begin
v_count:=1;
v_blood:='B';
--v_concat:=v_blood||v_count;
for r in c
loop
if (r.no_of_blood_sample_tubes)>=1
then
dbms_output.put_line(r.sn||r.patient_id||' '||concat(v_blood,v_count));
end if;
v_count:=v_count+1;
close c;
end loop;
end;
|
|
|
|
|
|
|
|
|
|
|
|