Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server Select Statement
Message
From
21/07/2005 10:56:20
Stephen Hunt
Admit Computer Services Inc.
Farmingdale, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01034265
Message ID:
01034672
Views:
29
Ok here is my scalar UDF

CREATE FUNCTION fn_getjudge(@module char(10), @keyident nvarchar (12))
RETURNS char(3)
begin
DECLARE @judgecode Char(3)
SET @judgecode=''
if @module='MV'
SELECT @judgecode= mv_judge FROM motorvehicle
WHERE keyident = @keyident
RETURN (@judgecode)
if @module='LL'
SELECT @judgecode= ll_judge FROM locallaw
WHERE keyident = @keyident
RETURN (@judgecode)
if @module='CV'
SELECT @judgecode=civ_judge FROM civil
WHERE keyident = @keyident
RETURN (@judgecode)
if @module='CRM'
SELECT @judgecode=crm_judge FROM criminal
WHERE keyident = @keyident
RETURN (@judgecode)
if @module='SC'
SELECT @judgecode=sc_judge FROM smallclaims
WHERE keyident = @keyident
RETURN (@judgecode)
end
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform