Solved

How To Execute Script On Firebird

Posted on 2010-08-23
16
2,322 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MarkLogic 1 49
Quick and High level SQL Server 2012 Performance check 8 44
Currency Conversion? 1 37
Birthdays 3 0
Creating and Managing Databases with phpMyAdmin in cPanel.
Read about achieving the basic levels of HRIS security in the workplace.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now