Link to home
Start Free TrialLog in
Avatar of kaul1
kaul1

asked on

Error in PL/SQL script: PLS-00103

Just got oracle 9i installed  after formatting my XP machine.
when I run below mentioned script in isqlplus it removes the + operator automatically and then gives error.
In another script in which i declare a index by table , it gives me a PLS-00103 error. I think it has got something to do with the Language setting but do not know what to do in order to resolve the issue.I tried checking the browser settings which seem to be fine. Pls guide .

Attached are the two scripts.




Script1:
variable g_dmax number;
set serveroutput on;
define p_dname='Education'
 
declare
v_num number(2):=0;
begin
select max(deptno)+10 into:g_dmax from dept;
v_num:=:g_dmax;
dbms_output.put_line(v_num);
insert into dept (deptno,dname,loc)
values(v_num,&p_num,null);
 
end;
/
 
error1:
old 10: values(v_num,&p_num,null); 
new 10: values(v_num,100,null); 
select max(deptno) 10 into:g_dmax from dept; 
                          * 
ERROR at line 6: 
ORA-06550: line 6, column 20: 
PL/SQL: ORA-00923: FROM keyword not found where expected 
ORA-06550: line 6, column 1: 
PL/SQL: SQL Statement ignored 
 
 
Script 2:declare
 
Type dept_table_type is table of
dept%rowtpe
index by binary integer;
 
dept_table dept_table_type;
 
v_count number(4);
 
begin
 
select*into dept_table from dept;
v_count:=dept_table.count;
for i in 1..v_count loop
dbms_output.Put_line(dept_table.deptno(i));
end loop;
end;
 
error2:
index by binary integer; 
                * 
ERROR at line 5: 
ORA-06550: line 5, column 17: 
PLS-00103: Encountered the symbol "INTEGER" when expecting one of the following: 
. ( % ; 
The symbol "." was substituted for "INTEGER" to continue. 
ORA-06550: line 15, column 1: 
PLS-00103: Encountered the symbol "FOR" when expecting one of the following: 
. ( * @ % & = - + ; < / > at in is mod not rem 
<an exponent (**)> <> or != or ~= >= <= <> and or like 
between || 
The symbol ";" was substituted for "FO 
ORA-06550: line 17, column 1: 
PLS-00103: Encountered the symbol "END" when expecting one of the following: 
:= . ( % ; 
The symbol ";" was substituted for "END" to continue

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Sujith
Sujith
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kaul1
kaul1

ASKER

Thanks ,the binary_integer worked but the + operator issue with the first script  is still a problem.
pls help
Thats strange, first script looks good and works fine for me!
SQL*Plus: Release 9.0.1.0.1 - Production on Sun Mar 2 22:16:43 2008
 
(c) Copyright 2001 Oracle Corporation.  All rights reserved.
 
Connected to:
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
With the Partitioning option
JServer Release 9.0.1.1.1 - Production
 
SQL> variable g_dmax number;
SQL> set serveroutput on;
SQL> define p_dname='Education'
SQL>  
SQL> declare
  2  v_num number(2):=0;
  3  begin
  4  select max(deptno)+10 into:g_dmax from dept;
  5  v_num:=:g_dmax;
  6  dbms_output.put_line(v_num);
  7  insert into dept (deptno,dname,loc)
  8  values(v_num,&p_num,null);
  9   
 10  end;
 11  /
Enter value for p_num: 3
old   8: values(v_num,&p_num,null);
new   8: values(v_num,3,null);
50
 
PL/SQL procedure successfully completed.
 
SQL> 

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kaul1

ASKER

solved
Avatar of kaul1

ASKER

solved thanks
What was wrong exactly ?