- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
concat string and null
- Labels:
-
Apache Impala
-
Apache Kudu
-
Apache Zeppelin
Created ‎07-13-2021 12:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Team,
can you please advise how to replace nulls by a default value?
select concat(cast(glb.budget_version_id as string)," ", cast(glc.segment1 as string)) as balid
from oracle_financial.gl_balances glb,
oracle_financial.gl_code_combinations glc,
oracle_financial.gl_ledgers glg ;
If I add a null to a value, null will be returned.
I tried NVL it is not working.
Thanks,
Roshan
Created ‎07-13-2021 12:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On Oracle below works
select
concat(nvl(cast(glb.budget_version_id as varchar2(10)),0), cast(glc.segment1 as varchar2(10))) as balid
from gl.gl_balances glb,
gl.gl_code_combinations glc,
gl.gl_ledgers glg ;
Impala
Created ‎07-13-2021 12:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On Oracle below works
select
concat(nvl(cast(glb.budget_version_id as varchar2(10)),0), cast(glc.segment1 as varchar2(10))) as balid
from gl.gl_balances glb,
gl.gl_code_combinations glc,
gl.gl_ledgers glg ;
Impala
Created ‎07-14-2021 05:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@roshanbi Is your issue resolved?
If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.
Cy Jervis, Manager, Community Program
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
