Phocas has a new user documentation site. This site will be retired soon.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 28 Next »

Related articles

Specifying parameters that can be used in SQL queries, connection strings and file paths allows you to use a single Sync file for multiple 'organisations' in Phocas. These parameters are passed to Sync, with the result that the information structure is sent to other organisations. 

The following data item types reference parameters:

  • SQL
  • File
  • Directory.

Defining parameters

  1. Select the Parameters tab in Sync.
  2. Select Add button to create a new parameter.
  3. Enter the parameter name and a value into the table, noting that:
    • Parameter names are alphanumeric only. Special characters can not be used.
    • Values can not contain parameters.
    • Double quotes can not be used in values.
       

Using parameters as values in supported types

Example of use: Connection string 


Example of use: SQL

Parameter substitution in scheduled Syncs

You can substitute different values for defined parameter via scheduled Syncs (SyncCLI). To substitute a parameter value, the “-p” switch is used, followed by the parameter name and quoted value. The quoted value is only used for the duration of the session i.e. the original value defined in Sync remains unchanged.

-p:parameterName “newValue”

-p:server ”localhost“

* Note if a parameter name contains spaces, it must also be quoted:

“-p:My Server” “localhost”

“-p:Test Database” “Testing”

Examples- format for substituted parameters

-p:server: “DatabaseServer“

-p:database "Sales2016"

-"p:db table" "Sales Customers"

-p:columns "ID, Address"

Multiple parameters

You can substitute a number of parameters for a range of data items.

Example


These multiple parameters can be entered in the Arguments field in a scheduled task:

-r "c:\temp\new sync\multipleparameters.sync" -user "John User" -password "myPassword" -service "http://company.example.com" -source "Sales" -p:server "DatabaseServer" -p:database "Sales2016" "-p:db table" "Sales Customers" -p:columns "ID, Address" "-p:sales directory" "C:\temp\Sales" -p:filePath "C:\temp\Customers.txt"



  • No labels