Skip to main content

RunSQLComplex

Structure

RunSQLComplex(sSQL, sAction)

Parameters

ParameterTypeDescription
sSQLStringthe sql to be run against the IndySoft database. The sql should NOT end with a semicolon.
sActionStringMust be either 'OPEN' or 'EXEC'. This determines whether an Open action is called or an ExecSQL. If using ReturnFromSQL or RunSQL IndySoft auto-determines this from the presence of SELECT keyword at start - but in complex scenarios this is not always the case (DECLARE section, calling a stored procedure, etc.)

Description

This function is used to execute sql against the IndySoft database. Note: this function works much like RunSQL, but does NOT do any automatic addition of NOLOCK syntax for SQL Server, and does NOT auto-insert owner from connection settings - this must all be done in sql text.

Example

RunSQLComplex("UPDATE GAGES SET GAGE_OWNER = 'TEST' WHERE COMPANY = '" &
LookupEquipmentCompany & "' AND GAGE_SN = '" & LookupEquipmentID & "'", "EXEC")

See also

ReturnFromSQLComplex