RE: [PHP-DB] Re: oci8 cannot connect after restarting DB

2004-11-18 Thread Andreas Karajannis
On Thu, 2004-11-18 at 11:41 -0700, [EMAIL PROTECTED] wrote:
> During my presentation at the PHP Conference in Frankfurt I put
> out a call for participation in creating a roadmap for Oracle 
> connectivity in PHP.
> 
> When I get back to work (I'm on a short vacation in Europe with 
> intermittent email access) I'll be following up on this.  While I'm
> away, feel free to fill my inbox with suggestions and discussion
> of your application architecture requirements.

I've been recently looking into the OCI8 extension.
Alas, with PHP5 and multithreaded web servers (Apache2 et.al.), the
connection handling seems to be completly broken.

Using PHP5 and the current oci8 module in an mt environment leads to
sessions stacking up on a single server connection without getting
closed nor reused. I didn't try the classic multi process environment,
but I suspect the same broken behaviour to show up.

So what you get right now is a non working session multiplexing (ala
Oracle MTS) which surely is not what people want when the need
"connection pooling".

Another area where PHP Oracle support needs improvement is national
charset support. Currently NCLOBs simply don't work. 

Additionaly, the LOB handling support is more complex (using implicit
LOB descriptors) than it need to be, taking into consideration the LOB
handling capabilities introduced with OCI 9.2.

Using the new thread safe hash lists of PHP5, I've successfully
implemented (let's say proof of concept quality ;-)) an extension based
on the current OCI8 code that can use native OCI session pooling
(instead of implementing own connection pooling code) and is able to
handle national character data while mostly retaining backwards
compatability - "normal" connects are still possible besides predefinded
pools.

So what to do?

While I see great potential in PDO, having a common API as in JDBC or
ODBC would be great, it seems there isn't much development going in that
direction. 
Additionaly, every application would need a major rewrite to switch from
the current oci8 extension to something different.

So, building on the existing OCI8 extension and improving it in the
afore mentioned areas seems to a pragmatic approach while retaining PHP
API compatability for people already using Oracle with PHP.

This would mean dropping support for client libraries before Oracle 9.2,
making it possible to throw away much of the convoluted legacy stuff in
the connection / LOB handling code.
Remember, with OCI client 9.2, you can still connect to 8.1 databases.
If there is still demand for connecting to pre 8.1 databases, people
would have to stick with PHP4, which seems to me reasonable.

Any comments are welcome to better support the greatest RDBMS with
PHP ;-)

 -Andreas
-- 
Andreas Karajannis
mediaworx berlin AG

Fon (030) 2 75 80 - 266
Fax (030) 2 75 80 - 200

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Oracle vs. MySQL

2002-05-06 Thread Andreas Karajannis

Sogno Kahlenberg wrote:
> Anyone tried phpMyAdmin with Oracle with success? Any way to make it work
> with Oracle, instead of MySQL? Looks like pretty scanty resources there for
> Oracle ...
> 


Tora:
http://www.globecom.se/tora/

Oracletool:
http://www.oracletool.com/

phpOracleAdmin:
http://phporacleadmin.org/

HTH,
  Andreas
-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Re: Newbie: odbc_prepare & parameters

2001-10-19 Thread Andreas Karajannis

Michael J. Eisner wrote:


>>>i have a loop going through a result set of an odbc-query. each row of
>>>this loop has to be checked if there is an entry in another table. so as the
>>>last odbc-query is the same for each row except they key-field, i tried to
>>>use the odbc_prepare function and a parameter array. but it doesn't work.

If Access supports subqueries, you should consider this approach, e.g.


$sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty,
  fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved,
  fld_F_Flown
  FROM tblBookings WHERE fldFlight in (select ... from ... where ...)
  AND fldBookDate=#".$EngDatum."#";

with the subquery being essentially your $ergRouten statement.


HTH,
  Andreas

-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PHP vs. 2 database softwares

2001-10-02 Thread Andreas Karajannis

