• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ORA-01008: not all variables bound

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
In my application, at runtime, I am getting the following exception:
Description: Class: FdpMbrDatesData Method: executeQuery() : SQLException
java.sql.SQLException: ORA-01008: not all variables bound
I am not able to guess what is the problem with the following portion of the code.
pstmt = rO_conn.prepareStatement(lS_SQLStatement);
pstmt = this.setBindParams(pstmt);
int ii_position = 1;
//set timestamp of query; Take stamp before query as this is the most conservative view
super.setSQLDateTimeStamp(new java.util.Date());
rs = pstmt.executeQuery();

While crossing the "pstmt.executeQuery()" it is throwing the above exception.
It is very Urgent...If any body have any idea please let me know.
Thanks in advance,
Shanmugam.
[ January 20, 2003: Message edited by: Mark Spritzler ]
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not all variables bound. Where in your code do you actually set your bind variables. I don't quite see it assigned. I see one statement "pstmt = this.setBindParams(pstmt);" which looks to try to set them, but pstmt is the statement not the values.
I could be wrong here, but that is my impression. I have worked with prepared statements in JDBC and in VB Command Objects, and usually there are assignment statements like

statement = "Select * from a_table where field_a = :bind_var1"
Then you have a statement that is similar, but in psuedo-code here:
statement.setBind(bind_var1, "My Value")
something along those ines, I don't remember code by heart here, but it would be something similar.
Am I missing anything? Am I completely off base?
Mark
 
Shanmugam Muthukumarasamy
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mark !!! I will try ....
Shanmugam.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is an old thread, but I thought I'd throw something in, in case anyone else runs into the same problem. I just got the same error, and I was stumped for a couple of minutes. My SQL statement looks something like this:

SELECT FIELD1, FIELD2
FROM TABLE1
WHERE FIELD1=?

I set the parameter:

ps.setString(1, "Value")

And yet I still got this error about not binding variables. Huh? So I took a closer look at the code, and I noticed this:

ResultSet rs = ps.executeQuery(sql)

Oops! The sql had already been set when I created the PreparedStatement. By passing it in again at time of execution, I effectively wiped out the parameter I'd already set. This happened because I was refactoring some old code, and changing Statements to PreparedStatements.
 
Anything worth doing well is worth doing poorly first. Just look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic