Search code examples
datastage

Run database query in datastage with no inputs or outputs


Relatively new to datastage, quite possibly a stupid question.

From datastage, I want to run a database query against a SQL Server database. The query is a delete query with a hardcoded WHERE clause (not my decision).

What I cannot figure out is how to run a query through the ODBC connector without inputs or outputs. If I don't link the connector to either an input or output, the 'Usage' section of the ODBC connector does not appear.

Is it possible to make the 'Usage' section appear without linking inputs/outputs? If not, is there another alternative in datastage to accomplishing what I have described?


Solution

  • DataStage only writes to a database when data comes from a link.

    What you can do is :

    • Put a Row Generator Stage in your Job and configure it to generate one row (with one column)
    • Link that Stage to your ODBC database target
    • Put your static query on the link

    You don't have to use data on the generated row, it's just necessary to trigger action on the target.