Tag Archives:

The decode function solves the problem that Oracle reports an error “divisor is 0”

When the company’s website was running, it suddenly reported an error and couldn’t open. When I opened it, I found an error: ora-01476: the divisor is 0

A search on the Internet found that many people encountered this problem. The solution is to use the decode function

Decode is a built-in function of Oracle

Explanation of meaning:
decode (condition, value 1, return value 1, value 2, return value 2,… Value n, return value n, default value)

The meaning of this function is as follows:
if condition = value 1 then
return (translation value 1)
elsif condition = value 2 then
return (translation value 2)

elsif condition = value n then
return (translation value n)
else
return (default)
end if

 

In short, decode (Exp1, 0, 0, exp2/Exp1) means that when Exp1 is equal to 0, exp2/Exp1 no longer reports an error, but returns 0. When Exp1 is not equal to 0, the result of exp2/Exp1 is returned

In the future, when writing SQL statements with division, try to use the decode function

 

A problem with 0 document. Documentelement. Clientwidth

Explain the function of static keyword and final keyword in Java in detail>>>

A little research on getting the visible window size of various browsers
& lt; script>
function getInfo()
{
var s = “”;
s = “the visible area of the web page is wide:” document.body.clientwidth
s = “high visible area of web page:” document.body.clientheight
s = “width of visible area of web page:” document. Body. Offsetwidth “(including width of border and scroll bar)”
s = “height of visible area of webpage:” document. Body. OffsetHeight “(including width of sideline)”
s = “document.body.scrollwidth
s = “document.body.scrollheight
s = “the height of the web page being rolled out (FF):” document.body.scrolltop
s = the height of the web page being rolled out: “document.documentelement.scrolltop
s = “the left side of the web page being scrolled:” document. Body. Scrollleft
s = “window.screentop
s = “window.screenleft
s = high screen resolution: “window.screen.height
s = width of screen resolution: “window.screen.width
s = “screen available workspace height:” window.screen.availheight
s = “window.screen.availwidth

s = your screen setting is “window.screen.colordepth” bit color
s = “your screen settings” window.screen.devicexdpi “pixel/inch”
//alert (s);
}
getInfo();
</ script> you can use
document. Body. Clientwidth
document. Body. Clientheight
in ie, Firefox and opera, which is very simple and convenient<
in company projects:
opera still uses
document. Body. Clientwidth
document. Body. Clientheight
but IE and Firefox use
document. Documentelement. Clientwidth
document. Documentelement. Clientheight
it turns out that W3C standards are making a fuss
& lt;! DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” ” http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd “>
if you add this line of tag to the page, in ie:
document. Body. Clientwidth = = > Body object width
document. Body. Clientheight = = > Body object height
document. Documentelement. Clientwidth = = > Visible area width
document. Documentelement. Clientheight = = > Visible area height
in Firefox:
document. Body. Clientwidth = = > Body object width
document. Body. Clientheight = = > Body object height
document. Documentelement. Clientwidth = = > Visible area width
document. Documentelement. Clientheight = = > The height of visible area

in Opera:
document. Body. Clientwidth = = > Visible area width
document. Body. Clientheight = = > Height of visible area
document. Documentelement. Clientwidth = = > Page object width (body object width plus margin width)
document.documentelement.clientheight = = > The height of page object (that is, the height of body object plus the height of margin)
if there is no W3C standard defined,
ie is:
document. Documentelement. Clientwidth = = > 0
document.documentElement.clientHeight ==> 0
Firefox is:
document. Documentelement. Clientwidth = = > Page object width (body object width plus margin width) document.documentelement.clientheight = = > Page object height (body object height plus margin height)
opera is:
document.documentelement.clientwidth = = > Page object width (body object width plus margin width) document.documentelement.clientheight = = > Page object height (body object height plus margin height)