Welcome Guest, Not a member yet? Register   Sign In
Erro execute procedure - ocifetchinto() ORA-24374 (URGENT!!!)
#1

[eluser]Spectruman[/eluser]
$procedure = 'CALL san.pkgsan_inicializa_user.spsan_inicializa_user(?)';
$query = $this->db->query($proc,$idUser);

functional the call procedure but the CodeIgniter returns me the error and not a view with the message of success.

Quote:Severity: Warning

Message: ocifetchinto() [function.ocifetchinto]: ORA-24374: define not done before fetch or execute and fetch

Filename: oci8/oci8_result.php

Line Number: 155
#2

[eluser]WanWizard[/eluser]
This is not a CI error, but an error in your stored procedure.
#3

[eluser]Spectruman[/eluser]
[quote author="WanWizard" date="1278542477"]This is not a CI error, but an error in your stored procedure.[/quote]

But as if running the command in squirrel sql does not return error. It happens that I must call the procedure first and then update to a table specifies.
#4

[eluser]WanWizard[/eluser]
Without diving into the specifics of your stored procedure it's difficult to say what the issue is.

The full text of the error is: "The application did not define output variables for data being fetched before issuing a fetch call or invoking a fetch by specifying a non-zero row count in an execute call."

Does your procedure use variable placeholders by any change ( :variable )?
#5

[eluser]Spectruman[/eluser]
[quote author="WanWizard" date="1278546191"]Without diving into the specifics of your stored procedure it's difficult to say what the issue is.

The full text of the error is: "The application did not define output variables for data being fetched before issuing a fetch call or invoking a fetch by specifying a non-zero row count in an execute call."

Does your procedure use variable placeholders by any change ( :variable )?[/quote]

With respect to the method ocifetchinto in line 155 oci8_result.php here
Code:
return ocifetchinto($id, $row, OCI_ASSOC + OCI_RETURN_NULLS);
looking in http://php.net/manual/en/function.ocifetchinto.php site has an observation
Quote:This function is deprecated. Recommended alternatives: oci_fetch_array(), oci_fetch_object(), oci_fetch_assoc() and oci_fetch_row().
this can not be related to the my problem?.
#6

[eluser]WanWizard[/eluser]
Deprecated doesn't mean unusable.

You get this error usually when you call a stored procedure with requires a bind of a PHP variable to a variable placeholder, but none is defined. You need oci_bind_by_name() to bind the variable, which is PHP5+, which might be an indication to why this is not implemented. On the other hand, it is oracle specific, so if you require this, your portability is shot anyway...
#7

[eluser]Spectruman[/eluser]
[quote author="WanWizard" date="1278555761"]Deprecated doesn't mean unusable.

You get this error usually when you call a stored procedure with requires a bind of a PHP variable to a variable placeholder, but none is defined. You need oci_bind_by_name() to bind the variable, which is PHP5+, which might be an indication to why this is not implemented. On the other hand, it is oracle specific, so if you require this, your portability is shot anyway...[/quote]

if I run the code in the format as follows CodeIgniter
Code:
$qry = 'CALL san.pkgsan_inicializa_user.spsan_inicializa_user(?)';
$this->db->query($qry,$idUser);

Codeigniter return error
Quote:Severity: Warning
Message: ocifetchinto() [function.ocifetchinto]: ORA-24374: define not done before fetch or execute and fetch

Filename: oci8/oci8_result.php
Line Number: 155

Solution using manually

Code:
$qry="CALL san.pkgsan_inicializa_user.spsan_inicializa_user(:id_user)";
$stmt=oci_parse($this->db->conn_id, $qry);
oci_bind_by_name($stmt, ":id_user",$idUser) or die ('Error binding string');
oci_execute($stmt);

if I use this line of code:
Code:
ocifetchinto($stmt, $row, OCI_ASSOC + OCI_RETURN_NULLS);

Code:
$qry="CALL san.pkgsan_inicializa_user.spsan_inicializa_user(:id_user)";
$stmt=oci_parse($this->db->conn_id, $qry);
oci_bind_by_name($stmt, ":id_user",$idUser) or die ('Error binding string');
oci_execute($stmt);
ocifetchinto($stmt, $row, OCI_ASSOC + OCI_RETURN_NULLS);
I get the same error file oci8_result.php in line 155.

so I solved without the use of
Code:
ocifetchinto($stmt, $row, OCI_ASSOC + OCI_RETURN_NULLS);
Resolved:
Code:
$qry="CALL san.pkgsan_inicializa_user.spsan_inicializa_user(:id_user)";
$stmt=oci_parse($this->db->conn_id, $qry);
oci_bind_by_name($stmt, ":id_user",$idUser) or die ('Error binding string');
oci_execute($stmt);

with this solution could as be resolved without having to use this manual method?.
#8

[eluser]WanWizard[/eluser]
Have you seen this post? http://ellislab.com/forums/viewthread/103309
#9

[eluser]Spectruman[/eluser]
[quote author="WanWizard" date="1278619663"]Have you seen this post? http://ellislab.com/forums/viewthread/103309[/quote]

Yes I look at the post and did a test but not resolved the problem. The error persists using the solution post.
#10

[eluser]WanWizard[/eluser]
If you're using PHP5+, you could try using oci_fetch_array() instead of ocifetchinfo().




Theme © iAndrew 2016 - Forum software by © MyBB