4 Replies Latest reply on Aug 31, 2011 9:03 PM by Joe Weinstein-Oracle

    java.sql.SQLException: ORA-06550: line 1, column 28:PLS-00103: Encountered

    856967
      I did a couple of things like fix the type that was being passed etc., and I get this exception now

      java.sql.SQLException: ORA-06550: line 1, column 28:
      PLS-00103: Encountered the symbol "COMPUTER" when expecting one of the following:

      . ( ) , * @ % & = - + < / > at in is mod remainder not rem =>
      <an exponent (**)> <> or != or ~= >= <= <> and or like like2
      like4 likec as between from using || multiset member
      submultiset
      The symbol ". was inserted before "COMPUTER" to continue.

           at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
           at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
           at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
           at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
           at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
           at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
           at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:204)
           at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1006)
           at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
           at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
           at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3677)
           at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4714)
           at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
           at dao.CallableStatementDAO.callProcedure(CallableStatementDAO.java:69)
           at integration.IntegrationService.main(IntegrationService.java:192)

      what could it be ?
      backend query inside procedure :-
      insert into table_table (OPPORTUNITY_NAME) VALUES('');
        • 1. Re: java.sql.SQLException: ORA-06550: line 1, column 28:PLS-00103: Encountered
          Joe Weinstein-Oracle
          You're going to have to show your JDBC code. The
          problem is going to be there. Continue this,
          showing your JDBC code, in the basic JDBC forum:

          forums.oracle.com/forums/forum.jspa?forumID=1050
          • 2. Re: java.sql.SQLException: ORA-06550: line 1, column 28:PLS-00103: Encountered
            856967
            public void callProcedure(String value) throws SQLException {


            if (paramName != null) {

            // for (int i = 0; i < values.length; i++) {
            // cstmt.setString(paramNames, values[i]);


            cstmt.setString(paramName, value);
            }
            else {
            System.out.println("paramName is null");
            }


            cstmt.execute();

            }

            /**
            * Commits the current transaction.
            *
            * @throws SQLException
            */
            public void commitTransaction() throws SQLException {
            connMgr.commitTransaction(conn);
            }

            // @Override
            // public void finalize() {
            // connMgr.releaseConnection(conn);
            // }

            private static OracleCallableStatement prepareCall(OracleConnection conn,
            String packageName,
            String procedureName,
            String paramName)
            throws Exception {
            String sql;
            if (packageName == null || packageName.equals("")) {
            sql = "{call " + procedureName + "(";
            } else {
            // sql = "{call " + packageName + "." + procedureName + "(";
            sql = "{call " + packageName + "." + procedureName + "(";
            }

            if(paramName != null) {
            sql += "?";

            }

            sql += ")}";

            return (OracleCallableStatement)conn.prepareCall(sql);
            }


            Inside Integration.java

            try{
            String Opportunity = null;
            Opportunity = OPPORTUNITY_NAME.getAccountName().toString();
            System.out.println("oppty after converting to string is...."+Opportunity);
            service.connMgr = ConnectionManager.getConnectionManager();
            System.out.println("Got the connection to the database");
            service.complete = new CallableStatementDAO("test2", "UpdateAAA", Opportunity);
            }
            catch (Exception e) {
            e.printStackTrace();
            System.out.println(e.getMessage());
            }

            there is no other code, just the two classes and some query in the backend
            • 3. Re: java.sql.SQLException: ORA-06550: line 1, column 28:PLS-00103: Encountered
              856967
              I took off most of the code at the DAOController

              throws Exception {
              String sql = null;
              // if (packageName == null || packageName.equals("")) {
              // sql = "{call " + procedureName + "(";
              // } else {
              // sql = "{call " + packageName + "." + procedureName + "(";
              // sql = "{call " + packageName + "." + procedureName + "(";
              // }

              if(paramName != null) {
              sql += "?";

              }

              // sql += ")}";

              return (OracleCallableStatement)conn.prepareCall(sql);
              }
              and I get
              java.sql.SQLException: Invalid column index
                   at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:5303)
                   at oracle.jdbc.driver.OracleCallableStatement.setString(OracleCallableStatement.java:5939)
                   at oracle.jdbc.driver.OracleCallableStatementWrapper.setString(OracleCallableStatementWrapper.java:250)
                   at dao.CallableStatementDAO.callProcedure(CallableStatementDAO.java:62)
                   at integration.IntegrationService.main(IntegrationService.java:192)
              • 4. Re: java.sql.SQLException: ORA-06550: line 1, column 28:PLS-00103: Encountered
                Joe Weinstein-Oracle
                print out the SQL string you actually create, in total, before you set parameters or execute it.
                Also print out the index number you come up with for the setString() call. It will be good for
                you to know that the index for parameters starts at one, not zero, and it doesn't look like
                you're getting that right.