compare a long datatype to a string in select statement
Joined: Oct 05, 2004
Hi, I need to fetch records from the database(oracle) where long data type column is like a string in a java file.when i tried with column like 'string'it gives amessage " inconsistent datatypes". can any one throw some light on this. Thanks in advance.
Joined: Dec 15, 2004
try typecasting the variable to a string and then you can compare them. eg. String.valueOf(<long variable> will convert it to a string.
if you're not going to perform any computation on this, you can also get the data as a string using rs.getString() where rs is the resultset object.