Hello, I am creating PL/SQL to Insert a Php Array to a table.. this is the sample of PHP Array: $array = array ( col1 => 'data one', col2 => 'data two', col3 => 'data three'); PHP: this is the PL/pgSQL: create procedure insertData(data TypeTable) return booleas as Begin insert into table values(data); end; Code (markup): Table col1 character varying(50), col2 character varying(100), col3 character varying(200) Code (markup): TypeTable is a record data type that has the same field as "table". TypeTable = table = $array = (col1,col2,col3) I know that I can't parse Php Array to PL/SQL directly.. So does anyone knows how to parse PHP Array to PL/SQL and insert the data to "table"?
you can use OCI8 function i.e. oci_bind_by_name.Format is as follows : bool oci_bind_by_name ( resource $statement , string $bv_name , mixed &$variable [, int $maxlength = -1 [, int $type = SQLT_CHR ]] )
If it's an array to SQL and it has to be dynamic , why not something as 'this as key' as opposed to the exact array? A Simple PHP code underneath the vars that parses them the right way into SQL ?