请解释这个存储过程我没有得到这个 [英] Please explain this stored procedure am not getting this

查看:68
本文介绍了请解释这个存储过程我没有得到这个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CREATE PROCEDURE  [dbo].[usp_zcCandidateStatus_Select_Submitted_Validating]

AS

BEGIN



 SET NOCOUNT ON;



 DECLARE @ObjectID int

 ,@LanguageID int

 ,@TimezoneID int

 ,@CNLanguageID int;



 SET  @ObjectID = (SELECT TOP 1 ObjectID from zcwTranslatedObjects WHERE ObjectName = 'zcCandidateStatus')



 EXEC usp_getUserPreferences @LanguageID out, @CNLanguageID out, @TimezoneID out;



 SELECT [StatusID]

   ,[Name] = dbo.fnGetTranslatedText(@ObjectID, CONVERT(NVARCHAR(50), StatusID), @LanguageID, @CNLanguageID, [Name])

 FROM zcCandidateStatus

 WHERE [StatusID] = 1 -- for 'Submitted' status

                OR [StatusID] = 8 -- for 'Validating' status

/*

 UNION



 SELECT

 Convert(int,PKID) as StatusID,

 PayRollDesc  = dbo.fnGetTranslatedText(@ObjectID, CONVERT(NVARCHAR(100), PKID), @LanguageID, @CNLanguageID, [Text])

 From zcwMasterTranslation

 where ObjectID=@ObjectID and PKID='-1'

*/

END

推荐答案

这是宣布一些变量供以后使用

This is declaring some variables for later use
DECLARE @ObjectID int 
  ,@LanguageID int
  ,@TimezoneID int
  ,@CNLanguageID int;







这将 @ObjectID 变量设置为 Ob的值表 zcwTranslatedObjects 中的jectID 列,其中列 ObjectName 等于 zcCandidateStatus




This sets the @ObjectID variable to the value of the ObjectID column in table zcwTranslatedObjects where the column ObjectName is equal to zcCandidateStatus.

SET @ObjectID = (SELECT TOP 1 ObjectID from zcwTranslatedObjects WHERE ObjectName = 'zcCandidateStatus')





这调用存储的proc usp_getUserPreferences ,它用一些值填充out参数,你我必须查看该程序以确切知道什么。



This calls stored proc usp_getUserPreferences which fills the out parameters with some values, you'd have to look at that procedure to know exactly what.

EXEC usp_getUserPreferences @LanguageID out, @CNLanguageID out, @TimezoneID out;







选择 StatusID 并通过调用 fnGetTranslatedText 传入其他参数来翻译该值。对于处于状态已提交验证的候选人,它会这样做。

您需要查看函数 fnGetTranslatedText 确切了解它的作用。




This selects out the StatusID and also a translated version of that value by calling fnGetTranslatedText passing in the other parameters. And it does that for candidates in status Submitted or Validating only.
You need to look at function fnGetTranslatedText to see exactly what it does.

SELECT [StatusID], [Name] = dbo.fnGetTranslatedText(@ObjectID, CONVERT(NVARCHAR(50), StatusID), @LanguageID, @CNLanguageID, [Name])
FROM zcCandidateStatus
WHERE 
   [StatusID] = 1 -- for 'Submitted' status
OR [StatusID] = 8 -- for 'Validating' status





希望这会有所帮助,

Fredrik



Hope this helps,
Fredrik


这篇关于请解释这个存储过程我没有得到这个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