-
rocksvern
Newbie
-
Posts: 1
Threads: 0
Joined: Nov 2021
Reputation:
0
11-29-2021, 07:51 AM
(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
-
andoyoandoyo
Andoyo (Java Web Media)
-
Posts: 32
Threads: 4
Joined: Jan 2015
Reputation:
0
11-30-2021, 12:48 AM
(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.
-
kenjis
Administrator
-
Posts: 3,679
Threads: 97
Joined: Oct 2014
Reputation:
228
-
gurthang75
Newbie
-
Posts: 8
Threads: 3
Joined: Jun 2021
Reputation:
1
(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?
-
andoyoandoyo
Andoyo (Java Web Media)
-
Posts: 32
Threads: 4
Joined: Jan 2015
Reputation:
0
(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.
-
kenjis
Administrator
-
Posts: 3,679
Threads: 97
Joined: Oct 2014
Reputation:
228
-
kenjis
Administrator
-
Posts: 3,679
Threads: 97
Joined: Oct 2014
Reputation:
228
-
b126
Junior Member
-
Posts: 43
Threads: 14
Joined: Feb 2019
Reputation:
0
-
andoyoandoyo
Andoyo (Java Web Media)
-
Posts: 32
Threads: 4
Joined: Jan 2015
Reputation:
0
(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
-
kenjis
Administrator
-
Posts: 3,679
Threads: 97
Joined: Oct 2014
Reputation:
228
|