How to refer the reference table column in database view where clause?

Alextia
Giga Expert

I just want to write a where clause in database view , where  i would need to mention the reference field column.

I have tried it with dot to mention the reference table but it returns all the rows.

Can someone help me on this , please?

Ex.

Table -> Group

Prefix -> gp

gp_user.employee_number = '1234567' -> user is reference field where employee_number is one of its column.

 

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

We need the full picture here.  What are the other tables in the view?  What other where clauses do you have?  Any left joins?  Is the view otherwise working without this where clause? What are you trying to see?  By 'Group' table do you mean sys_user_group?  User is not a field on this table, so did you add a custom field, or do you mean the sys_user_grmember table that lists each user in each group?  In any event, where clauses have limited usage and are meant only for joining tables, and can provide some basic level of filtering.  Dot-walking is not possible in a where clause as you only have access to the fields on the tables in the join, not fields related to those fields.  Depending on what you're trying to accomplish you can either add the sys_user table to the join so that you can add the employee_number filter on that where clause, or you can create a Query Business Rule that uses the Database View as its table and includes a script that limits the results - so the end result is the Database View only contains the records that you want without having to apply a filter.

Got it, Thank you