News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Christopher Jones' Blog:
Casting PL/SQL arrays as REF CURSORS for Ruby (and PHP)
December 01, 2006 @ 10:41:00

In a new post, Christopher Jones talks about some difficulty a friend of his was having with returning a connection type from Oracle back to a script. In his case, it was a Ruby script and, unfortunately, there's no direct support for it. So, Christopher jumped in to help out.

PHP's oci8 extension oci_bind_array_by_name() can bind collections but there is no equivalent in ruby-oci8.

Justin outlines a solution on his blog Ruby: Invoking a PL/SQL Package with Array args. His example relies on some company infrastructure so I came up with this standalone example. This first SQL*Plus script sets up the scenario.

Stick with me on this one - there's some PHP right there at the end. He shows how much simpler the same kind of operation would be in PHP thanks to the oci_bind_array_by_name functionality understanding the return value. What took about 20 lines for just the Ruby code to handle the result correctly takes only five in PHP.

0 comments voice your opinion now!
ruby casting plsql array refcursor oci8 extension ruby casting plsql array refcursor oci8 extension


blog comments powered by Disqus

Similar Posts

Community News: FirePHP Firefox PHP Extension

Konr Ness' Blog: Zend_Config Benchmark - JSON, Array, INI, XML, YAML

Maggie Nelson's Blog: How to (and how not to) pass an array from PHP to the database

Felix Geisendorfer's Blog: New fix for array junkies: Set::merge assembles yummy arrays

Derick Rethans: Understanding Valgrind errors (1)


Community Events





Don't see your event here?
Let us know!


opinion update api library language series tips introduction deployment community zendserver list symfony install laravel framework podcast interview release package

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework