1

Below is my procedure

NOBL_TEC_TEST_PROC(v1 number,v2 out number)

my model function

public function testProc()
{
    $result = '';
    $db = "orcl";
    $conn = oci_connect("***", "****", $db);
    $sql = 'begin NOBL_TEC_TEST_PROC(222, :seqno); end;';
    $stmt = oci_parse($conn,$sql);
    oci_bind_by_name($stmt, ':seqno', $result);
    oci_execute($stmt);

    return $result;

}

if I give the IN value <10 it is working fine, but when I try to give IN value >10 it is giving following error.

<b>Warning</b>:  oci_execute(): ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 1 in....

How can I fix this? Any help? Thanks

3
  • You need to change the procedure.... you're assigning one of your parameters to a local variable in that procedure (or in something that procedure calls etc). The local variable does not have the correct datatype to accept what you are passing... you're going to have to change it. Commented Jan 29, 2014 at 12:45
  • How should I change the procedure? am a php developer so I dont really know.. Commented Jan 29, 2014 at 13:00
  • If you post the procedure then someone will be able to help... changing it might have knock on effects though so it's best to ask the person responsible for it. Commented Jan 29, 2014 at 13:22

3 Answers 3

7

I Know its a little late, but you need to add your buffer size to your oci_bind_by_name

oci_bind_by_name($stmt, ':seqno', $result,2000);

This should solve your issue

Sign up to request clarification or add additional context in comments.

Comments

0

possibly in the db the procedure parameter IN has parameter VARCHAR2(1) or something like that.

A number above 10 is two characters so an error is raised.

You should simply access the source of the Oracle Procedure, change the type of the parameter in the header and body of the procedure and recompile it.

Comments

0

Just for reference: this error was raised also when a parameter was declared as "IN OUT". Since we use refcursor to retrieve the result such declaration was in fact not needed and was changed to "IN" only. This resolved our issue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.