Link to home
Start Free TrialLog in
Avatar of jeevankulkarni
jeevankulkarni

asked on

ORA:06550 error

Sometimes I get the following error if I call a procedure from within java, but if I execute it using toad / sqlplus it is working fine. The same procedure works fine sometimes even from java. Please help...

SQL Exception Occured in CALLDN010PT : ORA-06550: line 1, column 228:
PLS-00103: Encountered the symbol "DN010PT"
ORA-06550: line 1, column 460:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

   . ( , * % & - + / at mod rem <an identifier>
   <a double-quoted delimited-identifier> <an exponent (**)> as
   from into || bulk

SQL Exception sqlExcep : java.sql.SQLException: ORA-06550: line 1, column 228:
PLS-00103: Encountered the symbol "DN010PT"
ORA-06550: line 1, column 460:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

   . ( , * % & - + / at mod rem <an identifier>
   <a double-quoted delimited-identifier> <an exponent (**)> as
   from into || bulk

I am using AIX / Oracle 9i.
Avatar of amit_g
amit_g
Flag of United States of America image

Check if the input that is being used to make the SQL statement has a ' (single quote) in it? If yes, you have to escape it with another single quote. So for example if you have

select * from TableName where ColumnName = 'Can't do this'

you should change it to

select * from TableName where ColumnName = 'Can''t do this'

Note '' (2 single quotes) in Can''t.
Avatar of jeevankulkarni
jeevankulkarni

ASKER

No there are no single / double quotes in it ...
post your statement/query, which is giving errors
ASKER CERTIFIED SOLUTION
Avatar of sujit_kumar
sujit_kumar
Flag of United States of America 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
I was building callable statement in a for loop as it had 54 parameters.

int DN010PTPARAM = 54;
cs_dn010pt.append("{call DN010PT(");
for(int i=0;i<DN010PTPARAM;i++)
{
      if(i!=DN010PTPARAM-1)
      {
            cs_dn010pt.append("?,");
      }
      else
      {
            cs_dn010pt.append("?)}");
      }
}

Instead of doing this I built a simple callablestatement as below.

cst_dn010pt = connection.prepareCall("{call DN010PT(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");

This is working.

The prior approach had no problem whatsoever, still it was'nt working the second time I ran the program. It was working once everytime we restarted the server.