oracle - I have a SQL with nvl and case statement that has to be converted into Informatica expression -
i have following sql statement:
nvl(w_sales_invoice_line_fs.invoiced_qty, case nvl(w_sales_invoice_line_fs.net_amt,0) when 0 w_sales_invoice_line_fs.invoiced_qty else -1 end)
could me converting informatica expression isnull , decode(). tried following , gives out parsing errors:
iif(isnull(ext_invoiced_qty), decode(ext_net_amount, iif(isnull(ext_net_amount),0,ext_net_amount) =0, ext_invoiced_qty, -1), ext_invoiced_qty)
to note:
w_sales_invoice_line_fs.invoiced_qty = ext_invoiced_qty w_sales_invoice_line_fs.net_amt = ext_net_amount
your sql statement little bit strange. let's analyse it:
w_sales_invoice_line_fs.invoiced_qty != null => w_sales_invoice_line_fs.invoiced_qty w_sales_invoice_line_fs.invoiced_qty = null , w_sales_invoice_line_fs.net_amt = null => w_sales_invoice_line_fs.invoiced_qty (but it's null) w_sales_invoice_line_fs.invoiced_qty = null , w_sales_invoice_line_fs.net_amt != null = > -1
it seems need have same output:
decode ( true, not isnull( ext_invoiced_qty ), ext_invoiced_qty , isnull(ext_net_amt), null, -1)
Comments
Post a Comment