Ask a Question related to PHP Development, Design and Development.
-
sniper@php.net #1
#25499 [Opn->Fbk]: select * from tabname returns ebcdic data
ID: 25499
Updated by: [email]sniper@php.net[/email]
Reported By: mike dot mcsherry at ociofc dot usda dot gov
-Status: Open
+Status: Feedback
Bug Type: OCI8 related
Operating System: Windows 2000
PHP Version: 4.3.3
New Comment:
I made a quick search with google and run into this:
[url]http://www.solusoft.com/download/win/rdbms/81/8172note.html[/url]
(search it for EBCDIC)
Maybe you should try and install the patch mentioned in the document?
Previous Comments:
------------------------------------------------------------------------
[2003-09-11 18:27:31] mike dot mcsherry at ociofc dot usda dot gov
Description:
------------
I'm using php/oci8/apache/oracle sqlplus client (version 8.1.7.0.0)
from my pc to connect to an oracle data base (version 7.3.3.6.3) that
lives on an IBM mainframe. The data in the database is stored in
ebcdic (oh boy!) i.e. the nls_characterset setting in the db
nls_database_parameters view is set to WE8EBCDIC37C... When I run an
OCIExecute to say, select * from emp and do an OCIFetch the data comes
back in EBCDIC... when I OCIColumnName the column names come back in
ascii.. I wrote a little routine to convert the data from EB->ASCII
and the data then looks fine but I was hoping someone else like
oracle's protocol adapter (or you:) would handle it.. Sqlplus works
predictably as does perl on my pc. Any ideas?
Thanks
Mike McSherry (970)295-5196 (Colorado)
Reproduce code:
---------------
<?php
$conn = OCILogon("rvis", "rvis25","KCT1");
$stmt = OCIParse($conn,"select * from emp");
$result = OCIExecute($stmt, OCI_DEFAULT);
echo "<HTML><TABLE BORDER=1> ";
$ncols = OCINumCols($stmt);
echo "<TR>";
echo "<TH> 0 </TH>";
for ($i =1 ; $i <= $ncols; $i++)
{
$fld[$i-1] = OCIColumnName($stmt,$i) ;
$x = $fld[$i-1];
echo "<TH>".$x."</TH>";
}
echo "</TR>";
while ($a=OCIFetch($stmt))
{
echo "<TR>";
echo "<TD>".$a."</TD>";
for ($i = 0; $i < $ncols; $i++)
{
$result = OCIResult($stmt, $fld[$i]);
echo "<TD>".$fld[$i]." ".$result."</TD>";
}
echo "</TR>";
}
echo "</TABLE> </HTML>";
?>
Expected result:
----------------
0 EMPNO ENAME SAL
1 EMPNO 2222 ENAME Bill SAL
1 EMPNO 3333 ENAME Jim SAL
1 EMPNO 1111 ENAME Larry SAL
Actual result:
--------------
0 EMPNO ENAME SAL
1 EMPNO ENAME SAL
1 EMPNO ENAME щ SAL
1 EMPNO ENAME Ӂ SAL
note... when I convert the variables that are returned
from the select from EB-> ASCII it looks like expected.
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=25499&edit=1[/url]
sniper@php.net Guest
-
Returns no data?
Can't use the Web Service Connector to return data from my web service. Is there something wrong? I get an "error opening URL" in the output... -
is this whole file EBCDIC?
is this whole file EBCDIC? Or just the text part.? Thanks Record length is 114 Field between columns 10 and 14 is a packed-decimal number... -
#25499 [Fbk->Opn]: select * from tabname returns ebcdic data
ID: 25499 User updated by: mike dot mcsherry at ociofc dot usda dot gov Reported By: mike dot mcsherry at ociofc dot usda dot... -
#17739 [Com]: form select multiple returns double values
ID: 17739 Comment by: jo_jk at hotmail dot com Reported By: php at remove dot gustl dot net Status: No Feedback... -
ASCII and EBCDIC Tablespaces and performance on z/OS
We have to maintain the same collating sequence between an oracle database on NT and a db2 on z/OS. FOr this, we are planning to use an ascii...



Reply With Quote

