Skip to content

Unexpected data type when conditionally updating column #1790

Answered by North101
frankvollebregt asked this question in Q&A
Discussion options

You must be logged in to vote

You need to give :newStatus a type as it seems its not inferred.

updateStatus(:newStatus AS INT):
UPDATE my_table SET status = MAX(status, :newStatus), second_col = :secondCol;

https://drift.simonbinder.eu/docs/using-sql/drift_files/#variables

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@frankvollebregt
Comment options

@simolus3
Comment options

@davidmartos96
Comment options

Answer selected by frankvollebregt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants