JoaoVM Posted February 4, 2014 at 04:25 PM Report #543924 Posted February 4, 2014 at 04:25 PM Boas malta, tenho aqui um problema na chamada de uma função em PHP e PL/SQL, esta função no SQL Developer funciona mas no php não estou a conseguir devido a um erro que não sei como resolver. O erro que me dá é o seguinte: ORA-06502: PL/SQL: numeric or value error: character string buffer too small Estou a dar um valor logo as variáveis apenas para testar...mas esse valor depois vai ser inserido através de um formulário. <?php $viat=22; $patr=42; $function = OCI_PARSE($conn,"BEGIN :resultados := CONTA_EXISTENTES(:viatura, :patrulha); END;"); // Bind input and output values to the statement. OCI_BIND_BY_NAME($function,":resultados",$resultado); OCI_BIND_BY_NAME($function,":viatura",$viat); OCI_BIND_BY_NAME($function,":patrulha",$patr); // Execute the statement. if (OCI_EXECUTE($function)) { // Print lead in string. echo "Número de Pedidos Existentes: ".$resultado.""; } ?> Se alguém me conseguia ajudar 😉
JoaoVM Posted February 4, 2014 at 05:00 PM Author Report #543937 Posted February 4, 2014 at 05:00 PM Malta já consegui, faltava definir o tamanho da variável de saída. <?php $viat=22; $patr=42; $function = OCI_PARSE($conn,"BEGIN :resultados := CONTA_EXISTENTES(:viatura, :patrulha); END;"); // Bind input and output values to the statement. OCI_BIND_BY_NAME($function,":resultados",$resultado, 100); OCI_BIND_BY_NAME($function,":viatura",$viat); OCI_BIND_BY_NAME($function,":patrulha",$patr); // Execute the statement. if (OCI_EXECUTE($function)) { // Print lead in string. echo "Número de Pedidos Existentes: ".$resultado.""; } ?> 1 Report
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now