Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel3

Info
iconfalse
titleRelated 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 same information structure is sent to a different organisation. 

Data item types that reference parameters

  • SQL
  • File
  • Directory.

Defining parameters

Select the Parameters tab in Sync.

Enter the parameter name and its /value pair into the table, noting that:

  • Parameter names are alphanumeric only. Special characters can not be used.
  • Values can not contain other parameters.
  • Values can not contain double quotes.

 

Defined parameters can be referenced by supported data item types as substitution values. For example, a SQL data item can have the majority of its properties defined by parameters:

Parameters

 

Connection details

Parameter substitution

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”

 

 

The format for using parameters:

Path to sync file:

-r "c:\temp\new sync\sqlparameters.sync"

Server connection switches:

-user "phocas"

-password "phocas"

-service "http://localhost"

-source "ParametersBro"

Substituted Parameters

-p:server: “localhost“

-p:database "phocas_testing_sales"

-p:table "entity_1"

-p:columns "cat_3,cat_4,cat_5"

 

Example of a scheduled Sync substituting a number of parameters for a range of data items (formatted for readability):

-r "c:\temp\new sync\multipleparameters.sync"

-user "phocas" -password "phocas" -service "http://localhost" -source "SyncParamsFile"

-p:server "localhost"

-p:database "phocas_testing_sales"

"-p:My source table" "entity_1"

-p:columns "cat_3,cat_4,cat_5"

"-p:sales directory" "C:\temp\Sales"

-p:filePath "C:\temp\Customers.txt"

 

bits

invalid parameters?

names/values - alphanumeric. special characters?

  • Ability to specify parameters that can be used in SQL queries, connection strings and file paths.
    1. Parameters are specified by using handlebars {{variable}}.
  • Parameters can be configured in a parameter tab (last tab) which takes name value pairs.
    1. Parameter names and values are edited within the table.
    2. Parameter name is alphanumeric. No special characters allowed.
    3. Values can not contain other parameters.
    4. Values can not contain double quotes.
  • Parameters can be specified as arguments for SyncCLI.
    1. Parameters specified by /p:name=value.
  • Datasource name, service URL, username and password can be specified as arguments for SyncCLI.
  • /source:data source name
  • /service:service URL
  • /username:username
  • /password:password