The MSPro Boomi Collection
About
Good Practices & Patterns
Good Practices & Patterns
  • Markus' Boomi Integration
  • Implementation Patterns
    • The Cache Challenge
      • The Get-Or-Create Use-Case
      • PropCache Scripts
    • State Management
      • Example Scenario
      • State-Management in general
      • State-Management Functionality
      • Technical Solutions
        • Boomi File-System Implementation
          • saveState
          • readState & fetchStates
    • Exception Handling
      • Exception vs Error
      • Basic Rules
        • Aggregating Exceptions
      • Exception Handling Pattern
        • User-Defined Exception Messages
        • Catch Exceptions
      • The pattern in practice
        • API Error Handling
          • Single Record Strategy
            • Single Record RES
          • Many Records Strategy (Array)
            • Many Records RES
        • Pre-Condition Check
    • SQL Patterns
      • Script Header
      • General Rules
        • Check using RowCount
        • Check if record exists
        • Pagination and Sorting
        • Parameter - Best Practices
        • Use JSON as a complex parameter
    • Process Patterns
      • Process Route Implementation Pattern
      • Sub-Process or Process Route
    • DateTime
      • The Boomi datetime dilemma
      • Database and Flow
      • Groovy
      • Data Hub
      • Get Current Date
    • Groovy Script Patterns
      • Dynamic Document Properties
      • Dynamic Process Properties
      • Documents
    • Array Elements to Documents
  • MSPro Services
    • Intermediate Storage
      • Example Processes
        • Docs 01 - Update and Create
          • sub.SampleData.Invoice
        • 02 - Upsert and Get
    • Render Templates
  • Tips
Powered by GitBook
On this page
  • How to use parameters
  • Boomi passes all parameters as String
  • More …
  1. Implementation Patterns
  2. SQL Patterns

General Rules

How to use parameters

  • Do not use question marks in your SQL statements.

    SELECT * FROM Contacts WHERE Id=?

  • Do use variables instead: d

    declare @id as varchar(50) = ?

    SELECT * FROM Contacts WHERE Id=@id

Boomi passes all parameters as String

You can use a questionmark and compare it with number, datetime (or other data types), however SQL with then do an implicit conversion. While this is allowed:

SELECT * FROM Contact WHERE BirthDate = ?

it is really not recommended to do it.

  • Do convert all parameters explicitelly to avoid surprises

declare @p1 varchar(50) = ?  -- 
declare @dt datetime = convert( datetime, @p1)
-- select @p1 as StringDate, @dt as SQLDateTime

SELECT * FROM Contact WHERE BirthDate = @dt

More …

Parameter - Best Practices

Pagination and Sorting

Check if record exists

Check using RowCount

Use JSON as a complex parameter