Skip to Content
0

VALUE Operator in SQL Statement

Jun 22, 2017 at 12:33 PM

79

avatar image

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?

SQL
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Fabian Lupa Jun 22, 2017 at 01:03 PM
3

On 7.50 this should work:

SELECT * FROM /scwm/tu_dlv
  WHERE lgnum  = @lv_lgnum
    AND top_hu = @( VALUE #( ) )
  INTO TABLE @DATA(lt).
Show 2 Share
10 |10000 characters needed characters left characters exceeded
0

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.

0