Monetize360

Load Data from Database

Execute SQL queries against database connections and optionally load results into Objects

Load Data from Database

Execute SQL SELECT queries against external database connections and optionally load the results into Objects. This function provides secure database connectivity with SQL injection protection and field mapping capabilities.

Technical Name: DbDataLoadFunc

Properties

  • Execution Mode: SYNC
  • Type: NATIVE
  • Category: System Functions
  • Function ID: 343e5e27-2e72-4156-8044-2460405a33fe

Input Schema

Required Parameters

ParameterTypeDescription
connectionIdstring (uuid)UUID of the database connection to use
sqlQuerystringSQL SELECT query to execute (SELECT statements only)

Optional Parameters

ParameterTypeDescription
mobjectIdstring (uuid)UUID of the Object where results will be stored. Omit for query-only execution
batchSizeintegerBatch size for processing large result sets when creating MData (default: 1000, max: 10000)
fieldMappingsobjectField mappings to transform source data fields to target MData fields

[Image placeholder: DbDataLoad function configuration panel]

Input Example

Query-Only Execution

Execute a query and return raw data without storing:

{
  "connectionId": "database-connection-uuid",
  "sqlQuery": "SELECT customer_id, customer_name, email FROM customers WHERE status = 'active'"
}

Data Loading with Object

Execute a query and load results into an Object:

{
  "connectionId": "database-connection-uuid",
  "sqlQuery": "SELECT customer_id, customer_name, email FROM customers WHERE created_date >= '2024-01-01'",
  "mobjectId": "customer-mobject-uuid",
  "fieldMappings": {
    "customer_id": "customerId",
    "customer_name": "customerName"
  },
  "batchSize": 1000
}

Output Schema

FieldTypeDescription
successbooleanWhether the operation completed successfully
recordsProcessedintegerTotal number of records processed from the query result
recordsCreatedintegerNumber of records successfully created in the Object (equals recordsProcessed for query-only mode)
recordsFailedintegerNumber of records that failed to be created (0 for query-only mode)
executionTimeMsintegerTotal execution time in milliseconds
errorsarray (string)List of error messages if any failures occurred

Output Example

{
  "success": true,
  "recordsProcessed": 1000,
  "recordsCreated": 995,
  "recordsFailed": 5,
  "executionTimeMs": 1234,
  "errors": [
    "Record 123: Validation failed - email format invalid"
  ]
}

[Image placeholder: DbDataLoad output visualization]

Security Features

  • SELECT-Only: Only SELECT statements are allowed
  • Dangerous Keywords Blocked: Blocks DROP, DELETE, UPDATE, INSERT, ALTER, CREATE, TRUNCATE, EXEC, EXECUTE
  • Prepared Statements: Uses parameterized queries internally

Use Cases

Data Migration

Migrate data from legacy systems:

Start → DbDataLoad(Extract) → TransformData → InsertMData → End

Scheduled Synchronization

Sync data from external databases on a schedule:

{
  "connectionId": "source-db-connection-uuid",
  "sqlQuery": "SELECT * FROM external_customers WHERE updated_date >= '2024-01-01'",
  "mobjectId": "customer-mobject-uuid",
  "batchSize": 2000
}

[Image placeholder: Database loading workflow examples]