Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

SQL Code: DELETE using instance variable

Avatar

Level 1

I want to delete from a schema abcMySchema. 

In this schema I am storing the Label of the workflow: MyWorkflow.

I have added a SQL Code Action: DELETE FROM abcMySchema WHERE sWorkflowName = <%= instance.label %>;

 

I am getting the following errors:

PGS-22000 PostgreSQL error: ERROR: column "myworkflow" does not exist...

WDB-200001 SQL statement 'DELETE FROM abcMySchema WHERE sWorkflowName = MyWorkflow' could not be executed.

 

I can hardcode the value WHERE sWorkflowName = 'MyWorkflow' and the query runs and deletes the associated records.

 

How do you use the dropdown instance > label in a query?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @TJFORCE68 ,

 

Try this : 

DELETE FROM abcMySchema WHERE sWorkflowName = '<%= instance.label %>';

 

Br,

Amine

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hello @TJFORCE68 ,

 

Try this : 

DELETE FROM abcMySchema WHERE sWorkflowName = '<%= instance.label %>';

 

Br,

Amine

Avatar

Level 1

I thought I tried this since it is a string and was getting errors.  This worked for me.  Thanks.