Script Development / Microsoft SQL Server
The Microsoft SQL Server connector operation object primarily provides operation methods for Microsoft SQL Server.
The parameters for DFF.CONN(...) are as follows:
| Parameter | Type | Required / Default | Description |
|---|---|---|---|
connector_id |
str | Required | Connector ID |
database |
str | None |
Specify database |
.query(...)
Execute SQL statement. Parameters are as follows:
| Parameter | Type | Required / Default | Description |
|---|---|---|---|
sql |
str | Required | SQL statement, which can contain parameter placeholders.? indicates a parameter that needs escaping;?? indicates a parameter that does not need escaping |
sql_params |
list | None |
SQL parameters |
| Example | |
|---|---|
1 2 3 | |
Dynamic SQL Statements
query(...) and non_query(...) internally use DFF.SQL(...) to construct SQL statements and support constructing complex dynamic SQL statements.
For example, WHERE IN (...) with an uncertain number of values, or INSERT INTO ... VALUES ... for batch data insertion, etc.
For details, please refer to Script Development / SQL Construction DFF.SQL