note 102313 added to function.oci-parse

From: Date: Tue, 08 Feb 2011 13:38:20 +0000
Subject: note 102313 added to function.oci-parse
Groups: php.notes 
Request: Send a blank email to php-notes+get-176773@lists.php.net to get a copy of this message
When you want to call stored function (and want to read its result) which executes DML queries (insert, update, delete) inside its body you can't use "select your_stored_function(:param1, :param2) from dual" because you will receive "ORA-14551: cannot perform a DML operation inside a query" error. In order to call such function and get its result you need to wrap it into nested procedure with OUT parameter like this: DECLARE PROCEDURE caller(return_value OUT NUMBER) AS BEGIN return_value := your_stored_function(:param1, :param2); END; BEGIN caller(:return_value); END; and bind to :return_value variable to get the result of function. ---- Server IP: 82.177.164.100 Probable Submitter: 150.254.4.170 ---- Manual Page -- http://www.php.net/manual/en/function.oci-parse.php Edit -- https://master.php.net/note/edit/102313 Del: integrated -- https://master.php.net/note/delete/102313/integrated Del: useless -- https://master.php.net/note/delete/102313/useless Del: bad code -- https://master.php.net/note/delete/102313/bad+code Del: spam -- https://master.php.net/note/delete/102313/spam Del: non-english -- https://master.php.net/note/delete/102313/non-english Del: in docs -- https://master.php.net/note/delete/102313/in+docs Del: other reasons-- https://master.php.net/note/delete/102313 Reject -- https://master.php.net/note/reject/102313 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#176773) next »