View previous topic :: View next topic
|
Author |
Message |
nerella_phanindra
New User
Joined: 07 Dec 2005 Posts: 1
|
|
|
|
Is the using of the union allowed in embedded SQL?
If yes, in which host variable (ww-slct1 or ww-slct2) the value will be stored after the following embedded SQL runs or we shud use only one host variable.
EXEC SQL
SELECT DISTINCT 1
INTO :WW-SLCT1
FROM X
UNION
SELECT DISTINCT 1
INTO :WW-SLCT2
FROM Y
END-EXEC. |
|
Back to top |
|
|
jeyakanthan
New User
Joined: 18 May 2005 Posts: 12 Location: chennai
|
|
|
|
yes we can use union in embedded SQL.
Here if the union results in single row no problem the values moved into the
respective host variable.
But if the union results in more than one row then it will lead to error.
You can declare this sql statement as cursor in working storage section it can handle more than one row. |
|
Back to top |
|
|
|