Subject Error Creating cursor handle
Author gifernandezmx
Hi to all,

My name is Gerardo. Can anybody help me?

The scenario is the following:

1. I have an Interbase StoreProcedure named GLOBALREPORTAMOUNTS.
This store procedure has only output parameters.

2. I'm using no Native IBObjects components. Thus I have put a
TIBODatabase and TIBOStoredProc components in a form.

3. I set the TIBODatabase properties to use the database with the
GLOBALREPORTAMOUNTS storedprocedure.

4. I set the IB_connection property in the TIBOStoredProc component.

5. When i want to select the StoreProcedure name from the
storedprocname property, I never obtain a list.

6. I do the same using the Native IBObjects components and this
works fine, also it woeks if I use IBExpress componets.

7. Thus I treid to do this at runtime but an exception is
raised: "Error Creating cursor handle".

What am I doing wrong?

The store procedure is defined as:

///****************************************************///

CREATE PROCEDURE GLOBALREPORTAMOUNTS
RETURNS (
ACUMSALES NUMERIC(10,2),
ACUMSALESTAXG1 NUMERIC(10,2),
ACUMSALESTAXG2 NUMERIC(10,2),
ACUMSALESTAXG3 NUMERIC(10,2),
ACUMSALESTAXG4 NUMERIC(10,2),
ACUMRETURNS NUMERIC(10,2),
ACUMRETURNSTAXG1 NUMERIC(10,2),
ACUMRETURNSTAXG2 NUMERIC(10,2),
ACUMRETURNSTAXG3 NUMERIC(10,2),
ACUMRETURNSTAXG4 NUMERIC(10,2))
AS
DECLARE VARIABLE SUMTOTALSALES NUMERIC(10,2);
DECLARE VARIABLE SUMSALESTAXG1 NUMERIC(10,2);
DECLARE VARIABLE SUMSALESTAXG2 NUMERIC(10,2);
DECLARE VARIABLE SUMSALESTAXG3 NUMERIC(10,2);
DECLARE VARIABLE SUMSALESTAXG4 NUMERIC(10,2);
DECLARE VARIABLE SUMTOTALRETURNS NUMERIC(10,2);
DECLARE VARIABLE SUMRETURNSTAXG1 NUMERIC(10,2);
DECLARE VARIABLE SUMRETURNSTAXG2 NUMERIC(10,2);
DECLARE VARIABLE SUMRETURNSTAXG3 NUMERIC(10,2);
DECLARE VARIABLE SUMRETURNSTAXG4 NUMERIC(10,2);
DECLARE VARIABLE TAXGROUPNUMBER SMALLINT;
DECLARE VARIABLE TAXID VARCHAR(32);
DECLARE VARIABLE TAXAMOUNT NUMERIC(10,2);
DECLARE VARIABLE SALESDOCTOTAL NUMERIC(10,2);
DECLARE VARIABLE FISCALDOCTYPE SMALLINT;
DECLARE VARIABLE SALESDOCID VARCHAR(32);
begin
SUMTOTALSALES=0;
SUMSALESTAXG1=0;
SUMSALESTAXG2=0;
SUMSALESTAXG3=0;
SUMSALESTAXG4=0;
SUMTOTALRETURNS=0;
SUMRETURNSTAXG1=0;
SUMRETURNSTAXG2=0;
SUMRETURNSTAXG3=0;
SUMRETURNSTAXG4=0;
FOR SELECT SALESDOC.SALESDOCID, SALESDOC.SALESDOCTOTAL,
SALESDOC.FISCALDOCTYPE
FROM SALESDOC
INTO :SALESDOCID, :SALESDOCTOTAL, :FISCALDOCTYPE
DO BEGIN
if (:FISCALDOCTYPE=0) then /* Ticket de venta*/
SUMTOTALSALES= SUMTOTALSALES + :SALESDOCTOTAL;
if (:FISCALDOCTYPE=1) then /* Ticket de devoluciĆ³n*/
SUMTOTALRETURNS= SUMTOTALRETURNS + :SALESDOCTOTAL;
END

FOR SELECT TAXGROUP.TAXGROUPNUMBER, SALESDOCTAX.TAXID,
SALESDOCTAX.TAXAMOUNT,

SALESDOC.SALESDOCTOTAL, SALESDOC.FISCALDOCTYPE
FROM SALESDOCTAX
INNER JOIN SALESDOC ON
(SALESDOCTAX.SALESDOCID=SALESDOC.SALESDOCID)
INNER JOIN TAXGROUP ON
(SALESDOCTAX.TAXGROUPID=TAXGROUP.TAXGROUPID)
/*WHERE SALESDOC.SALEDOCCREATIONDATE= date*/
/*INTO :TOTAL,:tax1,:tax2,:tax3,:tax4, :ticket_type*/

INTO :TAXGROUPNUMBER, :TAXID, :TAXAMOUNT, :SALESDOCTOTAL, :FISCALDOCT
YPE
DO
BEGIN
if (:FISCALDOCTYPE=0) then /* Ticket de venta*/
begin
IF (:TAXGROUPNUMBER=1) THEN
SUMSALESTAXG1= SUMSALESTAXG1 + :TAXAMOUNT;
IF (:TAXGROUPNUMBER=2) THEN
SUMSALESTAXG2= SUMSALESTAXG2 + :TAXAMOUNT;
IF (:TAXGROUPNUMBER=3) THEN
SUMSALESTAXG3= SUMSALESTAXG3 + :TAXAMOUNT;
IF (:TAXGROUPNUMBER=4) THEN
SUMSALESTAXG4= SUMSALESTAXG4 + :TAXAMOUNT;
end
if (:FISCALDOCTYPE=1) then
begin
IF (:TAXGROUPNUMBER=1) THEN
SUMRETURNSTAXG1= SUMRETURNSTAXG1 + :TAXAMOUNT;
IF (:TAXGROUPNUMBER=2) THEN
SUMRETURNSTAXG2= SUMRETURNSTAXG2 + :TAXAMOUNT;
IF (:TAXGROUPNUMBER=3) THEN
SUMRETURNSTAXG3= SUMRETURNSTAXG3 + :TAXAMOUNT;
IF (:TAXGROUPNUMBER=4) THEN
SUMRETURNSTAXG4= SUMRETURNSTAXG4 + :TAXAMOUNT;
end

END
ACUMSALES= SUMTOTALSALES;
ACUMSALESTAXG1=SUMSALESTAXG1;
ACUMSALESTAXG2=SUMSALESTAXG2;
ACUMSALESTAXG3=SUMSALESTAXG3;
ACUMSALESTAXG4=SUMSALESTAXG4;

ACUMRETURNS= SUMTOTALRETURNS;
ACUMRETURNSTAXG1=SUMRETURNSTAXG1;
ACUMRETURNSTAXG2=SUMRETURNSTAXG2;
ACUMRETURNSTAXG3=SUMRETURNSTAXG3;
ACUMRETURNSTAXG4=SUMRETURNSTAXG4;
end
////*****************************************************//////

I am using the following components:

Delphi 7 Enterprise Build 4.453
Interbase 6.02 (Open Source)
IBObjects 4.2.Fn
Window XP Build 2600
265MB RAM

Thanks in advanced

Gerardo Fernandez