Skip to content

sqlserver interpolate binary value #3186

Answered by mihaitodor
artemklevtsov asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @artemklevtsov 👋 Please try using root = [ "80B8FD42E350B98111E63F87B9BF576C".decode("hex") ] in the args_mapping. This config works for me:

input:
  sql_raw:
    driver: mssql
    dsn: sqlserver://sa:Password*@localhost:1433
    init_statement: |
      CREATE TABLE test (id binary(16), code nvarchar(9));
      INSERT INTO test VALUES (0x80B8FD42E350B98111E63F87B9BF576C, 'Code123');
    query: |
      SELECT * FROM test WHERE id = ?
    args_mapping: |
      root = [ "80B8FD42E350B98111E63F87B9BF576C".decode("hex") ]

output:
  stdout: {}

PS: Moving to a discussion as per #2026.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@artemklevtsov
Comment options

Answer selected by artemklevtsov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question sql Issues relating to the sql components
2 participants
Converted from issue

This discussion was converted from issue #3185 on February 16, 2025 20:48.