Welcome Guest, Not a member yet? Register   Sign In
Oracle OCI8 support for CI 4
#11

(This post was last modified: Yesterday, 07:54 AM by rocksvern.)

(11-23-2021, 09:07 AM)gurthang75 Wrote: HI again!
im having troubles with package/procedures executions when i got OUT variables in my package i dont know how to retrieve the returning OUT variable value.
Can someone gide me a bit? im foing this:
Code:
function addSection($parent_section, $sec_code, $sec_long){
        $params[0] = array('name' => ':P_PARENT_SEC', 'value' => $parent_section);
        $params[1] = array('name' => ':P_CODE', 'value' => $sec_code);
        $params[2] = array('name' => ':P_LONG', 'value' => $sec_long);
        $params[3] = array('name' => ':P_OPER', 'value' => 'add');
        $params[4] = array('name' => ':P_RESULT', 'value' => null, 'length' => 4000);
        $params[5] = array('name' => ':P_ERROR', 'value' => null, 'length' => 4000);
        $params[6] = array('name' => ':P_ERROR_ORA', 'value' => null, 'length' => 4000);

        $query = $this->db->storedProcedure('PAC_WIKI', 'WIKI_SECTION', $params);
        print_r($query);

        die();
        if ($this->db->transStatus() === false) {
            return $query;
        } else {
            return $query;
        }
    }

and that "print_r()" give me this array:
Code:
CodeIgniter\Database\OCI8\Result Object ( [connID] => Resource id #12 [resultID] => Resource id #13 [resultArray] => Array ( ) [resultObject] => Array ( ) [customResultObject] => Array ( ) [currentRow] => 0 [numRows:protected] => [rowData] => )


thks in advance!


Try put a variable by reference like this
Code:
'value' => &$resultVariable
Reply
#12

(This post was last modified: Today, 12:50 AM by andoyoandoyo.)

I just tested Oracle Driver, and work well after I edited this code SYSTEMPATH\Debug\Toolbar\Collectors\Database.php at line 144.

I got an error like the below:

PHP Code:
ErrorException
Use of undefined constant VENDORPATH assumed 'VENDORPATH' (this will throw an Error in a future version of PHP)
SYSTEMPATH\Debug\Toolbar\Collectors\Database.php at line 144 

Then I delete (comment) this code (the file is this SYSTEMPATH\Debug\Toolbar\Collectors\Database.php at line 144):

PHP Code:
$traceLine['file'] = str_ireplace(VENDORPATH'VENDORPATH/'$traceLine['file']); 

And then Oracle Driver works well.

(Today, 12:48 AM)andoyoandoyo Wrote: I just tested Oracle Driver, and work well after I edited this code SYSTEMPATH\Debug\Toolbar\Collectors\Database.php at line 144.

I got an error like the below:

PHP Code:
ErrorException
Use of undefined constant VENDORPATH assumed 'VENDORPATH' (this will throw an Error in a future version of PHP)
SYSTEMPATH\Debug\Toolbar\Collectors\Database.php at line 144 

Then I deleted (commented) this code (the file is this SYSTEMPATH\Debug\Toolbar\Collectors\Database.php at line 144):

PHP Code:
$traceLine['file'] = str_ireplace(VENDORPATH'VENDORPATH/'$traceLine['file']); 

And then Oracle Driver works well.
Reply
#13

andoyoandoyo, Thank you!

"Use of undefined constant VENDORPATH" is a known issue which already fixed in the latest deveop branch.
https://github.com/codeigniter4/CodeIgniter4/pull/5403
Your action is no problem.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB