Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8901953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:29:26+00:00 2026-06-15T01:29:26+00:00

I have written a PL/SQL (Ora10gR2) package which contains a stored procedure. The header

  • 0

I have written a PL/SQL (Ora10gR2) package which contains a stored procedure. The header looks like this:

procedure updateAddress(
  sid       in     varchar2,
  addID     in out number,
  roomNo    in     varchar2,
  poBox     in     varchar2,
  add1      in     varchar2,
  add2      in     varchar2,
  add3      in     varchar2,
  add4      in     varchar2,
  add5      in     varchar2,
  postCode  in     varchar2,
  country   in     varchar2,
  phone1    in     varchar2,
  phone2    in     varchar2,
  success   out    number
);

The purpose of this procedure is to update/append addresses in the database. If addID is null, it inserts and sets addID to the newly inserted address ID; if addID is not null, it just updates (I haven’t written this bit, yet)… Anyway, simple enough.

Calling this procedure works absolutely fine from within SQL Developer. For example, the following works perfectly:

set serveroutput on;

declare
  addID number;
  status number;
begin
  addID := null;

  mypackage.updateaddress('XXX11341976', addID, null, null, 'somewhere', 'else', 'NCx 1234', 'UA', null, null, null, null, null, status);

  dbms_output.put_line('Status ' || status || ' - New ID ' || addID);
end;
/

It outputs something like Status 20 - New ID 3, where 20 is my all OK code and if I query the address table, the new address is sitting there as ID 3.

However, when I call this code from a PHP script, which uses OCI8, I get an ORA-06502 error:

ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 1

I know this error usually indicates that you’re trying to fit too much data into some type; for example, putting 999 into number(2), etc. However, this isn’t the case with my SP: there are no limits imposed on the types and, like I say, it works fine in SQL Developer. Likewise, I’m not using dbms_output anywhere in the SP.

This also occurs when I hardcode the PHP script to exactly the same parameters as the above PL/SQL block, or even if I completely remove the body of the procedure and replace it with success := 20. The latter leads me to believe that there’s some problem with the OCI call through PHP, rather than my PL/SQL package. However, I haven’t got a clue what it might be! I’m using this code elsewhere with, admittedly, simpler procedures, and it works fine.

Any ideas what the source might be, or what I can look for? It’s driving me slightly mad!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:29:27+00:00Added an answer on June 15, 2026 at 1:29 am

    OK: I found the problem!…

    Turns out that my Oracle library code had neglected to set the maxlength property when it bound variables. I set this to 32767 and, lo and behold, it works!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a SQL Server stored procedure that includes a DateTime parameter. This
I have written a stored procedure in SQL Server. Now its just that I
I have written this procedure in SQL and is working ALTER proc [dbo].[gridcombo] (@tabela
I have a sql written in a MyBatis mapper file which is something like
I have written a stored procedure in sql server 2005 that searches for results.
I have written an assembly which is integrated in sql server, providing some stored
I have written the following piece of code ( sql clr stored procedure )
I'm new to development. In sql I have written a stored procedure and it
I have written a stored procedure in SQL Server 2000. I want a serial
I have a number of manually written scripts (.sql) for tables, views and stored

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.