Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003

    Unanswered: Using ODBC API in php to connect to DB2


    I am using ODBC api in PHP to connect to DB2 database. It is working fine but slow and lots and lots of locking. I came to know that all the transactions in DB2 are read/write and i want to change this setting.

    I read about setOption() in ODBC api -

    Then i have poked IBM site to see detail description about ODBC support.

    The above link shows that this function is deprecated and the other function which has replaced this is

    But there is no mention of this new function in php odbc api. Further odbc api is calling these functions by some numbers, so what is the number for this new function?

    My intention for tweaking some odbc connection parameters is to make all my select transactions read only so that i will have less locks on my objects and eventually quicker response time.

    If anyone has done this, please throw some light on this issue.


  2. #2
    Join Date
    Aug 2006

  3. #3
    Join Date
    Oct 2003

    Thanks for writing these articles which will really help many people in understanding how to connect to db2 from php.

    If you read my post, i was able to connect/extract data from DB2 using PHP but the real problem was the way DB2 locks its objects. I have tried using
    " for ready only" or " with read only" or " with UR"
    in my sql queries but there was no good result.

    When i use some other database i.e. firebird, it provides me the provision of metioning what kind of transaction I am doing using ODBC connection but with DB2 i can't do that. If there is a way please inform me.

    If you are interested you can read my post about the same here,

    Anyway, thanks for writing such a nice of article.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts