How To Execute Script On Firebird

Hello guys, I wrote some scripts, using IBExpert, but my problem is, I don't know with which statement I can call them outside IBExpert. For example in a C# program. I looked over the google, but when i write "execute script", it shows me how to write the script. So for example the script has three input parameters and four output. I tried like executing astored procedure:
execute procedure procName(input1, input2);
But it gives me an error.
IncognitoManAsked:
Who is Participating?
 
markusventerConnect With a Mentor Commented:
Look in C:\Program Files\HK-Software\IBExpert\IBEScriptDll folder.  Sample files are there.  It is in Delphi, but it should point you in the right direction.
0
 
Nick UpsonPrincipal Operations EngineerCommented:
I'm rather confused what you are asking for:

- call a stored proc from c#
- run a script of sql or ddl instructions in general or with ibexpert
- how to pass parameters into a script
0
 
IncognitoManAuthor Commented:
- run a script of sql or ddl instructions in general or with ibexpert
- how to pass parameters into a script

For example, I have a script, that takes some value from another DB and the first input parameter is the path to the database and the other is what value should be extract. After that the value should be put in the database the script is contained in and if all those operations are OK it returns true. But my problem is how to call the script in a C# application.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
JamesSenior Cloud Infrastructure EngineerCommented:
Check out this link and see does it help you.

http://firebirdsql.org/pdfmanual/Firebird-fb-shell-scripts.pdf
0
 
markusventerCommented:
You should be able to use a sql query (I am not sure what the databinding component is called in c#) and specify the SQL script to execute, i.e. exec YOUR_PROCEDURE(Param1, Param2).  Instead of opening the query you should be able to call execsql or a similar method on the query.
0
 
IncognitoManAuthor Commented:
I need the whole syntacsis, because I've already tried
execute block blockname(param1, param2)
but it doesn't work.
0
 
markusventerCommented:
You should not need to call excute block.

1.) Make sure the logged on user has execution rights to the proc.
2.) In your application you should just call execute procedure PROCEDURENAME.

Do not use the syntax execute block.  

What is the specific error you are getting?
0
 
IncognitoManAuthor Commented:
If I use the execute procedure procname(....) it says "Unknown procedure procname". So this doesn't work.
0
 
IncognitoManAuthor Commented:
Well the error is unknown token, but I don't know the sintacsis of calling a ibe script or block, so everything i've written is a guess. So is there someone that really knows how to call a block. To make it execute?
0
 
IncognitoManAuthor Commented:
So let me explain it better. I create an Firebird script using IBExpert. Then I save it in the database. But how to call it. Which statement to use? How to run the script, how to pass parameters to it?
0
 
markusventerCommented:
Are you sure the procedure is visible to the user you are logged in as?  

grant select on [procedure] to [user].

You could also try:    select * from [Procedure Name]

Can you at design time specify the in/output parameters of the query perhaps?  This is a wild guess as I am not familiar with C#.
0
 
IncognitoManAuthor Commented:
The user is SYSDBA, so everything is visible for him. And it is not a procedure, but a script, an ibeblock if you know what it is. And I just need the query to run the block. In C# i just can send queries to the database as I use ODBC to connect to firebird.
0
 
markusventerCommented:
OK, sorry then.  To execute the script you would have to use ibescript dll.  A seperate license required if you want to distribute it.  IBEBlock is ibexpert proprietary scripting technology.
0
 
IncognitoManAuthor Commented:
Is there any documentation on how to use this dll or can you explain it to me?
0
 
IncognitoManAuthor Commented:
Thank  you, I'll look in it. I wrote everything in the Visual Studio itself and didn't need the block, but also wrote a block, so maybe I'll choose the block cos it's faster.
0
 
markusventerCommented:
You are welcome.  Just bare in mind the licencing costs for using IBEScript.dll
0
All Courses

From novice to tech pro — start learning today.