SBM ModScript Reference → Programming SBM ModScript → Object Types → AppDb → AppDB ExecuteSQL() Method
(SBM On-Premise/PaaS only) Executes SQL in the database. See important notes below.
| Parameter | Type | Description |
|---|---|---|
|
sqlText |
string |
The SQL to pass in. |
|
params |
Vector |
An optional Vector storing SQL bind parameters, where each entry is a Pair, with the first value as the parameter type and the second value as the value to bind to the SQL parameter. Corresponds to DBTypeConstants. See Pair, Map_Pair, and Dictionary_Pair. |
| Type | Description |
|---|---|
|
None |
SBM ModScript version: 11.4.1.
Shell.Db().ExecuteSQL(
"with uvh as ( select TS_ID from TS_USER_VIEWHISTORY with(nolock)
where TS_USERID = ? and TS_TABLEID = ? and TS_ITEMID = ? )
update u set u.TS_TIMESTAMP=GETUTCDATE()
from TS_USER_VIEWHISTORY u join uvh on u.TS_ID=uvh.TS_ID",
[ Pair( DBTypeConstants.INTEGER, 8 ),
Pair( DBTypeConstants.INTEGER, 1006 ),
Pair( DBTypeConstants.INTEGER, 2 ) ] )
Use caution when changing the database directly:
Copyright © 2007–2020 Micro Focus or one of its affiliates. All rights reserved.