Solved

How To Execute Script On Firebird

Posted on 2010-08-23
16
2,541 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
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

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

Question has a verified solution.

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

Make the most of your online learning experience.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
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 …
Six Sigma Control Plans

617 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