values-clause
	Derives a result table by specifying the actual values, using expressions, for
	each column of a row in the result table. Multiple rows may be specified.
SELECT EMPNO, emp_act
FROM EMP_ACT
WHERE PROJNO IN(MA2100, MA2110, MA2112)
UNION
VALUES (NEWAAA, new), (NEWBBB, new)

values-clause最长见的用法是在INSERT语句中,但也可以用在需要SELECT语句的地方。 这就是为什么values-clause在GSP中是用TSelectSqlStatement类来表示的原因。

values-clause的语法构成和SELECT语句非常的不同,

VALUES (1),(2),(3)

因此,当我们处理表示values-clauseTSelectSqlStatement类实例时,必须要小心, 因为很多SELECT语句中的元素这时在TSelectSqlStatement类实例中不存在, 访问这些类属性将会导致NullPointerException的错误。

访问TSelectSqlStatement表示的values-clause

Use this method to get values-clause

public TValueClause getValueClause()

if the return value is not null, then this TSelectSqlStatement instance represents a values-clause.

Since GSP Java version 2.0.6.9(2020-06-18), TSelectSqlStatement.isValueClause() is added to help determine whether a TSelectSqlStatement class represents a values-clause or not.