Skip to search.
IB-Conversions · Convert OtherDBMS to Firebird/IB

Group Information

  • Members: 499
  • Category: Data Formats
  • Founded: Jun 19, 2000
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

  Messages Help
Advanced
MS-Sql outparamter, is this the way to do it?   Message List  
Reply Message #663 of 663 | Next >
Hi there,

I have converted this MS-Sql sp to firebird. Can someone please tel me if i did
it the right way or did i misunderstand something.

Thanks

Edwin
[MS-Sql]
CREATE PROCEDURE LAND_I
(
@LANDCODE NVARCHAR(5)
, @LANDNAAM NVARCHAR(50)
, @RETURNVALUE INT OUTPUT
)
AS
BEGIN
DECLARE @VALUE NVARCHAR(5);
SET @VALUE = (SELECT COUNTRYCODE FROM TBLCOUNTRYS WHERE COUNTRYCODE =
@LANDCODE AND COUNTRYNAME = @LANDNAAM)
IF @VALUE IS NULL
BEGIN
INSERT INTO TBLLANDEN(COUNTRYCODE, COUNTRYNAME ) VALUES ( @LANDCODE,
@LANDNAAM)
IF @@ROWCOUNT > 0
SET @RETURNVALUE = 999
ELSE
SET @RETURNVALUE = 997
END
ELSE
SET @RETURNVALUE = 998
END
[/MS-Sql]


after converting i get this

[Firebird]
SET TERM ^ ;
CREATE PROCEDURE Country_I
(
LandCode varchar(5)
, landNaam varchar(50)
)
RETURNS
( ReturnValue int )
AS
DECLARE VARIABLE checkvalue varchar(5);
BEGIN
returnValue = 0;
checkvalue = (SELECT countrycode FROM TBLCOUNTRYS WHERE countrycode =
:LandCode AND countryname = :LandNaam);

if ( checkvalue is NULL ) THEN
BEGIN
INSERT INTO TBLCOUNTRYS (countrycode, countryname)
VALUES (:LandCode, :landNaam);
if ( ROW_COUNT > 0 ) THEN
BEGIN
returnValue = 999;
END
ELSE
BEGIN
returnValue = 997;
END
END
ELSE
returnValue = 998;
END^
SET TERM ; ^
[/Firebird]




Sun Jul 3, 2011 5:10 pm

jclichthouse
Offline Offline
Send Email Send Email

Message #663 of 663 | Next >
Expand Messages Author Sort by Date

Hi there, I have converted this MS-Sql sp to firebird. Can someone please tel me if i did it the right way or did i misunderstand something. Thanks Edwin ...
jclichthouse Offline Send Email Jul 3, 2011
5:10 pm
< Prev Topic  |  Next Topic >
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help