- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我目前在使用 AS400(iseries V6R1)和 Debian 之间的 odbc 链接设置内部网时遇到一些问题,我使用 iseriesAccess7.1 odbc 驱动程序 64 位、unixODBC2.3.1 和支持 unixODBC 的 php5.4。
我的链接似乎很好,因为我可以使用 isql 命令(它是 unixODBC 的一部分)连接到我的数据库并执行一些 SQL 查询,但是不可能使用 php 脚本读取数据库中的记录。当我尝试在我的 Intranet 上启动一个小脚本时,出现以下错误:
fatal error :在第 122 行的/home/www/imypdo/imypdo.php 中允许的 134217728 字节的内存大小已耗尽(试图分配 493921239296 字节)
超过 450 Gb !!/var/log/messages 和/etc/httpd/logs/error_log 中没有任何内容
一个简单的 sql 查询(选择中只有 1 行)将返回一些奇怪的字符(见下文),一旦我再选择 1 或 2 行,就会发生内存大小错误。
[0] => 数组 ( [ADHMAR] => AAAAAAA a@YÿŒ4–X 0!ÿŒ4làÿŒ4làÿŒ4!)
我几乎可以肯定这是一个与 64 位驱动程序相关的问题,因为我已经有另一个 Debian 链接到这个系列,但使用 32 位驱动程序并且它工作得很好。奇怪的是 isql 命令正在运行,但日志文件中没有任何内容...
如果真的是 64 位驱动问题,我如何向 IBM 证明?
任何帮助将不胜感激
谢谢
------------------------ 连接类---------------- ----------
private $_bdd = "DSN=db2;",
$_user = "USERNAME",
$_pwd = "Password";
private $_con,
$_isConnected;
public function open_connection(){
$this->_con = odbc_connect ($this->_bdd, $this->_user, $this->_pwd ) or die("Error Connection") ;
$this->_isConnected = true;
}
public function close_connection(){
odbc_close($this->_con);
$this->_isConnected = false;
}
public function execute($sql){
if(!($this->_isConnected))
$this->open_connection();
#execute sql
$res = odbc_exec($this->_con, $sql);
return $res;
}
public function fetchRow($res){
$row = odbc_fetch_array($res);
return $row;
}
-------------------------------- 查询脚本------------ ------------------
public function getPhoneLogsByDate($startDate, $endDate) {
$startDate = date('Ymd', strtotime($startDate));
$endDate = date('Ymd', strtotime($endDate));
$rr = new As400_Model_as400query();
$rr->open_connection();
$sql = "select trim(tluser) as USER, trim(tlacct) as CLIENT, trim(concat(concat(concat(concat(concat(concat(substr(trim(tldate),1,4),'-'),substr(trim(tldate),5,2)),'-'),substr(trim(tldate),7,2)),' '), concat(concat(concat(concat(substr( substr(trim(tltime+1000000),2,6),1,2),':'),substr(substr(trim(tltime+1000000),2,6),3,2)),':'), substr(substr(trim(tltime+1000000),2,6),5,2)))) as DATETIME
,trim(concat(concat(concat(concat(concat(concat(concat(concat(concat(concat(trreas,'|'),trsr01),'|'),trsr02),'|'),trsr03),'|'),trsr04),'|'),trsr05)) as REASONS
,trim(concat(concat(concat(tnnot1,tnnot2),tnnot3),tnnot4)) as NOTES
from cabledta.tlogmstr left join cabledta.tlogreas on trnum#=tlnum# left join cabledta.tlognote on tnnum#=tlnum#
where tldate>='".$startDate."' and tldate <='".$endDate."'";
$res = $rr->execute($sql);
$response = array();
while ($row = $rr->fetchRow($res)){
$response[] = array(
'userName' => $row['USER'],
'clientNumber' => $row['CLIENT'],
'logDateTime' => $row['DATETIME'],
'logReasons' => $row['REASONS'],
'logNotes' => utf8_encode($row['NOTES'])
);
}
$rr->close_connection();
return $response;
}
最佳答案
我想通了。
在 64 位版本中,当其中一个返回字段为 NULL 时,odbc 会崩溃。因此,解决方法是在检索查询时替换所有空字段。
例子:
从数据库表中选择 ifnull(tluser,'') 作为 USER
关于php - Linux odbc fatal error : Allowed memory size,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21286589/
使用Suitecrm 7.9.1 每当我尝试创建销售线索时(即提交创建销售线索表格后),我都会遇到以下错误。 每当我尝试导入csv文件时,都会遇到相同的错误。仅在实时服务器上发生此错误 Fatal e
Closed. This question is not reproducible or was caused by typos。它当前不接受答案。 想改善这个问题吗?更新问题,以便将其作为on-to
我想在QNX上运行GoogleTestLibrary吗? 但是我收到此错误消息? ldd:FATAL: Could not load library libgtest.so.0 首先,我使用make命
尝试编译代码时,IDE 中显示的 fatal error 和非 fatal error 之间的主要区别是什么? 在这两种情况下,编译器都会显示一条错误消息,并且不会编译程序。 fatal error
当一个人试图编译代码时,在 IDE 中显示的 fatal error 和非 fatal error 之间的主要区别是什么? 在这两种情况下,编译器都会显示一条错误消息,并且程序不会被编译。 fatal
这个程序发出app: 2015/10/24 11:28:15 example.go:22: open some-crazy-non-existent-file: no such file or dir
因此,我正在从事一个项目,但是由于不断收到错误和警告,所以我遇到了一个问题。我对PHP还是很陌生,所以要保持柔和。使用PHP 5.5可以正常运行该程序。但是,当我在PHP 5.6中运行该程序时,会收到
在 WiX 安装程序中 - 如何自定义或覆盖 fatal error 对话框 ()?我想显示详细的错误消息而不是默认设置失败消息。 选项: 是否可以在 WiX 中调整 fatal error 对话框的
我正在尝试通过 Android 工具 > 重命名应用程序包 在 eclipse 中重命名我的 android 应用程序包。它正在生成错误说 A Fatal error occurred while p
我正在使用 Ubuntu 13.10 x64,我正在做一些开发人员正在使用 Windows 的项目,我最近将 git config core.eol 更改为“lf”和 core .autocrlf 为
嗯..世界上的每个服务都可以连接到我的动物园管理员,除了 kafka。下面是我在 server.properties 文件中的连接字符串 zk.connect=1.dzk.syd.druid.neo.
我正在 Java EE 7 中尝试一些东西,我已经构建了一个示例应用程序,可以在此处找到 https://github.com/kenparker/moviplex7.git . 在此过程中,我了解到
我正在尝试使用 bitbucket 中的 ssh 克隆我的存储库,但是每当我克隆存储库时,我都会得到: Connection to bitbucket.org closed by remote hos
该代码包括从一系列数字创建一个数组,以及第三个参数,其中它指示数字的步长,如果它的步长为 2,例如它来自 [1,3, 5] 代码工作正常,除非我以负数作为参数传递 step,例如NumberRange
我正在尝试在我的 ubuntu 中运行一个简单的 git pull 命令。直到几天前,它还可以完美地工作。不是它显示致命:无法访问“https://xxxxxx@bitbucket.org/repon
我知道已经有人问过类似的问题。 但是,我认为我的问题是由于我之前犯的一个错误,因此有所不同:让我解释一下。 一切都如我所愿顺利进行: git add . 我本地存储库中的所有文件。 git commi
我在尝试执行 Jenkins 作业时看到错误。 git 版本 1.8.3.1 Jenkins 2.46.2.1-滚动 我尝试将 git 升级到更高版本,但仍然通过关注 How to install l
Image of the output in the browser 我正在离线处理一个项目。我有一个名为 index.php 的文件。 现在我想在可以编辑的浏览器 sp 中启动。 但是当我尝试通过
我正在AWS的Linux机器上运行RServer Studio。 我尝试安装ModelMetrics的依赖项caret,并收到此错误: auc_.cpp:2:10: fatal error: omp.
我似乎没有重复发帖,所以这是详细信息... 当我使用 XOM(XML 对象模型,Java 库)中的非静态方法 Builder.build() 解析文档时,在 Eclipse 控制台中我得到: [Fat
我是一名优秀的程序员,十分优秀!