Ansicht
Dokumentation

ABENABAP_SQL_STMT_LOGEXP - ABAP SQL STMT LOGEXP

ABENABAP_SQL_STMT_LOGEXP - ABAP SQL STMT LOGEXP

ABAP Short Reference   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

- rel_exp for Statements

Short Reference

... ${ ${operand1 ${=$|EQ$|<>$|NE$|>$|GT$|$|LT$|>=$|GE$|=$|LE$}
                  ${  operand2
                  $| ${ $[ALL$|ANY$|SOME$] ( SELECT subquery_clauses $[UNION$|INTERSECT$|EXCEPT ...$] )$} $}$}
    $| ${operand $[NOT$] BETWEEN operand1 AND operand2$}
    $| ${operand1 $[NOT$] LIKE operand2 $[ESCAPE esc$]$}
    $| ${operand IS $[NOT$] NULL$}
    $| ${operand IS $[NOT$] INITIAL$}
    $| ${EXISTS ( SELECT subquery_clauses $[UNION$|INTERSECT$|EXCEPT ...$] )$}
    $| ${operand $[NOT$] IN (operand1, operand2 ...)$}
    $| ${operand $[NOT$] IN ( SELECT subquery_clauses $[UNION$|INTERSECT$|EXCEPT ...$] )$}
    $| ${( operand1, operand2, ... ) IN ( ( operand11, operand21 ... ),
                                        ( operand12, operand22 ... ), ... )$}
    $| ${operand $[NOT$] IN @range_tab$}
    $| ${(cond_syntax)$} $} ...


Effect

Relational expression in a condition of an statement. Logical expressions sql_cond can be formed from the relational expressions shown here for the following conditions:

  • Read accesses

  • Modifying accesses

Possible operands of a relational expression are elementary SQL operands and SQL expressions. The kind of expression and where it is used determine which operands can be used and where. The following principles apply:

  • Operands of the type STRING, RAWSTRING, LCHR, LRAW, or GEOM_EWKB cannot be used. One exception is the expression IS $[NOT$] NULL, which can also evaluate LOBs and geodata types.

A relational expression rel_exp is either

  • true
  • false
  • unknown

The expression is unknown if one of the operands involved contains the null value and is evaluated with a comparison other than IS NULL. The result of joins of relational expressions with unknown results is described under AND, OR, NOT.

In an SQL condition of a statement, the client column of a client-dependent data source of a query or of the target of a write statement cannot be used as an operand due to implicit client handling. This is checked completely in the strict modes of the syntax check from Release .

Notes

  • In comparisons between values determined in the database, it is essential that only operands of the same type and same length are used. This avoids platform-dependent conversion from taking place.
  • If expressions other than the SQL expressions that can be evaluated in the table buffer are used on the left side of a relational expression.

  • If items other than host variables or host expressions are specified on the right side of a relational expression or are used to identify a single record or a generically buffered area.

In other conditions not used for identifications, columns can also be specified in comparisons or when BETWEEN is used. This applies in cases where neither numeric operand has the type DF16_DEC or DF34_DEC, both operands are character-like, or both operands have the type RAW with the same length.
  • A client column can be used as an operand only if implicit client handling is disabled using the obsolete addition CLIENT SPECIFIED for the query or the write statement.
  • The rule that the result of an relational expression is unknown if an operand contains the null value is overridden by an initial ranges table in the expression IN range_tab. It also has no effect if an empty internal table is used for FOR ALL ENTRIES because then the entire WHERE condition is ignored.
  • When SQL expressions occur on the left side of a relational expression, the syntax check is performed in a strict mode, which handles the statement more strictly than the regular syntax check.
  • If in dynamic conditions alias names defined with AS or joins are used, a client column can be accessed outside the strict modes of the syntax check in WHERE conditions and ON conditions, without implicit client handling being disabled using CLIENT SPECIFIED. In this case, there are two conditions for the client column: the implicit condition of the automatic client handler for the current client and the explicitly specified condition. If the current client is not specified in the explicitly specified condition, no rows are selected.





Addresses (Business Address Services)   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 11602 Date: 20240419 Time: 065915     sap01-206 ( 129 ms )