cancel
Showing results for 
Search instead for 
Did you mean: 

Using Like in Security Profile Authentication

Former Member
0 Kudos

Dears,

I am using row level security in Universe using security profiles.

In that i have to match BOUSER with one column data, that column has multiple employee numbers in it.

structure of that column is like this:

5432-4578-8392-4021

and BOUSER can be either 4578 or the other, So i have to use LIKE operator here.

In Query we write something BOUSER like '%EmployeeNumbers%'

But in Security Profile, We can use Like but when i put query like above, it gives error of syntax.

It only allows BOUSER LIKE EmployeeNumbers,


I Just want to ask if the behavior is same or not.


BR,

Hassan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Hassan,

What is your backend database?

Could you try with BOUSER like '*EmployeeNumbers*'

Regards

Niraj

Former Member
0 Kudos

Hi Niraj,

Thanks for responding.

Backend is SQL Server, But Security profile where clause doesnt accept SQL Server syntax.

I have tried.

'%EmployeeNumbers%'

'*EmployeeNumbers*'

it gives error in either case, when i try this:

'%'+EmployeeNumbers+'%'

It gives wrong data.

I am stuck here, Can you please help me out here as i dont know how to use LIKE operator here.

Former Member
0 Kudos

Hello Hassan,

I believe this is something where we have to search for a String in another string to get to know if first string is a part of second one or not.

In this case Like will not work I believe you may have to use CharIndex function of SQL Server.

Here's a link below that should help you with this.

http://stackoverflow.com/questions/2505923/check-if-a-string-contains-a-substring-in-sql-server-2005...

Regards

Niraj

Former Member
0 Kudos

Dear

Actually in Where clause of security profile, it is not the SQL Syntax which it will accept, It is just its syntax where i can use LIKE but with no '%', So i dont know how to make a statement which will work this way.

BOUSER LIKE '%EmployeeNumbers%'

Any suggestions please

Former Member
0 Kudos

Problem is solved by using charindex database function in Query clause of security profile.

Former Member
0 Kudos

Glad CharIndex worked for you what I suggested. Please close the thread if you have answers to query.

Niraj