Multiple choice technology databases

What is the restriction on using UNION in embedded SQL ?

  1. It has to be in a CURSOR

  2. cannot be used in Embedded SQL

  3. No restrictions

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In embedded SQL (SQL within host programs like C, Java, COBOL), UNION operations must be used within a CURSOR declaration. This is because embedded SQL requires explicit result set handling mechanisms - a cursor provides the necessary interface to navigate through the UNION result set row by row. Without a cursor, the host program cannot properly retrieve and process the combined data from the UNION.