Scott Fletcher wrote:
 > Do you meant to say that it took me several days to figure out that PHP
 > doesn't support multiple databases?  PHP said it will work with almost any
 > databases but it failed to meant to say that only "with" one databases, but
 > not multiple databases at the same time.
 >

PHP will work with multiple databases, as long as you don't try to use any
of the uodbc based flavors together (Solid, Empress ,iODBC, unixODBC,
Easysoft OOB, OpenLink, Adabas D, Velocis, DBMaker, SAP DB and IBM DB2).

If you need to connect to multiple ODBC databases, use a driver manager such
as iODBC or unixODBC and the appropriate ODBC driver.

 > Never mind the problem.  I found that PHP won't use both the
 > "--with-ibm-db2" option and "--with-iobc" option, it only can use one of
 > them.

As oulined above, instead of using "--with-ibm-db2" and "--with-iodbc" just
use "--with-iodbc" and create a DSN for your DB2 server with iodbc.

-Andreas

-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Oracle 8i questions

2001-02-26 Thread Andreas Karajannis

Chris Murtland wrote:


 >   I am trying to update an Oracle 8i CLOB field. I have looked at
 >  previous  messages on the list and am trying the following: 
 > $sql="update murtland.articles set 
title='$title',release_date=TO_DATE('$release_date','-MM-DD'),body=:body
 >   text,sections='$sections',mod_date=TO_DATE('$mod_date','-mm-dd
 >   hh24:mi:ss'),mod_userid=$userid where articleid=$articleid";   
 > //echo $sql; $stmt=OCIParse($conn,$sql); $bodytext =
 > OCINewDescriptor($conn, OCI_D_LOB);  
 > OCIBindByName($stmt,":bodytext",&$bodytext,-1,OCI_B_CLOB);   
 > OCIExecute($stmt, OCI_DEFAULT);  $bodytext->save($body); 
OCICommit($stmt);
 >  $bodytext->free();  OCIFreeStatement($stmt);
 > OCILogoff($conn);
 >
Try the following SQL:
"update ... , body = empty_clob(), ... returning body into :bodytext"

 > Also, does anyone have any example code for searching Oracle 8i CLOB
 >  fields?  Do I  have to create a stored procedure to be able to do
 > this?I want to be able to search a separate varchar column in
 > addition to  searching the CLOB column.
  >
  Try interMedia Text for searching B|CLOB columns. While stored 
procedures could be used, they will be painfully slow.

  -Andreas

--
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Oracle configuration question

2001-02-02 Thread Andreas Karajannis

dsi safir wrote:

> Hi,
>   I'm just looking at the configuration parameters of my
> installation (Apache1.3.14 + PHP4.04pl1 + support for Oracle
> 8.0.5 with OCI, all on HP-UX 11).
> In the oci8 section, there's nothing indicated for the
> "Libraries Used" parameter => is it normal ?
> 
This should be alright. 

-Andreas
-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] access insert problem

2001-02-01 Thread Andreas Karajannis

Fredrik Stark wrote:

> Hi,
> Im using php4.0.3pl1 on a NT5 with an Access 2000 database.
> I use the database to store text and numbers. I just realised that
> the text-field can only store 255 characters so I changed the
> type from "text" to "memo". And now i get "Syntax Error" when
> i try to insert a value to the "memo" field...
> 
> Anyone got a solution?
> 
> /stark

You probably can't pass your value literally. Try using SQL Parameters:



See also the manual entries for odbc_prepare() / odbc_execute().

-Andreas

-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] MS-SQL Error Message Replacement

2001-01-24 Thread Andreas Karajannis

[EMAIL PROTECTED] wrote:


 >   How can I put in my own custom message when these errors occur?
 > Should I  be looking for a failed query message and then acting on
 > that?  I like the  protection that the foreign key relationship
 > enables, because you can't  delete "parent" objects without
 > removing the children first.
