I want to pass/bind an array of (key1, key2) to an Oracle PL/SQL stored procedure using PHP. I’m able to bind primitive types and arrays of primitive types, but haven’t found a way to pass complex datatypes back and forth.
Is this unsupported? So far I’ve been having to pass along multiple arrays — one for each subtype in my complex type — and then depend on their indexes to reconstitute them in the procedure.
Why don’t you serialize the object’s state as XML?
Currently it’s pretty common practice to searilize objects as XML so they can be passed across the web in a language/platform agnostic manner. Why not do the same and store it as a varchar in the DB.
Note: The glaring deficiency of this method is you won’t be able to select fields in the database by attributes of the object in a clean manner because it mixes multiple attributes of the object in one field of the database.
If you do need the attributes of the object to be searchable, you’ll need to break out the data from each of the object’s attributes into their own respective fields.