|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
New to Firebird stored procedures - help needed
I am just starting to use stored procedures with VB.Net.
I have a SP that returns a value but I do not know how to retrieve it. Here is the SP Quote:
This is the code I have so far... myCommand = New FbCommand("PROCEDURE_02", myConnection) myCommand.CommandType = CommandType.StoredProcedure myCommand.Parameters.Add("@JOB_CLASS", "XY") ' Return comment for "XY" How do I determine the value for my_comment? |
|
#2
|
||||
|
||||
|
Calling ExecuteScalar() on the myCommand may work, but I'm fairly certain the following will:
1. Add another parameter for "@my_comment". 2. Set that parameter's Direction property to ParameterDirection.Output. 3. Call ExecuteNonQuery() on myCommand. 4. Retrieve the Value that has now been put in that parameter. Here's a good site.
__________________
Joel B Fant "An element of conflict in any discussion is a very good thing. Shows everybody's taking part, nobody left out. I like that." .NET Must-Haves Tools: Reflector References: Threading in .NET |
|
#3
|
|||
|
|||
|
Hi LyonHaert;
Thanks for getting me started but I really need lots of information or a good tutorial. I figured out how to get parameter information into a stored procedure. The site you suggested confirmd that I was doing it right. Here are some comments/questions from your post. Perhaps you or others can share your knowledge. 1. Add another parameter for "@my_comment". What is the syntax, this myCommand.Parameters.Add("@my_comment") or something else? 2. Set that parameter's Direction property to ParameterDirection.Output. How exactly do you do this? I can find no information on this anywhere. I've searched high and low for information/tutorial on using the net porvider and have turned up next to nothing. 3. Call ExecuteNonQuery() on myCommand. No problems here. 4. Retrieve the Value that has now been put in that parameter. Once again, how do you do this? Is there any information anywhere that explains how to do this stuff? Thanks for the help. Lin |
|
#4
|
||||
|
||||
|
See the sticky thread on top of this forum, lots of resources, even Firebird and .Net specific (but in this case any tutorial about .net and stored procs should do)
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#5
|
|||
|
|||
|
Hi pabloj
Thanks for taking the time to respond but I am beginning to feel like a sinking ship. but in this case any tutorial about .net and stored procs should do I've been following links for days and generally feeling overwhelmed by it all. Is there a tutorial anywhere that you can name or point me to that shows in simple language how to use the Firebird net provider with VB.Net to..... 1) Send parameter values to a stored procedure. I mostly have this one figured out but additional information wouldn't hurt. 2) How to retrieve and use values returned as parameters from a stored procedure. 3) How to retrieve and use values where multiple rows are returned. 4) Anything else that I may have missed. Thanks Lin |
|
#6
|
||||
|
||||
|
Regarding your questions about the Direction property and retrieving the value, there is more code in the comments of the page I linked which show this.
|
|
#7
|
||||
|
||||
|
LinXG, please consider that people here do take the time to think before posting and expect readers to do the same, in this case read the article(s) linked.
LyonHaert pointed you to a page which shows you how to solve your problems 1) and 2), then, the same site (or Google) have the answer for question 3), see here . Of course 4) is a bit generic and unlikely to get a quick answer ![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > New to Firebird stored procedures - help needed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|