Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
9 replies
Subscribers
5 subscribers
Views
3496 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
Hello, I am trying to write an INSERT query for DB2 using the Query D
thanosm
over 9 years ago
Hello,
I am trying to write an INSERT query for DB2 using the Query Database Node that in some cases sets the value of VARCHAR field to NULL while in other cases it inserts an actual value.
The INSERT query is of the form "INSERT INTO <table> (..., <VARCHAR FIELD>", ...) VALUES (..., ac!VarcharField, ...)"
How can i write the expression for the value of the parameter ac!VarcharField so that it sets the Field to have a NULL value, depending on a condition, in the database?
Generally, in DB2, you set the field to NULL using the expression "CAST(NULL AS VARCHAR(10))".
Thanks for the help....
OriginalPostID-121205
OriginalPostID-121205
Discussion posts and replies are publicly visible
Parents
0
Jason Ruvinsky
Certified Senior Developer
over 9 years ago
We're using MS SQLServer, but we also have the issue that whenever using write to datastore entity and passing in nulls, Appian passes empty strings to varchar fields "". We have an enhancement request for this issue with reference number AN-53545. We've had to work around this by either accepting "" in the database, creating smaller CDTs that don't include the fields that are being left null (only works if we know those fields wouldn't be populated in that process), having triggers on the database that will set the fields to null, or using the Execute stored procedure plugin and creating stored procedures for our data writes.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Jason Ruvinsky
Certified Senior Developer
over 9 years ago
We're using MS SQLServer, but we also have the issue that whenever using write to datastore entity and passing in nulls, Appian passes empty strings to varchar fields "". We have an enhancement request for this issue with reference number AN-53545. We've had to work around this by either accepting "" in the database, creating smaller CDTs that don't include the fields that are being left null (only works if we know those fields wouldn't be populated in that process), having triggers on the database that will set the fields to null, or using the Execute stored procedure plugin and creating stored procedures for our data writes.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data