View previous topic :: View next topic
|
Author |
Message |
Nithya.U.M Warnings : 1 New User
Joined: 11 Nov 2008 Posts: 21 Location: India
|
|
|
|
We have two tables say Tab1 and Tab2. I need to use a select query which is an union of these tables and move the values into DCLGEN fields.Since the output would fetch only one record at a time which would be present in either of the tables i need to use a "select into" statement instead of a cursor.I have coded it as follows and would like to have an opinion on whether i have implemented the Into and Union correctly as we were not receiving the desired results after the implemetation.
Select col1, col2
from tablea
union
select col1, col2
into
:ws-col1,
:ws-col1
from tableb |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
maybe because you are stuffing everything into the same host variable WS-COL1? also, the syntax does not seem to be correct.
If you want help, stop 'editing your sql' and cut & paste the sql into bbcode.
Unless of course you did cut &paste, which means that my first suggestion may be a place to start. |
|
Back to top |
|
|
|