I'm trying to execute the below statement on PostgreSQL 12.4. This statement was converted from Oracle 10g to PostgreSQL 12.4 using the online SQL Lines tool.
select
hid,
pname,
starting_from,
ename
from schema1.pet
where hid=COALESCE(TO_NUMBER(sys_context('temp1','hid')),0);
I'm getting the below error:
ERROR: function sys_context(unknown, unknown) does not exist
LINE 7: where hid=COALESCE(TO_NUMBER(sys_context('temp1','hid...
I'm not sure what's the equivalent of sys_context in PostgreSQL.
How can I fix this statement to PostgreSQL?
sys_contextdoes, then you could also reach those people who are not familiar with Oracle.