Announcement

Collapse
No announcement yet.

dynamimcally select table based on user login

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

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

    Easy peasy

    Comment


    • #3
      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

      Comment


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

        Aquiles

        Comment


        • #5
          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

          Comment


          • #6
            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.

            Comment


            • #7
              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
              Albert Drent
              aducom software netherlands
              scriptcase partner, reseller, support and (turn-key) development
              www.scriptcase.eu / www.scriptcase.nl

              Comment

              Working...
              X