您好,欢迎访问一九零五行业门户网

php查询oracle 临时表,为啥为空

php查询oracle 临时表,为什么为空?
$dboracle=oci_connect(数据库连接都是正常的,查询不是临时表都正常);
$oraclesql=.
begin .
insert into fs_tt.
select * .
from fs .
where rownum <2;.
end;;//不用begin 直接写sql也是一样的 $stid = oci_parse($dboracle, $oraclesql);
$r=oci_execute($stid);
print_r($r);
$oraclesql=select * from fs_tt;
$stid = oci_parse($dboracle, $oraclesql);
$r=oci_execute($stid);
print_r($r);
//上面sql在plsql里面执行都没有问题,能查询出 临时表新插入的数据
//但是php就查询不出来
//把临时表,改成正是表,php就可以查询出来
//什么原因呢?我现在还算是在一个会话里面把?
//权限?我php连接用的用户名密码,和plsql用的一样
while ($row = oci_fetch_assoc($stid)){
echo $row['name'],
\n;
}

------解决方案--------------------
可能是  where rownum ; 后面的分号导致的查询失败

$oraclesql = insert into fs_tt select * from fs where rownum 看看
其它类似信息

推荐信息