Home Answers Viewqa JDBC Does java supports queries with references/Table alias?

 
 


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

Hello,

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(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:1198)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2400)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2672)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:572)
at com.ibm.sample.joinQuery.GetResults(joinQuery.java:37)
at com.ibm.sample.Result.main(Result.java:9)

Can anyon eplease help me resolve this?

Thanks in advance!

View Answers









Related Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.