dynamimcally select table based on user login

hi SC troopers,

I have tables in my DB as follows (identical fields in all tables):

table_user1
table_user2

I want my grid when loading to be associated with the the table pertaining to a certain user based on the user login id.

I hope it is possible.

best

Just add the table1 or the table2 to the user table
And select it during the grid SQL statement

Easy peasy

hi there,

tried this approach (didn’t work) to add the user id to the sql statement of the grid

… FROM table_||’[user_id]’

cheers

Normalize it, just add an User_id field to only one table

Aquiles

Not sure it would work, but I use something like this in a WHERE clause

WHERE (skid_status=‘A’ [show_complete])

So, I would think you would want
FROM table_[user_id]

Not sure of your application, Bbut I don’t think creating a separate table for each user will scale well, and could get very complicated.

Nick

yea, Not soo Easy Peasy as I said,
I dont think you can do this… I kept on getting an error because you have to supply the grid with a table or view.

I actually haven’t tried this but there’s a property variable for table which can be used to change table names. So I think it should be pretty simple, but again, never tried it. The property is located below the sql statement if you select the sql menu option on the left menu of an application