Javatpoint Logo

Exception in thread "main" java.sql.SQLException: ORA-06550: line 1, column 7:

By: rickys*** On: Sun Nov 24 04:02:44 EST 2013     Question Reputation5 Answer Reputation0 Quiz Belt Series Points0  5Blank User
Ques 1) I am compile and run the following program then i am getting the exception at run time?

Exception - Exception in thread "main" java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00201: identifier 'INSERTR' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4223)
at Procedure.main(Procedure.java:16)


Program -

import java.sql.*;

class Procedure
{
public static void main(String args[]) throws Exception
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe",

"system", "oracle");

CallableStatement cstmt = con.prepareCall("{call insertR(?, ?)}");
cstmt.setInt(1, 1011);
cstmt.setString(2, "Amit");
cstmt.execute();

System.out.println("Success");
}
}


NOTE - I am using oracle 10g database

I am create the procedure in run sql command line
create or replace procedure "INSERTR"(id IN NUMBER, name IN VARCHAR2) is begin insert into user420 values(id, name);
end;

Note - I am already create the table whose name user420

what should i do now
Up0Down

 
Make sure you have entered the correct query.Image Created0Down

By: [email protected] On: Sun Nov 24 05:04:12 EST 2013 Question Reputation0 Answer Reputation359 Belt Series Points0 359User Image
Are You Satisfied :0Yes0No
 
I am entered the correct queryImage Created0Down

By: [email protected] On: Sun Nov 24 07:44:59 EST 2013 Question Reputation5 Answer Reputation0 Belt Series Points0 5User Image
Are You Satisfied :0Yes0No
 
There are several possible causes:

The package (and procedure) are in a different schema, e.g. you compiled it as user A but are trying to call them as user B.
You don't have the access right to execute procedures from the package. Thus it becomes invisible.
You have defined the procedure in the package body, but haven't declared it in the package header.



If you call a procedure without arguments, the prentheses shoul be omitted:
Image Created0Down

By: [email protected] On: Mon Nov 25 05:31:33 EST 2013 Question Reputation0 Answer Reputation392 Belt Series Points0 392User Image
Are You Satisfied :0Yes0No