URGENT, Helpme Please Delphi 6 Oracle10g package

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
Jorge_Medina

URGENT, Helpme Please Delphi 6 Oracle10g package

Post by Jorge_Medina » Fri 11 Aug 2006 16:09

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 14 Aug 2006 09:11

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.

Jorge Medina
Posts: 1
Joined: Fri 11 Aug 2006 15:57

List index bound (0), again

Post by Jorge Medina » Mon 14 Aug 2006 15:24

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 15 Aug 2006 12:36

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;

Post Reply