RockU SQL Command

You are here:

SQL Command

Presenter: Jon Edmiston Length: 2:44

 
The following Lava code examples are used in this video:

{% sql %}
  SELECT [NickName], [LastName] 
  FROM [Person] 
  WHERE [LastName] = 'Decker'
{% endsql %}

{% for item in %}
    {{ item.NickName }} {{ item.LastName }} <br/>
{% endfor %}
{% assign lastName = 'Decker' %}

{% sql results %}
    SELECT [NickName], [LastName] FROM [Person] 
    WHERE [LastName] = '{{ lastName }}'
{% endsql %}

{% for item in results %}
    {{ item.NickName }} {{ item.LastName }} <br/>
{% endfor %}
{% sql statement:'command' %}
  UPDATE [Workflow] SET [CompletedDateTime] = GETDATE()
  WHERE [WorkflowTypeId] = 18
  AND [Status] = 'Initial Entry'
  AND [ActivatedDateTime] < DATEADD( hour, -1, GETDATE() )
  AND [CompletedDateTime] IS NULL
{% endsql %}