on ‎2012 Dec 21 6:52 AM
Hi..
I need some info about sp_trasctin notification
in ohem i put one udf....actually this is varchar...
what i need is if any body addding the document..
the duplicates should not be allow..
i put this code in sp_trasction notification
but showing erros like below sp i past it error.
declare @srno as int
declare @count as int
IF (@transaction_type = 'A' or @transaction_type = 'U') AND @object_type = '53'
BEGIN
set @srno=(Select U_EPF from OHEM where empID=@list_of_cols_val_tab_del)
set @count=(Select count(*) from OHEM T0 where T0.U_EPF='@srno')
if @count>1
begin
SET @error = 10
SET @error_message = 'Plz enter the diff EPF Number'
end
end
error is
Msg 137, Level 15, State 2, Line 5
Must declare the scalar variable "@transaction_type".
Msg 137, Level 15, State 2, Line 9
Must declare the scalar variable "@list_of_cols_val_tab_del".
Msg 137, Level 15, State 1, Line 17
Must declare the scalar variable "@error".
Msg 137, Level 15, State 1, Line 19
Must declare the scalar variable "@error_message".
Request clarification before answering.
Hi Seenu....
Seems you are directly executing this SP in Query Analyzer.
But you have to run it somewhere else.
Please fillow the followiing Path
Start-->All Programs--> Microsoft SQL Server--> SQL Server Management.
Login and Expand your DB and select Programability-->
Stored Procedure-->SBO_SP_TransactionNotification.
Right click on this and select Modify and on right hand side screen Paste your SP under text written PASTE YOUR CODE HERE
Regards,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Seenu....
Try This
IF @Object_type = '53' and @transaction_type in ( 'A' ,'U')
BEGIN
If exists
(Select U_EPF from OHEM where empID=@list_of_cols_val_tab_del
and U_EPF in (Select U_EPF from OHEM) )
Select @error = 1,
@error_message = 'Plz enter the diff EPF Number!'
END
Hope Helpful
Regards
Kennedy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can Anybody plz tell me the what i am doing the mistake...
i go to procedure _ sp_tansaction_notification..
my requirement is
i put one udf in sales order..
if any post duplicate value show some error message.
but it is accepting the duplicated..
where i have done the mistake...
my code is...
IF @Object_type = '17' and @transaction_type in ( 'A' ,'U')
BEGIN
If exists
(Select U_OrderNo from ORDR where ORDR.DocNum=@list_of_cols_val_tab_del
and U_OrderNo in (Select U_OrderNo from ORDR))
Select @error = 1,
@error_message = 'Plz enter the diff ORDR NO Number!'
END
i just past it and then with out selecting the code..
i am executing the code..
but not working what is the mistake..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.