Query
Execute a single SQL query against Microsoft SQL Server
Query
Execute a single SQL query against Microsoft SQL Server
yaml
type: "io.kestra.plugin.jdbc.sqlserver.Query"Examples
yaml
id: sqlserver_query
namespace: company.team
tasks:
- id: select
type: io.kestra.plugin.jdbc.sqlserver.Query
url: jdbc:sqlserver://localhost:41433;trustServerCertificate=true
username: "{{ secret('SQL_USERNAME') }}"
password: "{{ secret('SQL_PASSWORD') }}"
sql: select * from source
fetchType: FETCH
- id: generate_update
type: io.kestra.plugin.jdbc.sqlserver.Queries
url: jdbc:sqlserver://localhost:41433;trustServerCertificate=true
username: "{{ secret('SQL_USERNAME') }}"
password: "{{ secret('SQL_PASSWORD') }}"
sql: "{% for row in outputs.select.rows %} INSERT INTO destination (year_month, store_code, update_date) values ({{ row.year_month }}, {{ row.store_code }}, '{{ row.date }}'); {% endfor %}"
Properties
sql *Requiredstring
url *Requiredstring
afterSQL string
fetchSize integerstring
Default
10000fetchType string
Default
NONEPossible Values
STOREFETCHFETCH_ONENONEparameters object
password string
timeZoneId string
username string
Outputs
row object
rows array
SubTypeobject
size integer
uri string
Format
uriMetrics
fetch.size counter
Unit
rows