Solved

How To Execute Script On Firebird

Posted on 2010-08-23
16
2,397 Views
Last Modified: 2013-12-09
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.
0
Comment
Question by:IncognitoMan
16 Comments
 
LVL 19

Expert Comment

by:NickUpson
ID: 33502366
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
 

Author Comment

by:IncognitoMan
ID: 33502736
- 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
 
LVL 15

Expert Comment

by:JBond2010
ID: 33502920
Check out this link and see does it help you.

http://firebirdsql.org/pdfmanual/Firebird-fb-shell-scripts.pdf
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 2

Expert Comment

by:markusventer
ID: 33503765
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
 

Author Comment

by:IncognitoMan
ID: 33504038
I need the whole syntacsis, because I've already tried
execute block blockname(param1, param2)
but it doesn't work.
0
 
LVL 2

Expert Comment

by:markusventer
ID: 33504279
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
 

Author Comment

by:IncognitoMan
ID: 33504516
If I use the execute procedure procname(....) it says "Unknown procedure procname". So this doesn't work.
0
 

Author Comment

by:IncognitoMan
ID: 33504535
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
 

Author Comment

by:IncognitoMan
ID: 33504907
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
 
LVL 2

Expert Comment

by:markusventer
ID: 33507688
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
 

Author Comment

by:IncognitoMan
ID: 33508192
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
 
LVL 2

Expert Comment

by:markusventer
ID: 33509554
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
 

Author Comment

by:IncognitoMan
ID: 33511434
Is there any documentation on how to use this dll or can you explain it to me?
0
 
LVL 2

Accepted Solution

by:
markusventer earned 500 total points
ID: 33512081
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
 

Author Comment

by:IncognitoMan
ID: 33535376
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
 
LVL 2

Expert Comment

by:markusventer
ID: 33539169
You are welcome.  Just bare in mind the licencing costs for using IBEScript.dll
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question