Hello *,
> > Linux RedHat 7.3, Php 4.1.2, unixODBC 2.0.5
> > SAP DB 7.3.0.23
> >
> > Can anyone please confirm this?
> The problem is, that you didn't locate the problem. It might be within
> unixODBC, PHP
No, because same PHP code I posted, running all trough unixODBC works correct
for Informix, MySQL and PostgreSQL.
Here is the code:
<?php
function newline($conn) {
#create table
$sql = "create table newline(testingfield varchar(100))";
odbc_do($conn, $sql);
$sql = "delete from newline";
odbc_do($conn, $sql);
$newline=chr(13).chr(10);
$string="abcd".$newline."123";
echo $string;
#store a string
$sql = "insert into newline values ('".$string."')";
odbc_do($conn, $sql);
echo "\n\n\n<BR><BR><BR>\n\n\n";
#retrive stored string
$sql = "select * from newline";
$results=odbc_do($conn, $sql);
if ($results) {
while (odbc_fetch_into($results,$row)) {
echo $row[0];
}
}
odbc_free_result($results);
odbc_close($conn);
}
// ======================= main ============================
$newline=chr(13).chr(10);
echo "\n\n\n<BR>==SAP DB==<BR><BR>\n\n\n";
$conn= odbc_connect("postnuke", "pn", "xxxx") or die(odbc_errormsg());
newline ($conn);
echo "\n\n\n<BR>==MySQL==<BR><BR>\n\n\n";
$conn= odbc_connect("mysql_pn", "root", "xxxxx") or die(odbc_errormsg());
newline ($conn);
echo "\n\n\n<BR>==Informix==<BR><BR>\n\n\n";
$conn= odbc_connect("ifx", "informix", "xxxxx") or die(odbc_errormsg());
newline ($conn);
echo "\n\n\n<BR>==PostgreSQL==<BR><BR>\n\n\n";
$conn= odbc_connect("pg_test", "root", "xxxxxx") or die (odbc_errormsg());
newline ($conn);
echo "\n\n\n<BR>==End==<BR><BR>\n\n\n";
die;
?>
Here is the output (HTML source):
<BR>==SAP DB==<BR><BR>
abcd
123
<BR><BR><BR>
abcd 123
<BR>==MySQL==<BR><BR>
abcd
123
<BR><BR><BR>
abcd
123
<BR>==Informix==<BR><BR>
abcd
123
<BR><BR><BR>
abcd
123
<BR>==PostgreSQL==<BR><BR>
abcd
123
<BR><BR><BR>
abcd
123
<BR>==End==<BR><BR>
> or even SAPDB's ODBC-driver.
Nothing else left. I'm very confident this is the case.
> You should try to configure PHP with the "--with-sapdb" option to
> exclude unixODBC from the list.
Can't do that, because of other dependencies, but 3 other ODBC drivers running
via unixODBC don't exhibit this problem. BTW, checked the source code of PHP
ODBC functions, only specifics for SAP DB there are include headers (before I
added workaround for timestamp micro time bug in SAP DB ODBC driver - I
reported this few days ago). Which are standard Microsoft headers anyway...
Additionally, SAP DB driver is still not linked with libm, and fails for all
clinets not linked themselves to it with:
[unixODBC][Driver Manager]Can't open lib
'/opt/sapdb/interfaces/odbc/lib/libsqlod.so' :
/opt/sapdb/interfaces/odbc/lib/libsqlod.so: undefined symbol: __fpclassify
Can someone please add the -lm to the link line?
> Or use the ODBC trace (http://sapdb.2scale.net/moin.cgi/ODBCTrace)
> to check what is actually seen by the driver.
It looks like CR and LF are allready stripped when they reach logging:
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body ><PRE><PLAINTEXT>
<html><head><meta http-equiv="Con
DATASOURCE: postnuke
SESSION : 1;
SQLMODE : INTERN
SERVERDB : TST
SERVERNODE: localhost
CONNECT "PN " IDENTIFIED BY :A ISOLATION LEVEL 1
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
delete from newline
PARSE : CMD :
WARNING: W---4-----------
mfIndex init : 1
PARSEID: OUTPUT: 000002F9 00000201 12000000 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
delete from newline
EXECUTE: CMD :
PARSEID: INPUT : 000002F9 00000201 12000000 01000000
SQLERRD(INDEX_3) : -1
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
PARSEID: DROP : 000002F9 00000201 12000000 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
SQCDROPPARSID
PARSEID: : 000002F9 00000201 12000000 01000000
insert into newline values ('abcd 123')
PARSE : CMD :
PARSEID: OUTPUT: 000002F9 00000401 23000000 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
insert into newline values ('abcd 123')
EXECUTE: CMD :
PARSEID: INPUT : 000002F9 00000401 23000000 01000000
SQLERRD(INDEX_3) : 1
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
PARSEID: DROP : 000002F9 00000401 23000000 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
SQCDROPPARSID
PARSEID: : 000002F9 00000401 23000000 01000000
select * from newline
PARSE : CMD :
mfIndex init : 2
PARSEID: OUTPUT: 000002F9 00000601 3C002C00 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
select * from newline
EXECUTE: CMD :
PARSEID: INPUT : 000002F9 00000601 3C002C00 01000000
mfIndex init : 2
mfIndex init : 2
WARNING: W-------8-------
SQLRESULTNAME : SQL_CURSOR_0003
SQLERRD(INDEX_3) : -1
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
MASS STATEMENT :
FETCH FIRST "SQL_CURSOR_0003"
PARSE : CMD :
WARNING: W--3------------
PARSEID: OUTPUT: 000002F9 00000801 2A002B00 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
MASS STATEMENT :
FETCH FIRST "SQL_CURSOR_0003"
EXECUTE: CMD :
PARSEID: INPUT : 000002F9 00000801 2A002B00 01000000
PARAMETER DESCRIPTION: 0x8126970
Application Kernel
Nr. Type Length Type Length Fraction
---------------------------------------------
1 7 101 31 100 0
OUTPUT : 1: TESTINGFIELD : abcd 123
SQLERRD(INDEX_3) : 1
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
MASS STATEMENT :
FETCH "SQL_CURSOR_0003"
PARSE : CMD :
WARNING: W--3------------
PARSEID: OUTPUT: 000002F9 00000901 2A002B00 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
MASS STATEMENT :
FETCH "SQL_CURSOR_0003"
EXECUTE: CMD :
PARSEID: INPUT : 000002F9 00000901 2A002B00 01000000
SQLCODE: 100 ROW NOT FOUND
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
CLOSE "SQL_CURSOR_0003"
PARSE : CMD :
PARSEID: OUTPUT: 000002F9 00000A01 06002800 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
CLOSE "SQL_CURSOR_0003"
EXECUTE: CMD :
PARSEID: INPUT : 000002F9 00000A01 06002800 01000000
PARSEID: SELECT: 000002F9 00000601 3C002C00 01000000
mfIndex init : 2
mfIndex restore : 2
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
PARSEID: DROP : 000002F9 00000801 2A002B00 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
SQCDROPPARSID
PARSEID: : 000002F9 00000801 2A002B00 01000000
PARSEID: DROP : 000002F9 00000901 2A002B00 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
SQCDROPPARSID
PARSEID: : 000002F9 00000901 2A002B00 01000000
PARSEID: DROP : 000002F9 00000A01 06002800 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
SQCDROPPARSID
PARSEID: : 000002F9 00000A01 06002800 01000000
mfIndex delete : 2
PARSEID: DROP : 000002F9 00000601 3C002C00 01000000
START : DATE : 2002-11-07 TIME : 0022:46:13
END : DATE : 2002-11-07 TIME : 0022:46:13
SQCDROPPARSID
PARSEID: : 000002F9 00000601 3C002C00 01000000
S1: DISCONNECT
SQCFINISH
Thanks for your help,
--
Yours, Andrej Falout, http://www.falout.com/disclaimer.html
Visit the OpenSource alternative, Aubit 4gl: http://aubit4gl.sourceforge.net
PLEASE NOTE: All HTML email sent to me WILL BE DELETED AUTOMATICALLY WITHOUT
READING.
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general