It doesn't matter what
QS_BUILD_CREATEUPGRADE
is: that code treats it's name as a string.
It looks like it compares the value in the
proc_type
column with the string value:
".QS_BUILD_CREATEUPGRADE."
but it looks like no SQL IF function or statement I recognize: I suspect that isn't SQL but some odd processor which feeds to / from SQL
Check where you got the code from.