Return result from a Function with a db package
Posted: Fri 25 Jan 2008 14:20
Hi
I am getting an ORA-6502 (numeric or value error - character buffer string too small) whenever I get a non zero length result from a function call.
I am sure(?) that it is how my RESULT_PARAM is defined but have tried various options for some time.
In addition to helping me (as I am very new to Delphi ..) can you please explain how I can find these answers out myself. The documention that I read assumes zero Delphi knowledge or otherwise a Masters degree!
Anyway, the function is called using the following and it is the EXECPROC taht is complaining :
Function Tgedcom_iface2.put_gedcom2(
const AP_LOGIN_ID: string;
const len_login_id:integer;
const AP_FAMX: string;
const len_famx: integer
): string;
var
RESULT_PARAM,
AP_LOGIN_ID_PARAM,
AP_FAMX_PARAM
: TOraParam;
begin
BeginExecPLSQL;
try
AP_LOGIN_ID_PARAM := AddParam('P_LOGIN_ID', ftString, ptInput);
AP_LOGIN_ID_PARAM.Size := len_login_id;
AP_LOGIN_ID_PARAM.AsString := AP_LOGIN_ID;
AP_FAMX_PARAM := AddParam('P_FAMX', ftString, ptInput);
AP_FAMX_PARAM.Size := len_famx;
AP_FAMX_PARAM.AsString := AP_FAMX;
RESULT_PARAM := AddParam('RESULT', ftUnknown, ptOutput);
RESULT_PARAM.Size := 200; // check
ExecProc('PUT_GEDCOM2');
Result := frmGedcom.OraStoredProc1.ParamByName('RESULT').AsString;
finally
EndExecPLSQL;
end;
end;
I am getting an ORA-6502 (numeric or value error - character buffer string too small) whenever I get a non zero length result from a function call.
I am sure(?) that it is how my RESULT_PARAM is defined but have tried various options for some time.
In addition to helping me (as I am very new to Delphi ..) can you please explain how I can find these answers out myself. The documention that I read assumes zero Delphi knowledge or otherwise a Masters degree!
Anyway, the function is called using the following and it is the EXECPROC taht is complaining :
Function Tgedcom_iface2.put_gedcom2(
const AP_LOGIN_ID: string;
const len_login_id:integer;
const AP_FAMX: string;
const len_famx: integer
): string;
var
RESULT_PARAM,
AP_LOGIN_ID_PARAM,
AP_FAMX_PARAM
: TOraParam;
begin
BeginExecPLSQL;
try
AP_LOGIN_ID_PARAM := AddParam('P_LOGIN_ID', ftString, ptInput);
AP_LOGIN_ID_PARAM.Size := len_login_id;
AP_LOGIN_ID_PARAM.AsString := AP_LOGIN_ID;
AP_FAMX_PARAM := AddParam('P_FAMX', ftString, ptInput);
AP_FAMX_PARAM.Size := len_famx;
AP_FAMX_PARAM.AsString := AP_FAMX;
RESULT_PARAM := AddParam('RESULT', ftUnknown, ptOutput);
RESULT_PARAM.Size := 200; // check
ExecProc('PUT_GEDCOM2');
Result := frmGedcom.OraStoredProc1.ParamByName('RESULT').AsString;
finally
EndExecPLSQL;
end;
end;