Application Development and Automation 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: 
Read only

VALUE Operator in SQL Statement

0 Likes
1,402

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
Read only

fabianlupa
Contributor
1,126

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
Read only

fabianlupa
Contributor
1,127

On 7.50 this should work:

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

0 Likes
1,126

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.