Page 1 of 1

URGENT, Helpme Please Delphi 6 Oracle10g package

Posted: Fri 11 Aug 2006 16:09
by Jorge_Medina
Hi every one.
Sorry, but i don't speak english.

I have a package that work fine in pl/sql, but when i execute in delphi, i get a error message "List index out of bounds(2)"

from delphi:
SQLStoredProc.Close;
SQLStoredProc.Params.Clear;
SQLStoredProc.StoredProcName := 'TRAER_ARTICULOS';
SQLStoredProc.Params.CreateParam(ftString , 'nombre', ptInput);
SQLStoredProc.Params.ParamByName('nombre').AsString := 'AIS';
SQLStoredProc.Params.CreateParam(ftCursor, 'RESULT', ptResult);
SQLStoredProc.Prepared := true;
ClientDataSet.open;



FUNCTION TRAER_ARTICULOS
(
nombre articulo.nombre%type
)
RETURN PKG_REFCURS.refcurs
AS
res PKG_REFCURS.refcurs;
cadena varchar2(61);
begin
cadena := rtrim(ltrim(nombre))||'%';
open res for
select a.codigo, a.nombre, a.uni
from articulo a
where a.nombre like cadena;
return res;
end;


thanks in advanced.

Jorge Medina

Posted: Mon 14 Aug 2006 09:11
by Plash
When you assign value to StoredProcName property of TSQLStoredProc component parameters will be generated automatically. So call Params.Clear after assigning value to StoredProcName property or do not create parameters manually.

List index bound (0), again

Posted: Mon 14 Aug 2006 15:24
by Jorge Medina
plash wrote:When you assign value to StoredProcName property of TSQLStoredProc component parameters will be generated automatically. So call Params.Clear after assigning value to StoredProcName property or do not create parameters manually.
Ok, But I swap the line:

s.StoredProcName := 'FUN_MDET_ART1';
s.Params.Clear;
.......

and i get then same error message.

the rare is when i use this driver "Oracle (Core Lab)" the system work fine, but if i use the other driver "Oracle Net (Core Lab)", the system send message like this...
"List index bound (0)"

Can you send me please information about that compatibility into oracle and delphi paremeters, because i need to known how it's work.

Posted: Tue 15 Aug 2006 12:36
by Plash
We have fixed this problem. The fix will be included in next build of the driver.

You can use TSQLQuery component to execute stored procedures for the present. Assign PL/SQL block calling the procedure or function to SQL property.
For example:

BEGIN
:Result := TRAER_ARTICULOS(:nombre);
END;