Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

VALUE Operator in SQL Statement

0 Kudos

Hi,

I have the following SQL statement and was wondering if it is possible to rewrite it using the VALUE operator to avoid the DATA statement.

DATA(lv_initial) = VALUE /scwm/guid_hu( ).
SELECT * FROM /scwm/tu_dlv 
      WHERE lgnum     = @lv_lgnum
AND top_hu = @lv_initial INTO TABLE @DATA(lt).

I.e., I would like to have something like:

SELECT * FROM /scwm/tu_dlv
      WHERE lgnum     = @lv_lgnum
        AND top_hu    = @VALUE #( )
      INTO TABLE @DATA(lt).

Is this possible? Any suggestions?

1 ACCEPTED SOLUTION

fabianlupa
Contributor

On 7.50 this should work:

SELECT * FROM /scwm/tu_dlv
  WHERE lgnum  = @lv_lgnum
    AND top_hu = @( VALUE #( ) )
  INTO TABLE @DATA(lt).
3 REPLIES 3

fabianlupa
Contributor

On 7.50 this should work:

SELECT * FROM /scwm/tu_dlv
  WHERE lgnum  = @lv_lgnum
    AND top_hu = @( VALUE #( ) )
  INTO TABLE @DATA(lt).

0 Kudos

Thank you both! I was not aware of this. Unfortunately, I am working on release 7.40 at the moment, but at least I can stop searching now.