Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 problem with how can we test a function ...!!!!

Author  Topic 

ramana123
Yak Posting Veteran

57 Posts

Posted - 2005-07-29 : 01:41:34
hi my problem is i hav one function in sqlserver..
i have to test that whether it is working fine or not..
i tried that looks like below..


DECLARE @A INT
SET @A=23516
declare @err_no int
SET @err_no= exec Price_Bands_PKG_FV_Used_In_Fees @A
PRINT @err_no


but it shows the error near to keyword exec..
can you tell me thee sol pls...
thanks

rams123

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-29 : 02:05:22
Can you post the code used in the function?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

ramana123
Yak Posting Veteran

57 Posts

Posted - 2005-07-29 : 02:08:38
hi this is my function code...

CREATE FUNCTION Price_Bands_PKG_FV_Used_In_Fees (@In_Fee_Value_Number INT)
RETURNS BIT
WITH ENCRYPTION
AS
BEGIN
-- Determines whether the Fee_Value_Number passed in is currently in use in the
-- FEES_LIST table.
DECLARE @v_Fee_Value_Number INT
DECLARE @v_success INT

Select @v_Fee_Value_Number = Fee_Value_Number
From FEES_LIST
Where Fee_Value_Number = @In_Fee_Value_Number

-- Currently in use!
IF @@ROWCOUNT > 0
set @v_success = 1
ELSE
set @v_success = 0-- Not currently being used.


return @v_success
END
Go to Top of Page

byrmol
Shed Building SQL Farmer

1591 Posts

Posted - 2005-07-29 : 02:13:30
>> WITH ENCRYPTION

LOL

DavidM

A front-end is something that tries to violate a back-end.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-29 : 02:20:48
You should use

DECLARE @A INT
SET @A=235516
declare @err_no int
select @err_no=Price_Bands_PKG_FV_Used_In_Fees(@A)
PRINT @err_no


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

ramana123
Yak Posting Veteran

57 Posts

Posted - 2005-07-29 : 02:24:21
thanks now iam able to test my function...!!!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-07-29 : 04:09:38
quote:
Originally posted by byrmol

>> WITH ENCRYPTION

LOL

DavidM


What's wrong with that then? Other than the fact that the actual encryption method is lousy ...

Kristen
Go to Top of Page

byrmol
Shed Building SQL Farmer

1591 Posts

Posted - 2005-07-29 : 04:16:16
>> What's wrong with that then?

He posted the plain text version on the INTERNET!

DavidM

A front-end is something that tries to violate a back-end.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-07-29 : 04:21:11
Ah .... GotIt! Good Point.

Kristen
Go to Top of Page
   

- Advertisement -