Home > database >  In the process of oracle stored more than one count () returns the result
In the process of oracle stored more than one count () returns the result

Time:09-30

In the oracle stored procedure has multiple query
Select count (1) the from table1
Select count (2) the from table1
Select count (3) the from table1
Select count (4) the from table1
Want to ask next how to return a result through 1, 2, 3, 4, 5 of the query result can be get in Java, use collection what to use?

CodePudding user response:

Select count (*) c1, 't1' tname the from t1
Union all
Select count (*) c2, 't2' tname the from t2

CodePudding user response:

reference 1st floor selling fruit net reply:
select count (*) c1, 't1' tname the from t1
Union all
Select count (*) c2, 't2' tname the from t2

That I how to return the results?

CodePudding user response:

refer to the second floor qq_32231443 response:
Quote: refer to 1st floor selling fruit net reply:
select count (*) c1, 't1' tname the from t1
Union all
Select count (*) c2, 't2' tname the from t2

That I how to return the results?


This is a result set, if you don't know how to receive in Java, suggest to Java area to ask;

CodePudding user response:

Four out of variables, and then use four variables in the Java code to receive, to cast them into the list or set the bank of China?

CodePudding user response:

The CallableStatement registerOutParameter function as if can return to the cursor, it could be the result set

CodePudding user response:

references from the 4th floor the foliage silent response:
out four variables, and then use four variables in the Java code to receive, to cast them into the list or set the bank of China?

No, because the report is bigger, just count 24, and have each failure accounted for, close to 50, with out

CodePudding user response:

refer to 6th floor qq_32231443 response:
Quote: refer to 4th floor and foliage quiet reply:
out four variables, and then use four variables in the Java code to receive, to cast them into the list or set the bank of China?

No, because the report is bigger, just count 24, and have each failure accounted for, close to 50, with out no

If it is union all in Java using the cursor after receiving?
You said close to 50 that union all also something you write enough
  • Related