This one took me a while to figure out, so I thought I would do an entry for it.

These instructions aren’t actually tied to the Zend_Db_Statement_Oracle class in the Zend Framework. I’ve just been using the Zend Framework in the application that this information is from.

Problem

I’ve been using the Oracle database for my application. During development, I found that I needed to return an Oracle cursor to my application from and Oracle function/procedure. By doing so, I could speed up my application and limit the amount of trips to the database. I was trying to accomplish this with the Zend PDO_OCI classes, but found out that cursors really aren’t supported in PDO_OCI. And, from what I read, PDO_OCI isn’t really supported that well either. The Oracle OCI8 drivers are supported more than PDO, but that doesn’t really pertain to this issue.

Solution

After a good amount of research and testing, I found that the following code will call and Oracle function that returns a SYS_REFCURSOR. I had to use the Oracle OCI8 functionality directly here; without going through Zend Framework. The only time I used the framework was to get my database connection information.