Javascript TypeError - Null value
In the past two days I continually get an error message regarding java, it reads TypeError - Null value. This happens often when clicking links on pages. It doesn't seem to stop the page its new and annoying. Whats gone wrong?
I am getting the same Message when using Safari on Amazon.com:
"JavaScript
Type Error - Null Value"
I assume it is related to Safari since there is a Safari icon in the error message box.
iMac G5 Mac OS X (10.3.9)
Similar Messages
-
Anyone else getting JavaScript TypeError - Null value?
Anyone else getting JavaScript TypeError - Null value? I get it on Amazon all the time now. Nothing seems to fix it... What's up with Safari and Java?
Java and Javascript are different. For more on their differences see:
http://members.ozemail.com.au/~phoenix1/html/getstart.htm
That said, Javascript which fails in Safari usually is something that is non-standard since Safari makes a genuine effort to follow http://www.w3.org/ standards. If you encounter a website that doesn't follow these standards, point them to http://www.anybrowser.org/ for guidance on making more uniformly compatible websites. In the meantime there are many other web browsers made for Mac OS X like Firefox, Mozilla, Netscape, Omniweb, Camino, Internet Explorer, Opera, and iCab. If you find a website that doesn't behave well in Safari, use the Report bug to Apple in the Safari menu. There is a Safari Enhancer which has a User Agent submenu in the Debug menu it enables. That same Debug menu can be enabled from Applications -> Utilities -> Terminal via this command line:
defaults write com.apple.Safari IncludeDebugMenu 1
The User Agent specified will spoof certain websites into thinking you are using a different web browser. In the end though, it usually is better to inform webmasters when their website is not accessible. -
I have the following code which is falling over in Firefox, while in other browsers like IE, Chrome and Opera is passing through even though the value in the array at that point of time is null.
var vitemp = document.getElementById('F06_'+ij).value;
In firefox, i get the error below.
[18:59:35.747] TypeError: document.getElementById(...) is null @ http://
How can i change the firefox parameters so as to be less strict for null value assignments ?Use code like this to test if that id exists.
<pre><nowiki>var vi_id = document.getElementById('F06_'+ij);
var vitemp = vi_id?vi_id.value:null;</nowiki></pre> -
Geting null values from request
hi!
i m producing this code through out.println() method in my page and then using java script
i am submiting this page to another page
<td width="56%"><textarea name="question_no_1"></textarea></td>
<input name="question_no_1_radio1" type="radio" value="radio"></td>
<td width="59%"> <textarea name="question_no_1_ans1"></textarea></td>
<input type="radio" name="question_no_1_radio2" value="radio"></td>
<td><textarea name="question_no_1_ans2"></textarea></td>
<input type="radio" name="question_no_1_radio3" value="radio"></td>
<td><textarea name="question_no_1_ans3"></textarea></td>
<input name="question_no_1_radio4" type="radio" value="radio"></td>
<td><textarea name="question_no_1_ans4"></textarea></td>
but when i submit it to the other page and try to retrieve value of parameter "question_no_1"
through the bellow statement it shows a null value but i have given a value previously by
typing a question in it
System.out.println("the Body Of The First Question Is "+request.getParameter("question_no_1"));
can anybody help me what is going on here.
also if i try to normaly submit first page (ie <form="form1" method="post" action="other_jsp_page.jsp"> ) then the statement in the next page gives me the correct value but
i have to submit the first paper through java script.
if u want to see full detail of my code then go to the following link
http://forum.java.sun.com/thread.jsp?thread=309254&forum=45&message=1237097
thanx in advanceOK, your problem is that you are not submmiting the values to the other page. When you do the
--> document.forms[0].submit();
in JavaScript, the form has to action defined
--> <form name="form1" method="" action="">
So, the page does nothing. The line following the submit just changes the location of the page, IT DOES NOT POST the values.
One solutions is the following:
1.- define an action for your form:
<form name="form1" method="POST" action="'save_paper.jsp">
2.- Then create a JavaScript function that validates the fields and simply return "true" if the form is correct, and false if there is a problem (just a little modification of the one you have).
3.- Then modify your submit button:
Instead of:
<input type="button" name="Save" value="Save" onClick="validateField()">
Try:
<input type="SUBMIT" value="Save" onclick="validateField();"> -
[OBIEE-11g] Error getting Nqid always null value
Hi to all, I've a problem to load Nqid in a dashboard on 11g OBIEE.
The javascript function return always a null value and the document.cookie instruction return an empty string ...
somebody could help me ?!
p.s.: in the firefox properties there is a cookie that contain the id but i can't read it
function getNqid() {
var nameEQ = 'nQuireID=';
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca;
while (c.charAt(0)==' ')
c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0)
return c.substring(nameEQ.length,c.length);
return null;Hi,
You might want to check the NQQuery.log to see the code that it is running before making a connection. Just to confirm that the connection pool step is working fine, could you try with a simple select statement and see that it does not error out. If it does not, you may want to revisit the procedure code again. I understand from the error that it is expecting something after the END statement (kind of weird though!!). I assume in this case, it could not parse that this is a stored procedure call itself may be. One thread I found is http://stackoverflow.com/questions/4270818/ora-06550-and-pls-00103 which you may want to look for the line break characters.
Hope this helps.
Thank you,
Dhar -
How to eliminate explicit "null" values
Hello,
I am having a problem in eliminating the explicit "null" values while retrieving them from the database.
Here is my problem as follows,
For the optional fields in a form i am explicitly entering "null" as value or else it is throwing null pointer exception in linux. While i am trying to display the values existing in a table it is displaying fine when i use this condition
if(varialble.equals("null") ||varialble.equals("") || variable.equals(null))
varialble = "";
else
out.println(variable)
But when i use the same for the values i retrieve from the view it is displaying "Null" for the explicit "null" values and null from implicit null values.
Please help me out how to remove the explicit null values. It would be great help if somebody replies me at the earliest.
Thanks in advance
dayathe following is the code which i am using to retrieve values.
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.*;
import StrChk.*;
public class DataSearch extends HttpServlet
Connection con=null;
Statement st=null;
ResultSet rs=null;
ResultSetMetaData rsmd=null;
PrintWriter out=null;
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws IOException,ServletException
String key;
String sql;
res.setContentType("text/html");
out = res.getWriter();
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:daya","daya","daya");
st = con.createStatement();
catch(Exception e)
System.out.println("Error Accessing DataBase:"+e);
key = req.getParameter("key");
// Search(str1.retString(key));
Search(key);
public void Search(String key)
int res=0;
boolean flag=true,found=false;
StringTokenizer strt = new StringTokenizer(key, " ");
String sql;
String str1,str2;
int i=0;
int count = strt.countTokens();
String keywords[] = new String[count+1];
keywords=key;
i++;
if(count > 1)
count++;
while(strt.hasMoreTokens())
keywords[i] = strt.nextToken();
i++;
out.println("<html><title>DataSearch</title>");
out.println("<script>");
out.println("function myclose(){ self.close(); } ");
out.println("</script><body>");
for(i=0; i<count && flag==true; i++)
try
/* sql = "select ";
sql += " nvl(\"Topic Title\",' '), ";
sql += " nvl(\"Name\",' '), ";
sql += " nvl(\"Title\",' '), ";
sql += " nvl(\"Affiliation\",' '), ";
sql += " nvl(\"Street Name\",' '), ";
sql += " nvl(\"City\",' '), ";
sql += " nvl(\"State\",' '), ";
sql += " nvl(\"Country\",' '), ";
sql += " nvl(\"Zip Code\",' '), ";
sql += " nvl(\"Phone\",' '), ";
sql += " nvl(\"Fax\",' '), ";
sql += " nvl(\"eMail\",' '), ";
sql += " nvl(\"Web Site\",' ') ";
sql += " from SEARCHVWUSERDET where ";
sql += " lower(\"Name\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Title\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Affiliation\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Street Name\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"City\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"State\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Country\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"eMail\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Web Site\") like " + "lower('%" + keywords[i] + "%')";*/
sql = "select ";
sql += " nvl(\"Name\",' '), ";
sql += " nvl(\"Title\",' '), ";
sql += " nvl(\"Affiliation\",' '), ";
sql += " nvl(\"Street Name\",' '), ";
sql += " nvl(\"City\",' '), ";
sql += " nvl(\"State\",' '), ";
sql += " nvl(\"Country\",' '), ";
sql += " nvl(\"Zip Code\",' '), ";
sql += " nvl(\"Phone\",' '), ";
sql += " nvl(\"Fax\",' '), ";
sql += " nvl(\"eMail\",' '), ";
sql += " nvl(\"Web Site\",' '), ";
sql += " nvl(\"Key Words\",' ') ";
sql += " from searchcombi where ";
sql += " lower(\"Name\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Title\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Affiliation\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Street Name\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"City\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"State\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Country\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"eMail\") like " + "lower('%" + keywords[i] + "%') or ";
sql += " lower(\"Web Site\") like " + "lower('%" + keywords[i] + "%') or";
sql += " lower(\"Key Words\") like " + "lower('%" + keywords[i] + "%')";
sql += " order by \"Name\" ";
rs = st.executeQuery(sql);
//out.println(sql);
if(rs.next())
if(i == 0)
flag=false;
found=true;
res=0;
do
res++;
}while(rs.next());
out.println(res++);
out.println("<center><font color=#ff9999 face=\"verdana, geneva, arial, sans-serif\" size=2><b>Searched for \""+ keywords[i]+"\", ");
out.println("Total Matches found : "+res+"</center><br>");
rs = st.executeQuery(sql);
while(rs.next())
res++;
out.println("<table width=600 align=center>");
str1 = disp(rs.getString(1),keywords[i]);
out.println(str1);
//if(str1.equals("null") || str1.equals(" ") || str1.equals(null))
if(str1 == "null" || str1 == "")
str1 = "";
else
out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Name </td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
//System.out.println(str1);
//out.println(str1);
str2="";
str1 = disp(rs.getString(2),keywords[i]);
if(!str1.equals("") || !str1.equals(""))
str2 = str1;
str1 = disp(rs.getString(3),keywords[i]);
if(!str1.equals(" ") || !str1.equals(""))
if(str2.length() > 0 || !str2.endsWith(", "))
str2+= ", ";
str2 += str1;
if(!str2.equals(""))
out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Title, Affiliation</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>");
out.println(str2);
out.println("</td></tr>");
str2="";
str1 = disp(rs.getString(4),keywords[i]);
if(!str1.equals(" ") || !str1.equals(""))
str2 = str1;
str1 = disp(rs.getString(5),keywords[i]);
if(!str1.equals(" ") || !str1.equals(""))
if(str2.length() > 0 || !str2.endsWith(", "))
str2+= ", ";
str2 += str1;
str1 = disp(rs.getString(6),keywords[i]);
if(!str1.equals(" ") || !str1.equals(""))
if(str2.length() > 0 || !str2.endsWith(", "))
str2+= ", ";
str2 += str1;
str1 = disp(rs.getString(7),keywords[i]);
if(!str1.equals(" ") || !str1.equals(""))
if(str2.length() > 0 || !str2.endsWith(", "))
str2+= ", ";
str2 += str1;
str1 = disp(rs.getString(8),keywords[i]);
if(!str1.equals(" ") || !str1.equals(""))
if(str2.length() > 0 || !str2.endsWith(", "))
str2+= ", ";
str2 += str1;
if(!str2.equals(""))
out.println("<tr><td valign=top width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Address </td>");
out.println("<td><font face=\"verdana, geneva, arial, sans-serif\" size=2>");
out.println(str2);
out.println("</td></tr>");
str1 = disp(rs.getString(9),keywords[i]);
if(!str1.equals(" ") || !str1.equals(""))
out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Phone</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
str1 = disp(rs.getString(10),keywords[i]);
if(!str1.equals(" ") || !str1.equals(""))
out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Fax</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
str1 = disp(rs.getString(11),keywords[i]).toLowerCase();
if(!str1.equals(" ") || !str1.equals(""))
out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>eMail</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
str1 = disp(rs.getString(12),keywords[i]).toLowerCase();
if(str1.equals("null") || str1.equals(" ") || str1.equals(null))
str1="";
else
out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Web Site</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
str1 = disp((rs.getString(13)).replace(',',' '),keywords[i]);
if(str1 == "null" || str1 == null || str1 == "")
//if(!rs.wasNull())
out.println("nothing");
else
out.println("<tr><td width=150><font color = green face=\"verdana, geneva, arial, sans-serif\" size=2><b>Key Words</td><td><font face=\"verdana, geneva, arial, sans-serif\" size=2>"+str1+"</td></tr>");
out.println("<tr><td width=150><hr></td><td><hr></td></tr>");
out.println("</table><br>");
} // end while
} // end if
catch(Exception e)
System.out.println("Exception while executing query: "+ e);
} // end for
if(!found)
out.println("<center><font color=#ff9999 face=\"verdana, geneva, arial, sans-serif\" size=2><b>Searched for \""+ key+"\", ");
out.println("Total Matches found : 0</center><br>");
out.println("<center><a href=\"javascript:myclose()\"><font color=red face=\"verdana, geneva, arial, sans-serif\" size=2>Close</a></center>");
out.println("</body></html>");
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws IOException,ServletException
doPost(req,res);
public String disp(String str1, String str2)
int i,j,k;
boolean found=false;
String s1,s2,s3;
String t1,t2;
t1 = initCap(str1);
s1 = t1.toLowerCase();
s2 = str2.toLowerCase();
for(i=0;i<s1.length() && !found ;i++)
k=i;
for(j=0;j<s2.length() && k < s1.length() && s1.charAt(k) == s2.charAt(j) ;j++,k++);
if(j==s2.length())
found=true;
if(found)
i--;
s3 = t1.substring(0,i);
s3 += "<font color=blue face=\"verdana, geneva, arial, sans-serif\" size=2><b>";
s3 += t1.substring(i,i+str2.length());
s3 += "</font></b>";
s3 += t1.substring(i+str2.length(),t1.length());
else
s3 = t1;
return s3;
public String initCap(String str)
StringTokenizer st = new StringTokenizer(str," ");
String s1="";
String s2="";
String s3="";
String s4="";
while(st.hasMoreElements())
s1 = (String)st.nextElement();
if(s1.length() > 0)
s2 = s1.substring(0,1);
s2 = s2.toUpperCase();
if(s1.length() > 1)
s3 = s1.substring(1,s1.length());
s2 += s3;
s4 +=" "+s2;
return s4; -
Issue with 'null' value in Formulas
Hi all - I have a PDF in which I'm performing various calculations, basic addition and subtraction. I'm using the following Custom Calculation Script:
this.getField("Amount, Total Revenue Allocated to Maintenance Expenses").value = this.getField("Amount, Endowment Care Fund Income - Schedule H").value + this.getField("Amount, Special Care Fund Income - Schedule H").value + this.getField("Amount, Income from Cemetery Operations").value + this.getField("Amount, Other Sources Please Specify").value;
My issue is that when someone deletes a value in one of the fields (which I guess causes the field to be 'NULL'), the calcualtion doesn't work....so in other words if I have the following:
Field 1: 10
Field 2: 20
Field 3: 30
Field 4: 40
When adding this should result in 100.....however if one were to delete the value in field 2, my calcualtion then produces 103,040....the formula doesn't know how to process the NULL value of course, so it concatenates the numbers.
How do I get around this? Do I need more JavaScript, and if so is there a good example somewhere on how to code it?
Thanks, Steveleahfst,
If these dates are complementary (as in 'either date1 either date2 has a value) you could transform the dates to text, merge these two fields (one being empty) and convert the result back to a date:
Date(ToText({CnFGf_1.CnFGf_1_Date}) & ToText({CnFGf_2.CnFGf_2_Date}))
If these dates can both have a value (or not), it is helpful to know a null-value for dates is equal to Date(0000,00,00). In this situation, there can be the following situations:
1. Both dates are empty. Your result will obviously be an empty date.
2. {CnFGf_1.CnFGf_1_Date} has a value, {CnFGf_2.CnFGf_2_Date} is empty.
3. {CnFGf_1.CnFGf_1_Date} is empty, {CnFGf_2.CnFGf_2_Date} has a value.
4. Both dates have a value. You will have to choose which date should be used.
For any of these four situations, you can check the date to have a value using:
IF {CnFGf_1.CnFGf_1_Date} = Date(0000,00,00)
and so on.. -
Javascript:void(null) error while saving a request
Hi All,
I am not able to save/open a request in Answers.
Whenever I click on 'save request' or 'open request' button on the top right corner of the screen on the Answers page, it displays javascript:void(null) and do not prompt me to save or open a request.
Issue is when I am using Internet Explorer as a web browser. However everything works fine when it's (Answers) accessed through Mozilla Firefox.
Also the issue only occurs when OBIEE is configured for SSO and I am accessing OBIEE link through Portal.
I followed all the steps as on http://support.microsoft.com/kb/308260, just to find that the issue is not with IE.
Could anyone tell me plese if it's something to do with OBIEE.
Any help on the same will be appreciated.
Thanks,
DeepakHave you tried it with IE6 or IE8?
Can you try enabling notification about all javascript errors: (Tools -> Internet Options -> Advanced tab -> click "Display a notification about every script error")
That it works on Firefox suggests that it is a problem with IE
You could dig around a bit with a javascript debugger: http://www.jonathanboutelle.com/mt/archives/2006/01/howto_debug_jav.html
Does it work if you go into Answers directly, not through the portal? -
Not to display the null values from data base
Hiiii.
In a jsp file i have ten check boxes.The jsp file is mapped to a servlet file for parameter requesting and to
store it in DB.
The unchecked box values has null values.All the values are store in a Mysql DB table.
Again i have to display it in a jsp page from table.
The problem am facing was,how can i display only the values in a row.it must not display the null values and the crresponding column name.
Or any other way is their like below
How i can retrieve only the selected check boxes from tht jsp file.and store in backend.
Thanks in Advance
regards,
satheesh kannanHere is a rough example that may give you some ideas:
On the JSP page:
<%if(myData.getFirstName()!=null){%>
Your First Name'
<input type="text" name="firstName" value="<%=myData.getFirstName()%>">
<%}%>
In the servlet:
String firstName= request.getParameter("firstName");
if(firstName!=null){
//write it to the database
} -
JDBC MS Access--- cannot extract entry with null value with data type Meta
I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
Any advice will be appreciated! thanks!
Following are the table description and JDBC code:
test table has the following attributes:
Field name Data Type
name Text
label Memo
table contents:
name label
me null
you gates
Code:
String query = "SELECT name, label FROM test where name like 'me' ";
ResultSet rs = stmt.executeQuery(query);
while (rs.next())
String name = rs.getString("name");
rs.getString("val");
String label = rs.getString("label");
System.out.println("\t"+name+"\t"+label);
catch (SQLException ex)
System.out.println(ex.getSQLState());
System.out.println(ex.getErrorCode());
System.out.println("in sqlexception");
output:
C:\Temp\SEFormExtractor>java DBTest
yet SELECT name, label FROM test
null
0
in sqlexceptionThe question is how to extract null entry with data type memo?Okay, what you need to do is this:
if (rs.getString("val") == null)
// do something
}This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception. -
Index (or not) for excluding NULL values in a query
Hello,
I have table that can become very large. The table has a varchar2 column (let's call it TEXT) that can contain NULL values. I want to process only the records that have a value (NOT NULL). Also, the table is continuously expanded with newly inserted records. The inserts should suffer as little performance loss as possible.
My question: should I use an index on the column and if so, what kind of index?
I have done a little test with a function based index (inspired by this Tom Kyte article: http://tkyte.blogspot.com/2006/01/something-about-nothing.html):
create index text_isnull_idx on my_table(text,0);
I notice that if I use the clause WHERE TEXT IS NULL, the index is used. But if I use a clause WHERE TEXT IS NOT NULL (which is the clause I want to use), a full table scan is performed. Is this bad? Can I somehow improve the speed of this selection?
Thanks in advance,
FransI build a test case with very simple table with 2 columns and it shows that FTS is better than index access even when above ratio is <= 0.01 (1%):
DROP TABLE T1;
CREATE TABLE T1
C1 VARCHAR2(100)
,C2 NUMBER
INSERT INTO T1 (SELECT TO_CHAR(OBJECT_ID), ROWNUM FROM USER_OBJECTS);
BEGIN
FOR I IN 1..100 LOOP
INSERT INTO T1 (SELECT NULL, ROWNUM FROM USER_OBJECTS);
END LOOP;
END;
CREATE INDEX T1_IDX ON T1(C1);
ANALYZE TABLE T1 COMPUTE STATISTICS
FOR TABLE
FOR ALL INDEXES
FOR ALL INDEXED COLUMNS
SET AUTOTRACE TRACEONLY
SELECT
C1, C2
FROM T1 WHERE C1 IS NOT NULL;
3864 rows selected.
real: 1344
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=59 Card=3864 Bytes=30912)
1 0 TABLE ACCESS (FULL) OF 'T1' (Cost=59 Card=3864 Bytes=30912)
Statistics
0 recursive calls
0 db block gets
2527 consistent gets
3864 rows processed
BUT
SELECT
--+ FIRST_ROWS
C1, C2
FROM T1 WHERE C1 IS NOT NULL;
3864 rows selected.
real: 1296
Execution Plan
0 SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=35 Card=3864 Bytes=30912)
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'T1' (Cost=35 Card=3864 Bytes=30912)
2 1 INDEX (FULL SCAN) OF 'T1_IDX' (NON-UNIQUE) (Cost=11 Card=3864)
Statistics
0 recursive calls
0 db block gets
5052 consistent gets
3864 rows processed
and just for comparison:
SELECT * FROM T1 WHERE C1 IS NULL;
386501 rows selected.
real: 117878
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=59 Card=386501 Bytes=3092008)
1 0 TABLE ACCESS (FULL) OF 'T1' (Cost=59 Card=386501 Bytes=3092008)
Statistics
0 recursive calls
0 db block gets
193850 consistent gets
386501 rows processedHence you have to benchmark you queries with and w/o index[es] -
Null values passed into the servlet
Hi all,
I keep getting null values for all the params that I pass into the servlet i.e. sqltype, producttype, process, instance etc....I have attempted to print some of them out on the screen but I keep getting the 'NullPointerException' error message...can anyone tell me what it is that I have down wrong in the below code?
If I run the servlet with method calls that have hardcoded arguments in them it works but not when I pass in the params from the URL...I am absolutley puzzled!
Help!
package blotter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.db.util.WriteToLogFile;
import blotter.cache.*;
Servlet to extract an object that has already been placed
in the cache by GetBondPrices servlet from the cache.
public class ExtractSecurityObject extends HttpServlet
String sqlType = "";
String productType = "";
String instance = "";
String process = "";
String asOfDate = "";
String currencyCode = "";
String curveId = "";
String results = "";
private String debug;
private PrintWriter out;
private WriteToLogFile logFile;
// called when servlet first initialised
public void init(ServletConfig config) throws ServletException
super.init(config);
// method called for each get request
public void doGet( HttpServletRequest request, HttpServletResponse response )
throws ServletException, IOException
String toWrite = " ";
// Get the object identifier from the parameters passed in
sqlType = request.getParameter("sqltype");
productType = request.getParameter("producttype").toUpperCase();
instance = request.getParameter("instance");
process = request.getParameter("process");
asOfDate = request.getParameter("asofdate");
curveId = request.getParameter("curveid");
currencyCode = request.getParameter("ccy").toUpperCase();
out.println(currencyCode);
if ( request.getParameter("debug") !=null)
debug = request.getParameter("debug");
else
debug ="";
// set the mime type to html
response.setContentType( "text/html" );
out = response.getWriter();
out.println("<HTML>");
try
// write some parameters to a log file
toWrite = toWrite + "<li>" + getServletInfo() + " at " + new Date() + " " + sqlType + " " +
productType + " " + instance + " " + process + " " + asOfDate + " " + curveId + " " +
currencyCode;
CachedObject o1 = (CachedObject)CacheManager.getCache("EB_" + currencyCode + productType + asOfDate);
if(o1 == null){
CacheSecurityObject cso = new CacheSecurityObject();
if((request.getParameter("sqltype") == null) && (request.getParameter("instance") != null)){
results = (String)cso.putSecurityinCache(null, request.getParameter("producttype"), request.getParameter("instance"), request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
//results = (String)cso.putSecurityinCache(null, "yc", "frafu", "official", "20011105", "baceod", "sek");
out.println(results);
} else {
//results = (String)cso.putSecurityinCache("bondtypes", "bond", null, "official", "20011105", "baceod", "eur");
results = (String)cso.putSecurityinCache(request.getParameter("sqltype"), request.getParameter("producttype"), null, request.getParameter("process"), request.getParameter("asOfDate"), request.getParameter("curveId"), request.getParameter("currencyCode"));
out.println(results);
else{
out.println(((String)o1.object).toString());
// general catch for all exceptions
catch(Exception exception)
out.println( "Exception: The item that you requested was not found in the cache" + "<BR>" );
toWrite = toWrite + "Exception : " + exception.getMessage() + "\n" ;
finally
// write to logfile
logFile = new WriteToLogFile();
logFile.setSourceDirName("blotter");
logFile.setQuery(request.getQueryString());
logFile.setServletPath(request.getServletPath());
if (toWrite!=null)
logFile.writeLog(getServletInfo(),toWrite);
out.println("</HTML>");
out.close();
// need the class name for log file
public String getServletInfo()
return this.getClass().getName();
}That section of the code references a cache to extract an item that has been requested by the user. If the item is not in the cache i.e. if(o1 == null) then it will call a class that generates that object and places that object into the cache. The second time the user makes the same call then they will be handed a cached copy of that object which is aimed to make the whole servlet call faster.
That section of the code works fine coz I have tested that separately. It is the reading in of the arguments that is causing the problem. -
How to validate if a column have NULL value, dont show a row with MDX
Hello,
I have this situation, I have a Result from MDX that return rows with values NULL on columns, I tried with NON EMPTY and NONEMPTY but the result is the same. That I want to do is validate if a column have a Null value discard the row, but I dont know how
to implement it, could somebody help me?, please.
Thanks a lot.
Sukey Nakasima
Sukey NakasimaHello,
I found the answer in this link https://social.technet.microsoft.com/Forums/sqlserver/en-US/f9c02ce3-96b2-4cd6-921f-3679eb22d790/dont-want-to-cross-join-with-null-values-in-mdx?forum=sqlanalysisservices
Thanks a lot.
Sukey Nakasima
Sukey Nakasima -
How to differentiate the EMPTY Records and Null Values in DSO
Hello....how is everyone here?? Ehehehe!
I try to load some data from the flat file which contains some EMPTY data and Null Values for the records. The data type for the InfoObjects of the fields "Quantity" is "number". The sample data from the flat file (CSV) are as below:
Food Quantity
Hamburger - 12
Cheese - 0
Vegetable - (Empty)
When I try to load the above sample data to the DSO, I get the results of the data as follow:
Food Quantity
Hamburger - 12.000
Cheese - 0.000
Vegetable - 0.000
In this case, how can the user differentiate whether the records is contain empty value of null values in DSO? This is kinda of hard to differentiate the both scenarios above. Is there any way to differentiate the scenarios described here?
Thanks alot =)Hi Fluffy,
It depends on the initial values of the data type
The inital values For quantity/Currency/ Numbers it takes spaces as 0
for char it is SPACE
We cannot differeniate between space and null values.
IF you have to force this then define quantity as char and load the data. we will not have units and aggregation in this case.
Hope this helps.
PV -
Distinguishing between empty string and null values
hi all,
I am using an ODBC connection to connect my java app to database using JDBCODBC driver. I have 2 columns 'aColumn' and 'bColumn' in my table, both allow null values. I have one row in it, which has null value in aColumn and empty string in bColumn. I retrieve this row's data and assign it to 2 columns : 'aColumnVar' and 'bColumnVar' respectively. I find out that both 'aColumnVar' and 'bColumnVar' variables has null values (although bColumnVar should has an empty string as its value). Now my ODBC connection Data Source has the option "Use ANSI nulls, paddings, and warnings" ON. I turn it off and try again. This time both 'aColumnVar' and 'bColumnVar' variables has empty string as values (although aColumnVar should has null as its value).
How can I make sure that i can get the data exactly as it is in the database in my variables?
Thanksthere is a wasNull() method on ResultSet. After you
have obtained the value of a column e.g. by calling a
method like getString you can call wasNull and if it
returns true then the value on the database is null.
Check the java docs, it might explain it better
http://java.sun.com/j2se/1.4.1/docs/api/java/sql/Result
et.html#wasNull()I am using MS SQL Server 7.0 under Windows NT 4.0 with JDK 1.2. My ODBC connection Data Source has to have the option "Use ANSI nulls, paddings, and warnings" ON.
I try the wasNull() method but it is doing the same thing i.e. telling me that a column is null when in database it is null (right); and a column is null when in database it is an empty string (wrong). I suspect it is something to do with the JDBC-ODBC driver I am using.
Maybe you are looking for
-
Data Extraction - Cancelled Sales Order
Dear BW Experts, In the business scenario, we are extracting 2LIS_11_VASCL (Scheduling line) and 2LIS_12_VCSCL(Shipping Scheduling line delivery). I found that canceled sales order in the BW system but those sales order are not exist in R/3. We extr
-
Show Reminders in iCal not showing
I've just discovered Reminders - and I love it! But I can't get it to show up in iCal, either on my Macbook Air or in iCloud on the web. In the view menu, I don't see the Show Reminders option. Help!
-
Error when Opening After Effects CS6 Trial
Hey, When I go to open After Effects CS6 Trial I get an error saying "After Effects error: Crash in progress. Last logged message was: <956> <ae.blitpie> <2> Making New Context" and then I click ok and it says "After Effects can't continue: sorry, Af
-
Officejet 7310 Print Spooler Unable to connect to your Printer
Hello, this problem cropped up last week after I applied a series of Windows XP automatic updates. I've seen a number of old posts on this problem, along with the series of solutions on the HP site, but none of worked reliably -- read on for more de
-
What is the proper syntax to hide a div on the stage from within two nested symbols?
Hi everyone, I have recently started to use Adobe Edge and had some prior experience with Flash. I have a button with a click action inside two symbols that should hide a symbol placed on the stage, which in turn its is parent symbol. I tried using t