php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73785 pdo_ibm driver - keywords not supported -"I5_ATTR_DBC_SYS_NAMING" and "I5_ATTR_
Submitted: 2016-12-19 11:10 UTC Modified: -
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: shlomo dot v at zend dot com Assigned:
Status: Open Package: PDO_IBM (PECL)
PHP Version: 5.6.29 OS: IBM i OS V7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
27 - 2 = ?
Subscribe to this entry?

 
 [2016-12-19 11:10 UTC] shlomo dot v at zend dot com
Description:
------------
Problem using the pdo_ibm driver with PHP 5.6 and 7.

Following keywords not working with IBM i: 
"I5_ATTR_DBC_SYS_NAMING" and "I5_ATTR_DBC_CURLIB"

$db_pdo_ibm = [
'driver' => 'pdo',
'dsn' => 'ibm:E00XX73X',
'username' => strtoupper('XXXXXX'),
'password' => strtoupper('xxxxxx'),
'driver_options' => [
PDO::ATTR_AUTOCOMMIT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING,
PDO::ATTR_PERSISTENT => false,
//PDO::I5_ATTR_DBC_SYS_NAMING => true,
// PDO::I5_ATTR_DBC_CURLIB => '',
PDO::I5_ATTR_DBC_LIBL => 'YOURLIB',

You need to qualify the SQL statement with the schema/library to avoid "Undefined object errors" else it will use the connected User Name as the database name.



Test script:
---------------
$db_pdo_ibm = [
'driver' => 'pdo',
'dsn' => 'ibm:E00XX73X',
'username' => strtoupper('XXXXXX'),
'password' => strtoupper('xxxxxx'),
'driver_options' => [
PDO::ATTR_AUTOCOMMIT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING,
PDO::ATTR_PERSISTENT => false,
//PDO::I5_ATTR_DBC_SYS_NAMING => true,
// PDO::I5_ATTR_DBC_CURLIB => '',
PDO::I5_ATTR_DBC_LIBL => 'YOURLIB',


Patches

kievlywm (last revision 2017-01-30 15:48 UTC by sample at email dot tst)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-20 16:39 UTC] brandon at thebandit dot org
I was the original person reporting the issue to Zend. 

Works fine for me on PHP 5.6 (PHP 5.6.10 (cli) (built: Jul 12 2015 16:05:00)) running on IBM i. Have not tried the latest build 5.6.28. It does not work with PHP 7 (PHP 7.0.11 (cli) (built: Sep 28 2016 12:15:24) ( NTS )) running on IBM i.

I'm using the features per http://www.youngiprofessionals.com/wiki/index.php/XMLSERVICE/PHPPDOChangeLog.

Please feel free to contact me with any questions.

Thanks,
Brandon
 [2018-06-12 13:17 UTC] shlomo dot v at zend dot com
PDO IBM Version 1.3.4sq4 tested with PHP 7 latest Zend Server 9.1.4
 All seems to work on IBM i using the

'driver_options' => [PDO::I5_ATTR_DBC_SYS_NAMING => true, 
PDO::I5_ATTR_DBC_CURLIB => 'MY_LIB', 
PDO::I5_ATTR_DBC_LIBL => 'MY_LIB',
    ],
 [2023-05-15 07:03 UTC] careblogtophealth at gmail dot com
Top Health Care blog ut health, fitness, diettreatment, eye care, dental care etc. More info to visit:(https://tophealthcareblog.com)github.com
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC