Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / September 2006

Tip: Looking for answers? Try searching our database.

java.sql.SQLException: ORA-01006: bind variable does not exist

Thread view: 
sunil(nani) - 19 Sep 2006 14:08 GMT
ps = conn.prepareStatement(" UPDATE USF_HEA_BENEFIT_AMOUNTS
SET " +
                                         "  BENEFIT_1_2_AMT = ?, " +
                                         "  BENEFIT_3_5_AMT = ?, " +
                                         "  BENEFIT_6_PLUS_AMT = ?, "
+
                                         "  CREATED_BY = '?' " +
                                         "  WHERE " +
                                         "  HEA_BENEFIT_CATEGORY_CDE =
'?' AND " +
                                         "
HEA_BENEFIT_FUEL_CATEGORY_CDE = '?' AND " +
                                         "  INCOME_LEVEL = ? AND " +
                                         "  HEATING_SEASON = ? " );

                       ps.setInt(1, 5)
                       ps.setInt(2, 6);
                       ps.setInt(3, 7]);
                       ps.setString(4, loginId);
                       ps.setString(5, "O");
                       ps.setString(6, "E");
                       ps.setInt(7, 668);
                       ps.setInt(8,07 );
                      count =  ps.executeUpdate();

i provide all 8 parameters and the query is working fin in toad
but when i am executing i am getting

java.sql.SQLException: ORA-01006: bind variable does not exist

any suggestions
joeNOSPAM@BEA.com - 19 Sep 2006 15:13 GMT
> ps = conn.prepareStatement(" UPDATE USF_HEA_BENEFIT_AMOUNTS
> SET " +
[quoted text clipped - 27 lines]
>
> any suggestions

Get rid of the quotes around your string parameter markers in the SQL.
Quotes are for literal fixed strings, not variables. All variables are
marked
with plain question marks.
Joe
sunil(nani) - 19 Sep 2006 15:26 GMT


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.