stored procedures + php 4

admin

Administrator
Staff member
Colleagues of stack,
Already have alfum time are having problems with the execution of stored procedures of Oracle 8i R3 with php.
Following instructions of the stack colleague that answered the message " Problems with stored procedures + php ", I modified the code of my function that calls stored procedure oracle for the following form:

<?php
putenv("ORACLE_SID=GEDUFU");
putenv("ORACLE_HOME=/oracle/app/oracle/product/8.1.7");
$HANDLE = OCILogon("aei","aeiou","xxxxxx.xxx.xx");
$ncod = sprintf("%38s", " ");
$sth = OCIParse($HANDLE, "BEGIN SP_GET_NCOD_USUARIOS(:ncod); END;");
OCIBindByName ($sth, ":ncod", &$ncod, 38);
OCIExecute($sth);
echo $ncod;
?>

When I executed it in browser any I received the following message from error:

Warning: OCIStmtExecute: ORA-06550: line 1, column 28: PLS-00553:
character set name is not recognized ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated in /home/httpd/ged/cast.php on line 8

Below the code of mine meets stored procedure that I am calling in the code above.

CREATE OR REPLACE PROCEDURE "DIADO"."SP_GET_NCOD_USUARIOS"(ncod out number)
as
begin
declare
cont number;
aux number;
cursor usuario is SELECT ID_USUARIO FROM USUARIOS ORDER BY
ID_USUARIO ASC;
begin
cont := 0;
open usuario;
loop
cont := cont + 1;
fetch usuario into aux;
if (usuario %notfound) or (aux > cont) then
exit;
end if;
end loop;
ncod := cont;
close usuario;
end;
end;

Most strange he is that stored procedure when executed in delphi, C++ or in any another thing, returns the result due and waited, that is the first one numerical discontinuity in a column that is primary key in my table.
One more time I thank the aid of all.
Yours truly,
Sebasti鉶 Carlos Santos
Federal University of Uberl鈔dia
Minas Gerais - Brazil
 
Back
Top