SQL Command Process

Use the SQL Command API process to automate SQL scripts, which is helpful in exporting data or running SQL scripts on data.

Process Settings

Below are the settings you must define for the SQL Command API process:

Setting Description Sample Value
ProcessID This ID informs Cobra to run the SQL Command process. SQLCommand
SQLCommand This setting refers to the SQL command that runs during the API process. It can either be a one-line SQL command or a file containing a SQL script.

If you specify a SQL script file that contains the statements you want to run, Cobra retrieves the value in this field and checks if it exists as a file. If it does, Cobra loads the contents and runs the file; otherwise, Cobra runs the value directly as a SQL statement.

This setting is required.

C:\ProjectFiles\Deltek\Cobra\sqlexample.sql
SaveAsFile This setting refers to the full path and filename of the data exported after the command runs.

This setting is needed only when the SQL command is a Select command.

If no extension is used, the default is .csv.

If you do not specify a filename, data is saved in the file sql.csv in the Cobra directory.

This setting is optional. By default, this setting is set to not save.

C:\ProjectFiles\Deltek\Cobra\

System\sqlexample.csv

Sample Script

Below is a sample script file for the SQL Command API process:

[Process020]

ProcessID=SQLCommand

SQLCommand=C:\ProjectFiles\Deltek\Cobra\sqlexample.sql

SaveAsFile=C:\ProjectFiles\Deltek\Cobra\System\sqlexample.csv