We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question
2

firebird_sdbc error: *Cursor is not open caused by 'isc_dsql_fetch' [closed]

asked 2020-04-10 04:20:40 +0200

libre officer gravatar image

updated 2020-04-14 23:31:19 +0200

hello,

I tried to call this stored procedure in LibreOffice Base:

CREATE OR ALTER PROCEDURE myproc
RETURNS (val CHAR(100))
AS BEGIN
    FOR SELECT "customer" FROM "test" INTO :val
    DO
    BEGIN
        SUSPEND;
    END
END

but I have the following error when I try to execute it:

firebird_sdbc error: *Cursor is not open caused by 'isc_dsql_fetch'

I tested with this one:

CREATE OR ALTER PROCEDURE DUMMY
 RETURNS (TXT VARCHAR(10))
 AS
 BEGIN
   TXT='DOG';
   SUSPEND;
   TXT='CAT';
   SUSPEND;
   TXT='MOUSE';
   SUSPEND;
 END

I got the same error!

This is my LibreOffice Base file: C:\fakepath\dbfirebird.odb

Any idea on how to solve this problem?

Configurations:

LibreOffice Version: 6.4.1.2 (x86)

Build ID: 4d224e95b98b138af42a64d84056446d09082932

CPU threads: 4; OS: Windows 10.0 Build 17763; UI render: default; VCL: win; Locale: fr-CH (fr_FR);

UI-Language: en-GB

Calc: CL

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by libre officer
close date 2020-05-05 16:35:04.968875

Comments

Hello,

Have only looked at this briefly. You cannot execute from Query window. Go to Tools->SQL. Will attempt to look further at your example later. Have done little with Firebird Procedures in past. It would also help to know what you are attempting to accomplish.

Ratslinger gravatar imageRatslinger ( 2020-04-10 04:50:27 +0200 )edit

I want to list my data when I call my stored procedures (i.e. from a form). I tried with Tools->SQL : I got nothing from the output when I use EXECUTE PROCEDURE myproc

libre officer gravatar imagelibre officer ( 2020-04-10 13:09:47 +0200 )edit
1

@libre officer,

Thanks for the info & post (+1). Did find one Firebird Procedure I had worked on (question dealt with MySQL) and it also ran from a macro. If interested it is in my comments in this post -> Using SQL cursor and loop in LO base macro.. In that example, when the procedure is executed, records are created in the table for students grades to be applied.

Also curious as to the purpose of your procedure as this seems nothing more than a query to get data from another query.

Ratslinger gravatar imageRatslinger ( 2020-04-10 19:40:56 +0200 )edit

Yes, I want to make a teacher daily lessons from a database, and I try to discover the possible use of stored procedures, because I need to put in a weekly timetable the lessons of that week.

And thank you for your last year post which I will keep to learn from. The problem is that I have been using VBA and have difficulties using LibreOffice Basic (documentation does not contains very much examples), especially to convert between different calendars (solar, lunar, etc.)

libre officer gravatar imagelibre officer ( 2020-04-11 16:56:37 +0200 )edit
1

@libre officer,

You should actually remove your solution from the question and post as an answer. Then accept your own answer as the correct answer.

Also note it is not necessary to mark questions as [Solved] especially if there is an accepted answer.

Ratslinger gravatar imageRatslinger ( 2020-04-13 04:40:49 +0200 )edit

I just did it, thank you.

libre officer gravatar imagelibre officer ( 2020-04-14 23:38:32 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-04-14 23:30:41 +0200

libre officer gravatar image

After many complicated search I found this solution:

image description

I have to execute my stored procedure through SELECT to make it selectable, and be sure to activate Run SQL command directly before running the query (see picture).

I didn't find this in the official documentation of FireBird 2.5 and I don't know what is the purpose of EXECUTE PROCEDURE !

Thank you for your assistance :)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-04-10 04:20:40 +0200

Seen: 146 times

Last updated: Apr 14 '20