Pular para o conteúdo principal

ReturnFromSQLComplex

Structure

ReturnFromSQLComplex(sSQL, sAction)

Parameters

| Parameter | Type | Description
| sSQL | String | the sql to be run against the IndySoft database. This sql should return only 1 field, and only the top record will be returned. The text should NOT end with a semicolon.sAction | String | Must 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.) |

Return Value

String

Description

This function is used to execute sql against the IndySoft database and return a single field and single record of data. So this function should only be used for returning precise information, typically used to populate other event fields. 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

sOwner = ReturnFromSQLComplex("SELECT GAGE_OWNER FROM GAGES WHERE COMPANY = '" &

LookupEquipmentCompany & "' AND GAGE_SN = '" & LookupEquipmentID & "'", "OPEN")

ShowMessage("This gage is owned by " & sOwner)

Application Compatibility

IndySoft Calibration Management, IndySoft Commercial Lab Management, IndySoft Tool Management

Also See

RunSQLComplex |