puneet kumar
asked on
Retrieve value from database through JDBC statement.
HI Team ,
I am retrieving value from database through JDBC statement my plsql query is below -
Select * from A union Select * from B.
but when i am retrieving value through JDBC statements its give null . when i am individually running query like Select * from A without using Union its working fine and giving results but when i am using 2 query via Union its give Null. Please tell me where i m wrong .
I am retrieving value from database through JDBC statement my plsql query is below -
Select * from A union Select * from B.
but when i am retrieving value through JDBC statements its give null . when i am individually running query like Select * from A without using Union its working fine and giving results but when i am using 2 query via Union its give Null. Please tell me where i m wrong .
Condition for SQL UNION is that tables must match number and names of columns. You are using "select *" for each one, then, Table B is exactly similar than Table A?
ASKER
I am using the query as below per result is same as above -
String sqlString = Select Employee_ID , Employee_Code from A union Select Employee_ID,Employee_Code from B
its giving null when i am executing below -
result = stat.executeQuery(sqlStrin g);
But if I am running individually one by one its giving result . please let me know where i am wrong.
String sqlString = Select Employee_ID , Employee_Code from A union Select Employee_ID,Employee_Code from B
its giving null when i am executing below -
result = stat.executeQuery(sqlStrin
But if I am running individually one by one its giving result . please let me know where i am wrong.
You shouldn't have problems. Could you put more detail of the java code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.