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

(This post was last modified: 11-29-2021, 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: 11-30-2021, 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.

(11-30-2021, 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
#14

(11-29-2021, 07:51 AM)rocksvern Wrote:
(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

WORKS PERFECLY!!
however... it works with my changes... do u know if the team has come to a hotfix?
Reply
#15

(11-30-2021, 01:01 AM)kenjis Wrote: 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.

Thanks so much, my brother.
I am going to test it for some oracle work and then give you a report if has any problems.

Previously I used Codeigniter 3 for some applications with the Oracle database. Hopefully, Codeigniter 4 is ready to be released with oracle Driver soon.
Reply
#16

@gurthang75

Updated.
https://github.com/codeigniter4/CodeIgniter4/pull/2487

Your issues seems to be fixed. Check it if you can.
Reply
#17

The Oracle driver has been merged into develop branch!
And it will be included in v4.2.0.
https://codeigniter4.github.io/CodeIgnit...hancements
Reply
#18
Thumbs Up 

(01-25-2022, 04:54 PM)kenjis Wrote: The Oracle driver has been merged into develop branch!
And it will be included in v4.2.0.
https://codeigniter4.github.io/CodeIgnit...hancements

GREAT NEWS, thanks a lot!
Reply
#19

(01-25-2022, 04:54 PM)kenjis Wrote: The Oracle driver has been merged into develop branch!
And it will be included in v4.2.0.
https://codeigniter4.github.io/CodeIgnit...hancements

Hi Codeigniter team. When Codeigniter v4.2.0 with Oracle Database Driver going to be released?
Thank you
Reply
#20

Codeigniter v4.2.0 was released on June 3, 2022.
https://codeigniter4.github.io/CodeIgnit...4.2.0.html
Reply




Theme © iAndrew 2016 - Forum software by © MyBB