1
SELECT
     null AS m_inout_id,
     'OPEN' AS documentno         
FROM
     adempiere.transaction_view trv    
UNION ALL
SELECT
     trv.m_inout_id AS m_inout_id,
     trv.documentno AS documentno
FROM
     adempiere.transaction_view trv

The problem is with documentno. The datatype of documentno is NVARCHAR2(20).

Sajeev
  • 783
  • 3
  • 14
  • 46
  • If you think this will be useful to someone in the future - and I think it might - then you should make that an answer. Although it's almost a duplicate of [this](http://stackoverflow.com/q/15967201/266304) or [this](http://stackoverflow.com/q/13354436/266304). You might also want to consider casting `null` to the same data type as `trv.m_inout_id`; or reversing the order of the queries. – Alex Poole Jul 09 '14 at 10:08
  • I'm seeking a query working both in oracle and postgres. – Sajeev Jul 09 '14 at 10:21
  • Does PostgreSQL understand the `n'OPEN'` syntax? – Alex Poole Jul 09 '14 at 10:26
  • It is working fine in postgres – Sajeev Jul 09 '14 at 10:28

0 Answers0