Oracle Discoverer: How to handle null value
In Oracle Discoverer, I pull data from a folder. When I hit Null value for a column, I want to replace it with data from another folders column. Something like the functionality of "nvl" of a SQL statement. How can I do the following query in Discoveror :
example: select nvl(table1.column1,table2.column2) from table1, table2
where table1.column7 = table2.column7.
Hi,
You first need to include any column from folder table2 into your report so that Discoverer will do the join. (This assumes the join between table1 and table2 is set up in your EUL). Then you can create a calculation containing nvl(table1.column1,table2.column2) . You can then remove the column from folder table2 and the join will stay in your workbook.
Hope that helps,
Rod West
Similar Messages
-
Oracle Discoveror: How to handle null value
In Oracle Discoveror, I pull data from a folder. When I hit Null value for a column, I want to replace it with data from another folders column. Something like the functionality of "nvl" of a SQL statement. How can I do the following query in Discoveror :
example: select nvl(table1.column1,table2.column2) from table1, table2
where table1.column7 = table2.column7.Hi,
You first need to include any column from folder table2 into your report so that Discoverer will do the join. (This assumes the join between table1 and table2 is set up in your EUL). Then you can create a calculation containing nvl(table1.column1,table2.column2) . You can then remove the column from folder table2 and the join will stay in your workbook.
Hope that helps,
Rod West -
Hi frzz,
Can any one explain me how exactly HANA handles NULL values??
Best Regards,
Krishna.Hi Krishna,
You can use IFNULL for the SQL queries/script instead of ISNULL . Since ISNULL is binary function and will be mostly used for the CE Functions based Calc views.
Try using the same queries with IFNULL instead of ISNULL, it should work
Best Regards
Rahul Jha -
How to handle Null value in Database Adapter
I configured the DA Adapter, with operation type as "Perform an Operation on a Table - Select" and added few where clause parameters (StreetNo, StreetName city, country, state, zipcode)too.
If we won't enter any value for any of the column in the table (S_ADDR_PER) is taking as NULL, so what happening is, if i give "%" or if i leave as "blank" to those columns(input for where clause parameter). The DB adapter not fetching any records. Any help to handle this situation.
I need query like this...
select * from S_ADDR_PER where city like '%' AND state is NULL AND addr_line_2 like '%';
seems.... I can't use the pure SQL option since i don't know which column will be null. Some case the addr_line_2 column will be NULL in table, in some other case the state or city column will be null.Hi,
you can handle null with date like this , If it doesn't wortk for you then please explain your problem.
select NVL(to_char(sysdate,'DD-MON-YY'),'Not Recorded')
from dual
NVL(TO_CHAR(
08-NOV-05
select NVL(to_char(NULL,'DD-MON-YY'),'Not Recorded')
from dual
SQL> /
NVL(TO_CHAR(
Not Recorded
Regards -
How to handle null values in RTF templates
Hi - I have two groups in a report for different SQL and two formulas for each group, CF_ELE_CNT and CF_ELE_CNT1. In the template I use the below code to print or not print a section.
<?if:number(CF_ELE_CNT +CF_ELE_CNT1) >0?>
The problem is when there is no data in the second group its not creating the XML tag for CF_ELE_CNT1, though CF_ELE_CNT has 13, it still does not print that partucular section. If I remove CF_ELE_CNT1 from the condition it works fine. I was wondering how to handle this.
Any help would be appreciated!!
Thanks,
RavHey Rav,
You can add a check to identify it the element/tag is present or not
<?if:(CF_ELE_CNT1)?> will give true, if the element is present otherwise falsesince you are adding the two elements, you have to add a or condition.
<?if:(CF_ELE_CNT and number(CF_ELE_CNT) >0 ) or ( CF_ELE_CNT1 and CF_ELE_CNT1 >0)?> -
How to Replace Null Value as 0 in an OBIEE11g Pivot Table?
Hi,
How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working in obiee10g version.
We have tried below methods
1) criteria tab and edit the ‘column properties’ associated with your fact measure. Choose the ‘Data Format’ tab, tick to override the default format and choose ‘Custom’.
It seems that the syntax for this custom format is positive-value-mask (semi colon) negative-value-mask (semi colon) null-mask. So this means we have a few options.
E.g. if you want zeros (0) instead of null then enter:
#,##0;-#,##0;0
2) in that formula columns we have put it below case condition also ,
Measure Column: Nom_amt --> edit formulas
CASE WHEN Nom_amt IS NULL THEN 0 ELSE Nom_amt END
3) we have uncheked IS NULL check box in the admin tool also
I tried above formats still it's not working for me..kindly help me on this..
thanks in advance...
Best Regards,
R.DevarasuHi Amith,
I have update your suggested one,but it's working few of the rows only..remainings rows some of cells still NULL only
Measure colmns is : Nom_SGD
IFNULL(Nom_SGD,0.00)
Movment : dynamic date calc by using $2-$1 oracle formula's
Actually i am doing below things only,
31/12/2011 31/03/2011 Movment
Country
India 100 -50 -150
Singapore 200 200
UK 1200 -1200
USA 0.00 0.00 0.00 (here changed null as 0)
Helpmeon this... -
How to delete null values in a table
hi all,
tell me please any one how to delete null values in a table
example:
in emp table is there
empno ename job mgr sal deptno
7900 scott 7902 2000 10
7499 clerk 7900 20
7834 james manager 3000 30
like this in the above emp table there are some null values are there
so how to delete the null values in emp table
thanks,
regards.
Edited by: user9195968 on Feb 25, 2010 6:30 AMnot too sure what you mean, perhaps you could supply a table description and some sample data
but, consider
delete from table_1 where column_1 is null
commit
/ -
How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working 10g
Hi,
How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working in obiee10g version.
We have tried below methods
1) criteria tab and edit the ‘column properties’ associated with your fact measure. Choose the ‘Data Format’ tab, tick to override the default format and choose ‘Custom’.
It seems that the syntax for this custom format is positive-value-mask (semi colon) negative-value-mask (semi colon) null-mask. So this means we have a few options.
E.g. if you want zeros (0) instead of null then enter:
#,##0;-#,##0;0
2) in that formula columns we have put it below case condition also ,
Measure Column: Nom_amt --> edit formulas
CASE WHEN Nom_amt IS NULL THEN 0 ELSE Nom_amt END
3) we have uncheked IS NULL check box in the admin tool also
I tried above formats still it's not working for me..kindly help me on this..
thanks to do the needfull
Best Regards,
R.DevarasuHi,
Null value in database displaying as 0 in report, I need to keep value as in database, and I have one calculated row which is based on null values should also null in report.
but it showing 0 for null values also so, my calculated row showing wrong result.
my report is like
col1 col2
ABC 0
BCD 12
DEF -12 --this is calculated row.
I require result like:
col1 col2
ABC null
BCD 12
DEF null --this is calculated row.
Please let me know how I can achieve this.
Thanks,
Rahul -
How to assign NULL value to an ITEM in Forms Personalization?
Hi,
how to assign NULL value to an ITEM in Forms Personalization?
please suggest me.
ThanksI don't know what your form personalization does and maybe I misunderstand you ...
Try
:item_name := null; -
Model of how APEX handles data (values)?
Reference {thread:id=2486655}
I'm trying to get a model of how APEX handles data (values). There are several places(?) that data (values) can exist. Or so it seems. I'm trying to understand how these work -- to put all the pieces together.
Question:
A) Where data can be?
1) In the database
2) In the session
3) Rendered -- and hence displayed on the screen, if a displayed value -- but not in the session
4) In perhaps(?) some working memory pool(?) but different from the page rendered values I see on the screen?
5) Other?
Why do I think this is relevant?
Question:
B) If there are rendered values and session values different from the rendered values, then when code executes, which of these values (rendered or session) is it executing against?
And maybe the answer is, "You don't understand what's going on." Yes, "Exactly!" Hence the question.
Best wishes,
HowardHoward (DBA in Training) wrote:
I'm putting this together now. For example:
I set the value of a Page Item (say, :P2_DATA) to "BEFORE" in a Before Region process and change it to "AFTER" in an After Region Process. 'BEFORE' was displayed on the screen but 'AFTER' was in the session state. So I see that PL/SQL changes these values in the session state. But it doesn't "go back" to change the HTML after the region has been rendered -- hence we see BEFORE shown on the screen. (I'll have to think about what a Dynamic Action does.)
Also, if a page item has a default value, say 'DEFAULT' then that value doesn't get into the session state. At least, not with my current settings. Oh, that explains a lot of confusion!! I suppose there's a logical reason for this but who would expect default values to be differently from other PL/SQL operations on the item?
Questions:
1) So why does a default value not get put into the session state?Several reasons, among them:
*1. When/why is the value required?* Region items (and thus their source and default values) are rendered in region/item sequence order. The item's source/default value would therefore not be available in session state until it's rendering point. This is frequently later in page show processing than the value is actually required, such as the common use case of including a data value in the page or region title. Setting the value in a Before Header/Regions computation or process makes it available as required before the item is actually rendered.
*2. The rendered page might not be submitted.* Default values are typically set when a page will create a new row. Consider the situation where the user clicks a "Create" button and is presented with an order entry form containing several default values. They then decide they don't want to create a new order after all, and navigate away from the form page via some mechanism that uses a redirect rather than a submit (such as a default "Cancel" button). This means that no page submit processing is performed, and generally that no session state management is performed. If the default values were set in session state, the order entry page would contain the default values for the non-existent order despite the user never submitting it. This may have unwanted side-effects if these values are referenced elsewhere in the application, and therefore would require extra session state management to be built into the application.
*3. A rendered item might not be submitted with the page.* Per the HTML specification, the values of disabled controls unchecked checkboxes are not POSTed on page submit. Consider a situation where a checkbox item is set with several default values, but the application requires that the checkboxes be cleared and disabled by a dynamic action if the user chooses certain options from a select list. In this case, on page submission no values are submitted into session state for the checkbox item. If the defaults had been set in session state, then the application would be in an inconsistent state, with the user-selected option indicating that none of the checkboxes were checked, but with session state holding values showing that they were. This would require additional processing to ensure that the application's state was consistent before saving it to the database.<sup>1</sup>
2 & 3 are particularly significant in basic wizard-generated applications. Doing things in this way, the wizard-generated DML and navigation "just works", without the need for additional session state management.
2) Is there a Page Item setting that causes the default value to be saved to the session state?No. Hopefully the explanations above provide sufficient reason to show why this is genearlly not desirable. On the rare occasions when it is required, set the session state value using a computation or process.
<sup>1</sup> There are other reasons—mainly security related—that make it good practice to perform such checks in more complex and internet-facing applications anyway. -
How to handle null pointer exception
dEAR ALL
how to handle null pointer exception
public void xxperscompmatchcase(OAPageContext pageContext,
OAWebBean webBean,String cid,String pid)
xxcrmleadperslastnameVOImpl vo=getxxcrmleadperslastnameVO();
xxcrmleadcompnameVOImpl vo1=getxxcrmleadcompnameVO();
vo.setWhereClauseParams(null);
vo1.setWhereClauseParams(null);
vo.setWhereClauseParam(0,pid);
vo1.setWhereClauseParam(0,cid);
vo.executeQuery();
vo1.executeQuery();
String compname="";
String plname="";
if(vo1.first().getAttribute("CompName")!=null)
compname=(String)vo1.first().getAttribute("CompName");
else
compname="";
if((String)vo.first().getAttribute("PersLastname")!=null)
plname=(String)(String)vo.first().getAttribute("PersLastname");
else
plname="";
OAFormattedTextBean p =
(OAFormattedTextBean)webBean.findChildRecursive("personmatchcase");
OAFormattedTextBean b =
(OAFormattedTextBean)webBean.findChildRecursive("matchcase");
b.setValue(pageContext,
"The Lead is matched to company " + compname.toUpperCase());
p.setValue(pageContext,
"The Lead is matched to person " + plname.toUpperCase());
it is going to null pointer exception
how to handle this exceptionHi,
try
//Write your logic here, which can generate any exception
catch(Exception e)
//Write your exception specific code here
Regards,
Reetesh Sharma -
Handling null value in where condition
CREATE OR REPLACE package body GetRefCursors is
function sfGetAccountInterval
( pFirstAccount in ACCOUNTS.ACCOUNT_NO%type
,pLastAccount in ACCOUNTS.ACCOUNT_NO%type)
return csGetResultSet is
csGetAccounts csGetResultSet;
begin
open csGetAccounts for
SELECT accounts.account_no,accounts.name
FROM accounts
WHERE accounts.account_no BETWEEN pFirstAccount AND pLastAccount
ORDER BY accounts.account_no;
return csGetAccounts;
end sfGetAccountInterval;
end GetRefCursors;
how can i handle the condition if pFirstAccount parameter having null value?
do i need to use Dynamic SQL here?no need for dynamic stuff.
You could use the NVL function, but it depends what you want... If you want NULL to be considered the lowest possible account number, then you could do something like
nvl (pFirstAccount, 0)where the zero is the lowest possible number. -
Using Convert to handle NULL values for empty Strings ""
After having had the problem with null values not being returned as nulls and reading some suggestion solution I added a converter to my application.
<converter>
<converter-id>NullStringConverter</converter-id>
<converter-for-class>java.lang.String</converter-for-class>
<converter-class>com.j2anywhere.addressbookserver.web.NullStringConverter</converter-class>
</converter>
...I then implemented it as follows:
public String getAsString(FacesContext context, UIComponent component, Object object)
System.out.println("Converting to String : "+object);
if (object == null)
System.out.println("READING null");
return "NULL";
else
if (((String)object).equals(""))
System.out.println("READING null (Second Check)");
return null;
else
return object.toString();
public Object getAsObject(FacesContext context, UIComponent component, String value)
System.out.println("Converting to Object: "+value+"-"+value.trim().length());
if (value.trim().length()==0 || value.equals("NULL"))
System.out.println("WRITING null");
return null;
else
return value.toUpperCase();
...I can see that it is converting my values, however the object to which the inputText fields are bound are still set to empty strings ""
<h:inputText size="50" value="#{addressBookController.contactDetails.information}" converter="NullStringConverter"/>Also when reading the object values any nulls are already converted to empty strings before ariving at the converter. It seems that there is a default converter handling string values.
How can I resolve this problem as set nulls when the input value is an empty string other then checking every string in my class individually. I would really hate to pollute my object model with empty string tests.
Thanks in advance
Edited by: j2anywhere.com on Oct 19, 2008 9:06 AMI changed my converter as suggested :
public Object getAsObject(FacesContext context, UIComponent component, String value)
if (value == null || value.trim().length() == 0)
if (component instanceof EditableValueHolder)
System.out.println("SUBMITTED VALUE SET TO NULL");
((EditableValueHolder) component).setSubmittedValue(null);
else
System.out.println("COMPONENT :"+component.getClass().getName());
System.out.println("Converting to Object: " + value + "< to " + null);
return null;
System.out.println("Converting to Object: " + value + "< to " + value);
return value;
}which produces the following output :
SUBMITTED VALUE SET TO NULL
Converting to Object: < to null
Info : The INFO line however comes from my controller object where I print out the set value :
package com.simple;
import java.util.ArrayList;
import java.util.List;
public class Controller
private String information;
/** Creates a new instance of Controller */
public Controller()
System.out.println("Createing Controller");
information = "Constructed";
public String process()
System.out.println("Info : "+getInformation());
return "processed";
public String reset()
setInformation("Re-Constructed");
System.out.println("Info : "+getInformation());
return "processed";
public String setNull()
setInformation(null);
System.out.println("Info : "+getInformation());
return "processed";
public String getInformation()
return information;
public void setInformation(String information)
this.information = information;
}I also changes my JSP / JSF page a little. Here is the updated version
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%--
This file is an entry point for JavaServer Faces application.
--%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<f:view>
<h:form>
<h:inputText id="value" value="#{Controller.information}"/>
<hr/>
<h:commandLink action="#{Controller.process}">
<h:outputText id="clicker" value="Process"/>
</h:commandLink>
<hr/>
<h:commandLink action="#{Controller.reset}">
<h:outputText id="reset" value="Reset"/>
</h:commandLink>
<hr/>
<h:commandLink action="#{Controller.setNull}">
<h:outputText id="setNull" value="Set Null"/>
</h:commandLink>
</h:form>
</f:view>
</body>
</html>The converter is declared for the String class in the faces configuration file. From the log message is appears to be invoked, however the object is not set to null.
I tested this with JSF 1.2_04-b20-p03 as well as 1.2_09-b02-FCS.
any other suggestions what could be causing this. -
How OSB handling null element?
hi Guys,
I having question about how to handling a null node during trasnfortation and mapping using oracle workshop for OSB 10g.
Well i have a consumer that not sending the element into the proxy, so during the proxy i will need to transform it into null element to the provider. what's in my mind is transform the element tag into something like this
{ if (fn:nilled($getAssetAttribReqParam1/RequestHdr/ns1:RequestId)) then
<ns1:RequestId xsi:null = "true"/>
else
(<ns1:RequestId>{ data($getAssetAttribReqParam1/RequestHdr/ns1:RequestId) }</ns1:RequestId>)
but when i doing testing it still showing this
<ns1:RequestId></ns1:RequestId>
i will need to sent the element something like this to the provider. because if this element is date format it will fail in the validation if i sending *<ns1:RequestId></ns1:RequestId>*
<ns1:RequestId xsi:null = "true"/>I think your case should be addressed like -
if ($getAssetAttribReqParam1/RequestHdr/ns1:RequestId) then
<ns1:RequestId>{ fn:data($getAssetAttribReqParam1/RequestHdr/ns1:RequestId) }</ns1:RequestId>
else
<ns1:RequestId/>
Regards,
Anuj -
How to replace null value, if column is text and not numeric in OBIEE?
Hi,
Please note that I had tried to change the null text by adding bin value for Unspecified and Unknown but this did not work for me.. not sure if I am missing out to put anything in value filter…
Thank You,
RaviCheck this function:
http://docs.oracle.com/cd/E23943_01/bi.1111/e10544/appsql.htm#CHDHJABI
Cheers
Nico
IFNULL
This function tests if an expression evaluates to a null value, and if it does, assigns the specified value to the expression.
Syntax
IFNULL(expr, value)
Where:
expr is the expression to evaluate.
value is the value to assign if the expression evaluates to a null value.
Maybe you are looking for
-
Hi, hope somebody here can help me. I have a T500, and my DVD-RW drive broke. It is P/N 42T2515. I see that 42T2515 was discontinued last year, and if there's a suggested newer version I'd like to buy that instead. Will someone please tell me what
-
Hi All, My Oracle database is running on 10.2.0.2.0 on RHEL 5.4 64 bit. I need some tuning guide line for below SQL: select rnii.order_id, rnii.asin, rnii.gl_product_group, rnii.warehouse_id, rtrim(rnii.vendor
-
How to distinguish the right address to use
We're making a P2P application for audio streaming. It's working, but we have this problem - if one would enter 'localhost' for the server address (because server is indeed on the local machine), this would register that peer by the address value of
-
PC Suite 6.84 Beta test - COMING SOON
Hi guys I have been asked to pass on the following message Hello Beta test for PC Suite release 6.84 will start soon! The link to registration form will be published here this week. Best Regards, Nokia PC Suite Beta test team
-
Hi All, In Datamodel query .. I need to eliminate one or two tables based on some conditon .. In lexical parameter.. we can write conditon .. wht abt tables? Kindly let me know how can we achieve the above funcitonality. Thanks Ali