Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ P&ID

ExecuteSQLProcedure Macro

  • Last UpdatedJan 30, 2025
  • 2 minute read

The macro executes SQL procedure(s) defined in the file names set in the user defined directive: USER_SQL_PROCEDURES. If no path is set, the application assumes the script file is located in the validation folder.

The macro returns data produced by the SQL procedure into an excel file, provided the user defined directive: USER_SQL_VIEW_RETURNED_DATA is set to value = YES. Otherwise, the application executes the SQL procedure and discards any returned data.

To execute more than one stored procedure, concatenate the SQL script filenames using a semi column (;) as a character delimiter.

Note:
The macro can be executed manually by the user with a command defined in the lisp routine: AVVMAC_EXESQL.

The Command prompt will then display:

Are you Sure that you want to execute SQL procedure from command line <Y,N>

Input Y at the prompt.

The example displays data returned in an excel output file from an SQL procedure.

SELECT TOP (1000) *

FROM [PidReports_TRA-CPY].[dbo].[LINELIST]

TitleResults for “How to create a CRG?”Also Available in