Prepend "@" to the php function call to supress error messages. If your 
statement fails, you could get the error number  via some other mssql 
call and decide what to do.

  -Andreas

-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB]OCI ORA-12154 error

2001-01-18 Thread Andreas Karajannis

> even so my php4 is running on the server where the database is installed,
> 
> I tried your putenv to all of the oracle variables.
putenv won't help. The Oracle client libraries are initialized during 
server startup, so they won't see the environment set via putenv in a 
PHP script. This applies to the module version of PHP.

> It did not change any.
> All these variables are usually set by the root profile where oracle and
> apache start:
> K10oracle
> K20apache
These are the kill (K) scripts.

Look for the Sxxapache script(s), they should be symlinks to either a 
script in /etc/rc.d/init.d (for RedHat and derivates) or directly to the 
apachectl script.
In the apachectl script, export the needed environment variables 
(ORACLE_HOME is enough if you have tnsnames.ora in 
ORACLE_HOME/network/admin) and add $ORACLE_HOME/lib to $LD_LIBRARY_PATH.

You can check if the variables really got set by writing a PHP script 
containing just "". In the section "Environment" check 
for the needed variables.

HTH,
  Andreas
-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] SQLExecDirect in CALL

2001-01-16 Thread Andreas Karajannis

zambak wrote:


> Then I found a piece of information on DB2 CLI on Stored Procedure Call
> 
> Syntax
> Between all it says : (quote)
> Unlike ODBC, DB2 CLI does not support literals as procedure arguments,
> parameter markers must be used.(end quote)
> I created a little app that users CLI and it would not work untill i used
> SQLBindParameter() function to connect procedure arguments to a CALL
> statement
> 
> Basically You do "CALL SP_INS_MALL (?,?,?,?)" and then use
> SQLBindParameter() to replace ? with args.
>
> Is there a way to call sp in PHP using current ODBC functions. Right now I
> don't need output parameters...only input
> 

Please see the docs for odbc_execute()
http://www.php.net/manual/en/function.odbc-execute.php
and odbc_prepare()
http://www.php.net/manual/en/function.odbc-prepare.php
on how to pass input parameters.


-Andreas
-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] SQLExecDirect in CALL

2001-01-16 Thread Andreas Karajannis

zambak wrote:

> Hi
> 
> This is probably a question for a core PHP developers working on ODBC
> 
> 
> 
> I have compiled my php 4.0.4 against IBM DB2 libs and all is well untill i
> 
> do something like
> 
> odbc_exec($cid,"CALL  ('arg1','arg2','arg3')";
> 
> 
> 
> Call fails saying it could not find certain library.mentioning
> 
> SQLExecDirect ODBC function
The above statement should work. Could you please give the exact error 
message?

> 
> 
> My questions are :
> 
> 1. Does or Does not PHP 4.0.4 ODBC functions support CALL SQL statements
> with input/output arguments.
> 
As of now, PHP supports only input parameters.

> 2. Can someone give me an example on how to accomplish a CALL statement with
> in/out args from PHP when calling a stored procedure
> 
See above.

> 3. Are ODBC functions in PHP compliant with ODBC v3.5 specs?
> 
No, they are still ODBC 2.x

-Andreas

-- 
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Problem with LONG TEXT fields (ODBC-MS SQL 7)

2001-01-12 Thread Andreas Karajannis


> I have one row, in which long text field takes about 5100 bytes. PHP
> can't print page with this text, but don't give me any error messages
> (other texts, < 4096, are printed correctly). Printing this row work
> correctly in ASP.
> I change config value uodbc.defaultrl from 4096 to 8192, but it don't
> give any effect.
>

Please make shure that PHP really "sees" your change.
You can verify the value that PHP uses by writing a file with just a call to
phpinfo(), this prints out a page with the current configuration.

-Andreas

--
Andreas Karajannis
mediaworx berlin  AG

Fon (0 30) 2 75 80 - 266
Fax (0 30) 2 75 80 - 200


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]