Today I had an import script to pull data from Oracle into a MySQL instance, but the script returned an “undefined index” error for one of the fields in the result set.  I thought that was odd, but sure enough, the field with a null value was not returning “NULL” but not returning at all.  A quick Google search shows that OCI has a constant called “OCI_RETURN_NULLS” which solved my problem.  To add more than one constant in your connection or oci* function, use the + sign (e.g. OCI_ASSOC+OCI_RETURN_NULLS).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.