<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dafne.bi-services.sk/index.php?action=history&amp;feed=atom&amp;title=Placeholders</id>
	<title>Placeholders - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dafne.bi-services.sk/index.php?action=history&amp;feed=atom&amp;title=Placeholders"/>
	<link rel="alternate" type="text/html" href="https://wiki.dafne.bi-services.sk/index.php?title=Placeholders&amp;action=history"/>
	<updated>2026-10-23T19:26:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.4</generator>
	<entry>
		<id>https://wiki.dafne.bi-services.sk/index.php?title=Placeholders&amp;diff=74&amp;oldid=prev</id>
		<title>Dafne: Documentation import</title>
		<link rel="alternate" type="text/html" href="https://wiki.dafne.bi-services.sk/index.php?title=Placeholders&amp;diff=74&amp;oldid=prev"/>
		<updated>2026-08-06T13:36:48Z</updated>

		<summary type="html">&lt;p&gt;Documentation import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Placeholders&amp;#039;&amp;#039;&amp;#039; are markers substituted with their current values before a statement is executed. They are available in task commands, in scenario planning queries and in operator notification commands.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
A placeholder is written as the name enclosed in percent signs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;%taskid%&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All occurrences are replaced, so a placeholder may be used more than once in the same statement.&lt;br /&gt;
&lt;br /&gt;
User-defined parameters use the &amp;lt;code&amp;gt;u:&amp;lt;/code&amp;gt; prefix to distinguish them from system placeholders:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;%u:parameter_name%&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The named parameter must exist in the parameter list. See [[Parameter]].&lt;br /&gt;
&lt;br /&gt;
== Placeholders in task commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Available in the task Query field&lt;br /&gt;
! Placeholder !! Value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%scenarioid%&amp;lt;/code&amp;gt; || Scenario ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%scenarioname%&amp;lt;/code&amp;gt; || Scenario name&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%groupid%&amp;lt;/code&amp;gt; || Group ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%groupname%&amp;lt;/code&amp;gt; || Group name&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%taskid%&amp;lt;/code&amp;gt; || Task ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%taskname%&amp;lt;/code&amp;gt; || Task name&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%period%&amp;lt;/code&amp;gt; || Task period type (D=Daily, W=Weekly, M=Monthly)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%processingid%&amp;lt;/code&amp;gt; || Processing ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%processingname%&amp;lt;/code&amp;gt; || Processing name&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%iteration%&amp;lt;/code&amp;gt; || Processing iteration code&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%date%&amp;lt;/code&amp;gt; || Processing date, format &amp;#039;&amp;#039;YYYY-MM-DD&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%date_n%&amp;lt;/code&amp;gt; || Processing date, numeric format &amp;#039;&amp;#039;YYYYMMDD&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%date_dt%&amp;lt;/code&amp;gt; || Processing date, timestamp format &amp;#039;&amp;#039;YYYY-MM-DD 00:00:00.000&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%processingstart_n%&amp;lt;/code&amp;gt; || Processing start time, format &amp;#039;&amp;#039;yyyyMMddHHmmss&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%execid%&amp;lt;/code&amp;gt; || Scheduled task ID. Keeps its value across attempts within one processing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%runid%&amp;lt;/code&amp;gt; || Run ID. Unique for every attempt.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%trynumber%&amp;lt;/code&amp;gt; || Attempt number of the scheduled task within the processing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%env%&amp;lt;/code&amp;gt; || Environment code (P=Prod, T=Test, D=Dev, U=UAT, S=SIT, O=Other1, Q=Other2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Three date forms are provided because target systems differ in what they accept. Use &amp;lt;code&amp;gt;%date_n%&amp;lt;/code&amp;gt; where a numeric partition key is expected and &amp;lt;code&amp;gt;%date_dt%&amp;lt;/code&amp;gt; where a timestamp is required, rather than converting &amp;lt;code&amp;gt;%date%&amp;lt;/code&amp;gt; in the statement.&lt;br /&gt;
&lt;br /&gt;
Note the difference between &amp;lt;code&amp;gt;%execid%&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;%runid%&amp;lt;/code&amp;gt;: the first identifies the scheduled task and is stable across retries, the second identifies the individual attempt. Use &amp;lt;code&amp;gt;%runid%&amp;lt;/code&amp;gt; when logging so that each attempt can be distinguished.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
insert into my_table (taskid, date, scenarioid) values (%taskid%, &amp;#039;%date%&amp;#039;, %scenarioid%);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With a user-defined parameter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
call proc1(%u:usrpar1%)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Placeholders in scenario planning queries ==&lt;br /&gt;
A different set is available in the planning query of a [[Scenario]], describing the state of previous processings:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Placeholder !! Value&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%scenarioid%&amp;lt;/code&amp;gt; || Scenario ID&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%scenarioname%&amp;lt;/code&amp;gt; || Scenario name&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%maxdate%&amp;lt;/code&amp;gt; || Latest finished processing date. Defaults to 1970-01-01 on the first run.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%maxprocessingID%&amp;lt;/code&amp;gt; || ID of the last finished processing. Defaults to 0 on the first run.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%maxIteration%&amp;lt;/code&amp;gt; || Iteration code of the last &amp;#039;&amp;#039;&amp;#039;finished&amp;#039;&amp;#039;&amp;#039; processing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%maxIterationAll%&amp;lt;/code&amp;gt; || Iteration code of the last &amp;#039;&amp;#039;&amp;#039;started&amp;#039;&amp;#039;&amp;#039; processing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%maxProcessingName%&amp;lt;/code&amp;gt; || Name of the last finished processing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;%maxProcessingStatus%&amp;lt;/code&amp;gt; || Status of the last started processing. Defaults to &amp;#039;&amp;#039;F&amp;#039;&amp;#039; on the first run.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
select %maxdate% + 1 as date, &amp;#039;iter1&amp;#039; as iteration&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Placeholders in notification commands ==&lt;br /&gt;
The notification command of an [[Operator]] may use placeholders identifying the failed task and its processing — the task and group, the processing and its date and iteration, and the scenario. See [[Operator]].&lt;br /&gt;
&lt;br /&gt;
== Quoting ==&lt;br /&gt;
Substitution is textual. A placeholder is replaced by its value exactly, without quoting or escaping, so string values must be quoted in the statement itself:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
where business_date = &amp;#039;%date%&amp;#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the same reason, treat a user-defined parameter whose value comes from a query as untrusted input when building SQL, and prefer passing it as an argument to a procedure over concatenating it into a statement.&lt;br /&gt;
&lt;br /&gt;
== Checking the result ==&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Query&amp;#039;&amp;#039;&amp;#039; tab of the scheduled task detail in the [[Monitor console]] shows the &amp;#039;&amp;#039;&amp;#039;executed query&amp;#039;&amp;#039;&amp;#039; — the statement after substitution. This is the reliable way to confirm what a placeholder resolved to, and the first place to look when a task fails with an unexpected value.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Parameter]]&lt;br /&gt;
* [[Task]]&lt;br /&gt;
* [[Scenario]]&lt;/div&gt;</summary>
		<author><name>Dafne</name></author>
		
	</entry>
</feed>