Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

SqlCommand

Updated on October 19, 2022

Use SQLCommand when the data source resides in a Microsoft SQL Server database and you want to perform update, insert, or delete commands on the database.

The SQLCommand requires SQL Server 7.0 or greater. The SQLCommand wraps .NET’s SQLConnection component. Note you cannot return data using this component.

Properties

PropertyDescription
Command

The SQL Insert, Update, or Delete statement. Here is an example:

Insert into AQM (AgentID, start, StartStatus, stop, StopStatus, Annotation, AnnotationStatus) Values (AgentID, 'StartDate','StartStatus', getdate(), 'Today', 'Call Recorded', 'True')

Note: Include single quotes with string variables as 'var'.

When you use a statement containing variables, input data ports will appear on the Execute connection block. Here is an example:

Example
ConnectionString

The string used to open the data source. To create the Connection String, browse this property to open the Connection String Editor window. Here is an example:

Connection string editor

In this case the connection string entered was:

Server=".";Initial Catalog="AQM";User Id=sa;Password=

Once you have entered a connection string, click the Test button to verify the connection.

Methods

MethodDescriptionParametersResult Type
ExecuteThe Execute method design block is displayed on the automation when you add the SQLCommand component. Trigger the method to execute the command. As required by Command Void

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us