Skip to Content
0

SP TN to check the value of a column field in OINS table

Aug 24, 2017 at 03:29 AM

33

avatar image
Former Member

Hi,

I had created a UDF in OINS called U_CHECK

The only allow value is A or B or C, not others value is allow, else it will block.

The input might be ABC, BAC, CBA, AAA, ABB, CCB, etc, but no others character than ABC

How can I achieve this requirement

The following query doesn't work.

Thanks

 


IF @OBJECT_TYPE = '176' AND
@TRANSACTION_TYPE IN ('A', 'U')


  BEGIN


   IF EXISTS(


    SELECT T0.U_CHECK FROM OINS T0


     where 


T0.U_CHECK NOT LIKE '[A-C]' 


AND T0. insID = @list_of_cols_val_tab_del)


   Begin


    SELECT @ERROR=17002,@ERROR_MESSAGE='XXX'


  End


END
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers