Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Custom Statement

Embedded Object Grooper.Activities

Defines a custom SQL statement to be executed during Data Export.

Remarks

The CustomStatement class allows you to define and execute custom SQL statements as part of the data export process.

Purpose

Use this class to perform advanced or non-standard database operations that are not covered by standard table mappings, such as:

  • Updating related tables based on extracted data.
  • Executing stored procedures or custom logic.
  • Performing conditional updates, deletes, or inserts.

How It Works

  • For each instance of the specified data element (see 'Source Scope'), a custom SQL statement is generated and executed.
  • The statement is defined as a code expression, allowing you to reference field values and perform calculations.
  • Expressions are evaluated in the context of each data instance, enabling dynamic statement generation.

Example Scenarios

  • Marking related records as processed: $"UPDATE invoices SET status=2 WHERE id={Invoice_Id}"
  • Calling a stored procedure: $"EXEC UpdateStatus {Invoice_Id}, '{Status}'"

Notes

  • Use with care: Custom statements are executed as-is and can modify data in any way permitted by the database connection.
  • Ensure that your expressions are safe and validated to prevent SQL injection or unintended data changes.
  • The 'Source Scope' determines how many times the statement is generated and executed (once per instance).

Properties

NameTypeDescription

See Also

Used By

Notification