昨天我在生产过程中遇到了一个奇怪的错误.声明执行失败
if v_cursor%isopen then
close v_cursor; -- here was an error
end if;
Run Code Online (Sandbox Code Playgroud)
经过一番挖掘,我发现问题出现在打开这个光标的子程序中.我通过在子程序中添加输出参数sys_refcursor来修复bug.为了澄清情况,请考虑以下测试代码:
procedure nested_test(test number,
p_cur out sys_refcursor)
is
procedure nested_procedure_fail is
begin
open p_cur for
select 1, 2, 3, 4
from dual
where 1 = 0;
end;
procedure nested_procedure_success(p_cur out sys_refcursor) is
begin
open p_cur for
select 1, 2, 3, 4
from dual
where 1 = 0;
end;
begin
if test = 1 then
nested_procedure_fail;
else
if test = 2 then
nested_procedure_success(p_cur => p_cur);
else
open p_cur …Run Code Online (Sandbox Code Playgroud) 我有无序列表,里面有两个浮动div.一个在左边,一个在右边.在Chrome中,我看到顶部有空白.在IE中一切似乎都很好.如何摆脱这个空白?
样式:
ul {
margin: 1em;
}
li {
width: 100%;
padding: 0;
margin: 0.5em;
border: 1px black solid;
}
.clear {
clear: both;
}
.left-item {
float: left;
background-color: red;
padding: 1em;
}
.right-item {
float: right;
background-color: blue;
padding: 1em;
}
Run Code Online (Sandbox Code Playgroud)
HTML代码:
<ul>
<li>
<div class="left-item">Item 1</div>
<div class="right-item">Item 2</div>
<div class="clear"></div>
</li>
<li>
<div class="left-item">Item 1</div>
<div class="right-item">Item 2</div>
<div class="clear"></div>
</li>
<li>
<div class="left-item">Item 1</div>
<div class="right-item">Item 2</div>
<div class="clear"></div>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)