Unix Technical Forum

BUG #2680: Update statement did not work with String object

This is a discussion on BUG #2680: Update statement did not work with String object within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2680 Logged by: Ravindra Email address: ravi@computer.org PostgreSQL version: 8.1.4 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 11:16 AM
Ravindra
 
Posts: n/a
Default BUG #2680: Update statement did not work with String object


The following bug has been logged online:

Bug reference: 2680
Logged by: Ravindra
Email address: ravi@computer.org
PostgreSQL version: 8.1.4
Operating system: Debian
Description: Update statement did not work with String object
Details:

when i create a string object with the SQL statement and feed to
statement.executeUpdate(),nothing happens.
but if i write the sql with in statement.executeUpdate() it works.

Following code does not work
String sql="update FieldOptions set option_description='"+newValue+"'
where field_name='country' and
option_code='"+(this.countryCode.trim())+"'";
Connection cn=context.getDBConnection();
statement=cn.createStatement();
int res=statement.executeUpdate(sql);
cn.commit();

but instead of the "sql" String object if i feed the string directly it
works. as given below

int res=statement.executeUpdate("update FieldOptions set
option_description='"+newValue+"' where field_name='country' and
option_code='"+(this.countryCode.trim())+"'");


pleaese check

thanks

ravindra

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:38 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com