Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Oracle/OAS and the fly likes Missing IN or OUT parameter at index:: 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Missing IN or OUT parameter at index:: 1" Watch "Missing IN or OUT parameter at index:: 1" New topic
Author

Missing IN or OUT parameter at index:: 1

Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477
Hi Everyone,

I am getting an error which looks something like this.

java.sql.SQLException: Missing IN or OUT parameter at index:: 1
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1728)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3364)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3414)
at SchemaCleaner.AutoTruncate.main(AutoTruncate.java:56)


The part of the code that is causing the error is as follows:




Could you please help me out with this. Its kinda urgent. Thanks!!!
Agador Paloi
Ranch Hand

Joined: Jan 24, 2006
Posts: 118
Export is not an SQL statement so is not executed as a PreparedStatement.
You will need to excute it as a Runtime.

Good luck
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477
So does this mean the only way to do it is runtime??? Is there any way i can incorporate it in the code? Also, is the syntax for the export query ok? Because i changed the PreparedStatement to Statement and I was getting the error and Invalid SQL command.
Agador Paloi
Ranch Hand

Joined: Jan 24, 2006
Posts: 118
I don't think there is an API for export so you will need to use Runtime .
the code would be something like this:


you may also have to stream the output stream for any messaged produced by export.
You should test your export as a command line command to be sure your syntax and parms
are correct.
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 477
Many many thanks Agador for the code example!!!

Also, i would like to know that does the SQL command export read PARFILE from the local system and export the .dmp file to the local???

Could you tell if my syntax of the export query is correct??
Agador Paloi
Ranch Hand

Joined: Jan 24, 2006
Posts: 118
the par and dump file directory are in a directory defined as an external directory to oracle.
The best way to test the parms for your export is to execute it as a command line command .
I dont have you tables, schemas etc to tell you much more.
 
 
subject: Missing IN or OUT parameter at index:: 1
 
Similar Threads
Not closing pre-bound Hibernate Session after HibernateTemplate
java.sql.SQLException: Closed Statement
java.sql.SQLException: Invalid column index
Missing IN or OUT parameter at Index:24 Exception after change in database version
Oracle JDBC driver problem?