Skip to content
Advertisement

Cannot create new procedure in SQL manager lite

I am working with SQL manager lite for Interbase/Firebird application. I have downloaded firebird database, successfully connected to that database and its host, but now I want to create procedure.

I couldn’t done it via tutorials, so I decided to just click New->Procedure and do that automatically. But doing this way I still have errors.

My code what I have tried without clicking New->Procedure:

The code which was generated using New->Procedure wizard:

But when I am clicking that lightning icon (compile) it complains about error:

Dynamic SQL Error.

SQL error code = -104.

Token unknown – line 9, column 3.

SUSPEND.

How to fix that?

Screenshot of error in SQL Manager lite

Advertisement

Answer

The problem is that your syntax is wrong. You need to define the output parameters, and you need to use either select ... into <list of variables> to select a single row, or for select ... into <list of variables> do to loop over multiple rows.

Your stored procedure should be something like:

If your select only produces a single row, then you could also consider using

Notice the ; after the into clause. In this case you could also leave out the SUSPEND;. That will make the stored procedure executable instead of selectable. Depending on how you want to use it, that could be a better choice.

See the Firebird documentation on created stored procedures and its procedural SQL language for more information.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement