Search Postgresql Archives

ERROR: operator does not exist: integer = character varying

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I have the following piece of jdbc code

String query = "UPDATE books SET title = ? WHERE book_id=?";
pstmt =conn.prepareStatement(query);
pstmt.setInt(1, new_book_id);
pstmt.setString(2, getStringPrompt("new title"));
pstmt.executeUpdate();

getStringPrompt returns a string and new_book_id is an int.

The structure of the books table is

books((book_id), title, author_id, subject_id)

where title is text, all the other fields are integers. author_id and subject_id are foreign keys. When I try to run the code I get the error message in the subject line and I can't figure out what's wrong.


regards Andreas

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux