cancel
Showing results for 
Search instead for 
Did you mean: 

need Some info about sp_trasaction notification

Former Member
0 Kudos

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".

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

No..

sir i tried in the same what u said..

Before done this one i had done another sp

i got result too,

but this time error  occured..

That's why i pasted sql errors also..

ashutosh_tomar
Contributor
0 Kudos

Seenu,

Are you running your SP with selecting the text in it..  if yes.. than try to run it without any selectios.

The errors in your post are because SQL is not able to read and declare.. Variables like @@transaction_type.   Or you are trying to run your SP at wrong place..

Regards

Ashutosh T

Former Member
0 Kudos

kkk i will try...

Answers (1)

Answers (1)

KennedyT21
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Ok Sir I will try later Doing Some Imp Work....

Former Member
0 Kudos

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..

Former Member
0 Kudos

Can you show me all the procedure you have?