9 Replies Latest reply: May 13, 2012 11:45 PM by 793559 RSS

    Retrieving user

    793559
      Hi all

      I am developing a report where the user selects an option from a drop down list. Only four of the users can select ALL option from the list. In my plsql procedure I get their usernames first

      Select user into v_user from dual;

      Then get the Id of the user


      Select Id into v_Id from user_table
      Where upper(username) = upper(v_user);

      And then

      If Id in ('200','300','400','500') then

      If v_option = 'ALL' then. ........... End if; end if;

      Now only two of the users are able to run the report successfully the other two don't get any data when they run the report with ALL option.

      Now I feel the report is going wrong in grabbing their user name when the report is run for the two users. And I don't understand why it fails for two and is fine for other two. I wanted to check if I am using a standard code in getting usernames or not ? is their a better or alternate way to do this .? I am using 10g database.

      Any help is very much appreciated. Thank you.
        • 1. Re: Retrieving user
          prakash
          hi ,

          I hope four users ('200','300','400','500') can select ALL option from the drop down list .
          Your are telling its working for only two users , have you verified whether data is present for other two users who are not getting data in the report.

          Your code looks ok , please check it again ..


          Thanks,
          P Prakash
          • 2. Re: Retrieving user
            sb92075
            user11338524 wrote:
            Hi all

            I am developing a report where the user selects an option from a drop down list. Only four of the users can select ALL option from the list. In my plsql procedure I get their usernames first

            Select user into v_user from dual;

            Then get the Id of the user


            Select Id into v_Id from user_table
            Where upper(username) = upper(v_user);

            And then

            If Id in ('200','300','400','500') then
            why checking "ld" when should be checking "v_ld" variable?
            • 3. Re: Retrieving user
              793559
              Sorry I meant to type

              If v_id in (......)
              • 4. Re: Retrieving user
                sb92075
                user11338524 wrote:
                Sorry I meant to type

                If v_id in (......)
                I am sorry that COPY & PASTE are broken for you.

                why do you expect any useful answer when you do not post actual code that has the problem?
                • 5. Re: Retrieving user
                  793559
                  Being a weekend I didn't had access to my script. It's a simple code. Since it's working for few alright I believe the code is fine. I just wanted to check if the basic logic in the script is a standard way to do it. My feeling is it's not able to capture the username of the two users. They exist in the user table fine. They have a username and Id like everyone else. Could their computer settings etc could cause an issue ?
                  • 6. Re: Retrieving user
                    557482
                    Just check if you are getting the the value for option properly. Probably they might have spaces or the value of ALL that is expected is not being passed correctly?
                    • 7. Re: Retrieving user
                      367852
                      1. Hope you are not getting a exception data_not_found which is also getting supressed somehow.
                      2. Try the following debugging as a last resort. Create table debug_log varchar2(100), and write a insert statement to put a record in the table with values nvl(user,nulluser) || nvl(id,nullid). Also put the commit statement.
                      3. REMEMBER to cleanup after the issue is resolved i.e drop debug_log and the remove the insert statement and the commit.
                      • 8. Re: Retrieving user
                        sb92075
                        user11338524 wrote:
                        Being a weekend I didn't had access to my script. It's a simple code. Since it's working for few alright I believe the code is fine.
                        OK, then code is fine & no problem exists.
                        Congratulations!
                        • 9. Re: Retrieving user
                          793559
                          Thanks for evereyones help on this. I just created a test report that displays just the username, Id for whoever that runs the report. And the username and Ids dont get displayed on these peoples machine. It works fine for me and rest of my team.

                          Its just the clients machine(they just sit next to us and login to the application through citrix server just like us) where the username is not able to be captured.

                          Well, atelast I know now whats the problem.

                          I am looking to make an alternate report that is not based on usernames.