Josh Kumar
Does java supports queries with references/Table alias?
0 Answer(s)      5 years and 7 months ago
Posted in : JDBC


I have an Oracle query:SQL> select t.TopicName, p.NumberofPolls from EMSTopic t,EMSPoll p where t.TopicID = p.TopicID and t.TopicName= 'Sybase';

which is working fine in SQL editor but not working programatically. I am getting runtime error:

java.sql.SQLException: ORA-01427: single-row subquery returns more than one row

at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.ttc7.TTIoer.processError(
at oracle.jdbc.ttc7.Oall7.receive(
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(
at oracle.jdbc.ttc7.TTC7Protocol.fetch(
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
at oracle.jdbc.driver.OracleStatement.executeQuery(

Can anyon eplease help me resolve this?

Thanks in advance!


View Answers