Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 12th, 2012, 01:48 AM
Fredi Niklaus Fredi Niklaus is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 2 Fredi Niklaus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 6 sec
Reputation Power: 0
Whats the difference on .ReturnValue and .Output?

I use a Firebird 2.5 an call a stored procedures.

The called server stored procedure
CREATE OR ALTER PROCEDURE P_BLOCK_KONTROLLE (
aufruftitel varchar_255,
testext_in varchar_255)
returns (
blockid id,
istzeit zeitstempel,
rueckgabetitel varchar_255,
testext_aus varchar_255)
as
begin
blockid = 10;
istzeit = current_timestamp;
rueckgabetitel = aufruftitel;
testext_aus = testext_in;
suspend;
end


The vb-code, that calls the procedure
Sub AufrufStoredProcedure()

Dim cn As New FbConnection(strDBConn)
cn.Close()
cn.Open()
Dim cmd As New FbCommand("p_block_kontrolle", cn)
cmd.CommandType = CommandType.StoredProcedure

Dim fbParamI_1 As FbParameter = cmd.Parameters.AddWithValue("A", "Hello World")
Dim fbParamI_2 As FbParameter = cmd.Parameters.AddWithValue("E", "Simple test text")

Dim fbParamR_1 As FbParameter = cmd.Parameters.Add("B", FbDbType.Integer)
Dim fbParamR_2 As FbParameter = cmd.Parameters.Add("C", FbDbType.TimeStamp)
Dim fbParamR_3 As FbParameter = cmd.Parameters.Add("D", FbDbType.VarChar, 255)

fbParamI_1.Direction = ParameterDirection.Input
fbParamI_2.Direction = ParameterDirection.Input



' declaration with ReturnValue
fbParamR_1.Direction = ParameterDirection.ReturnValue
fbParamR_2.Direction = ParameterDirection.ReturnValue
fbParamR_3.Direction = ParameterDirection.ReturnValue


cmd.ExecuteNonQuery()
Debug.Print("Version with ReturnValue")
Debug.Print("Input-Parameter 1 = " + fbParamI_1.Value.ToString)
Debug.Print("Return-Parameter 1 = " + fbParamR_1.Value.ToString)
Debug.Print("Return-Parameter 2 = " + fbParamR_2.Value.ToString)
Debug.Print("Return-Parameter 3 = " + fbParamR_3.Value)


' declaration with Output
fbParamR_1.Direction = ParameterDirection.Output
fbParamR_2.Direction = ParameterDirection.Output
fbParamR_3.Direction = ParameterDirection.Output


cmd.ExecuteNonQuery()
Debug.Print("Version with Output")
Debug.Print("InputOutput-Parameter 1 = " + fbParamI_1.Value.ToString)
Debug.Print("Return-Parameter 1 = " + fbParamR_1.Value.ToString)
Debug.Print("Return-Parameter 2 = " + fbParamR_2.Value.ToString)
Debug.Print("Return-Parameter 3 = " + fbParamR_3.Value)

cn.Close()
cn.Dispose()
End Sub

With both declaration i get the requested result.
I do not see any difference.
Whats the reason for this two options?
Thanks for a short explanation.

Reply With Quote
  #2  
Old May 12th, 2012, 06:25 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
I am just guessing (in an educated way) but I think this is a question for a VB forum.
There is just one set of out parameters as far as Firebird is concerned.
How VB treats/names them I do not know.

Reply With Quote
  #3  
Old May 13th, 2012, 11:41 PM
Fredi Niklaus Fredi Niklaus is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 2 Fredi Niklaus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 6 sec
Reputation Power: 0
Quote:
Originally Posted by clivew
I am just guessing (in an educated way) but I think this is a question for a VB forum.
There is just one set of out parameters as far as Firebird is concerned.
How VB treats/names them I do not know.


The reason to post this question on a Firebird Forum is, that the declarations made in the VB code all base on the
FirebirdSql.Data.FirebirdClient.dll (FBCommand, FBParamters and so on).
So the cmd-Variable is instance of FBCommand and fbparam is a instance/child of cmd.

fbparam has two characteristics (ReturnValue; Output).
Both are working fine, both are directly depending on the .DLL-Interface from Firebird. I just do not see a difference between. If they are equal I'm happy.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Whats the difference on .ReturnValue and .Output?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap