I apologize for not having much background on this question but I've been tasked with switching some of our Oracle queries to Vertica syntax and I'm having trouble understanding the documentation around the GENERATED ALWAYS
Oracle command as it relates to case statements.
From what I've found, it seems like the GENERATED ALWAYS
in Oracle is equal to AUTO INCREMENT
in Vertica.
Here is an example of a case statement that I need to rewrite in Vertica. At first glance, it looks like it's just telling it to use an alias, but I'm not sure I'm understanding that properly.
FIELD_NAME varchar2(25) GENERATED ALWAYS as(
case "FIELD_NAME"
when 'ABC'
then 'ABC / Category_ABC'
when 'DEF'
then 'DEF / Category_DEF'
else 'Other'
end)
Would this essentially be the same? Is it safe to simply just remove the GENERATED ALWAYS
piece? Or is something bigger happening here?
FIELD_NAME varchar2(25) as(
case "FIELD_NAME"
when 'ABC'
then 'ABC / Category_ABC'
when 'DEF'
then 'DEF / Category_DEF'
else 'Other'
end)