| From: | Sam Stearns <sam(dot)stearns(at)dat(dot)com> |
|---|---|
| To: | pgsql-sql(at)lists(dot)postgresql(dot)org |
| Subject: | Oracle ==> Postgres View |
| Date: | 2024-10-15 21:30:55 |
| Message-ID: | CAN6TVjmdUGuFrCn4HcUd4Q2uvNXZSEe_4TXG7neQip_m6dGiBQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
Howdy,
I have 2 views attached. An Oracle view written with NVL. The same view
was converted to Postgres using COALESCE. Postgres is throwing an error:
ERROR: syntax error at or near ","
LINE 12: ...esce(CASE WHEN impact_category='BULK_RATE_REQUEST', 1, -- To...
The problem block of code:
coalesce(CASE WHEN impact_category='BULK_RATE_REQUEST', 1, -- To handle
Portal's category for the old RIP
'CONTRACT_BULK_RATE', 1,
'SPOT_BULK_RATE', 2,
'CONTRACT_HISTORY', 3,
'SPOT_HISTORY', 4,
'RATE_SUBMISSION', 5,
'SPOT_BACKHAUL' THEN 6 END , 0),
Would anyone be able to advise how to correct this for Postgres, please?
Thanks,
Sam
^
--
*Samuel Stearns*
Lead Database Administrator
*c:* 971 762 6879 | *o:* 503 672 5115 | DAT.com
[image: DAT]
<https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link>
| Attachment | Content-Type | Size |
|---|---|---|
| oracle_view.txt | text/plain | 1.4 KB |
| postgres_view.txt | text/plain | 1.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Rowley | 2024-10-15 21:46:01 | Re: Oracle ==> Postgres View |
| Previous Message | David G. Johnston | 2024-10-05 02:35:02 | Re: invalid reference to FROM-clause entry for table |