How to assign a user to a variable?

for example:

username: * scott *.

under this user, there is a table called employee.

Select * from scott.employee; (Normal mode)

I want to assign the user scott to the variable a and view the table as
Select * from a.employee;

Is it possible to assign a user to a variable?

In SQL, a variable is allowed to be used only as a value that is passed to a clause where clause. You cannot use variables that contain the name of the object in the static SQL. You must build the SQL Dynimically.

Here is an example.

declare
  mySchema varchar2(100);
  lSal emp.sal%type;
  lEmpNo emp.empno%type;
begin
  mySchema := 'SCOTT';
  lEmpNo := 100;
  execute immediate 'select sal from ' || mySchema  || '.emp where empno = :1' using lEmpNo into lSal;
end;

Tags: Database

Similar Questions

  • How to assign the value to the variable of project in the Jython script

    Hello

    I want to assign a value to the variable of project in the jython script.
    I tried to assign the following, but it is throwing some errors.

    < @.
    int noOfRecords = 10;
    #var1 = noOfRecords;
    @ >


    Can you please help me in this regard.

    Concerning
    Shyam

    Perfect! Good to know that!

    Please, don't forget to close the thread and assign the status to 'correct' or 'comfortable' to each response that helped you!

    Thank you

    Cezar Santos
    http://odiexeperts.com

  • How to assign a calculation to a variable in the RTF file?

    Hello


    I play a series of if - end if statements to calculate the "Days_Late."

    <? If: DAYS_LATE < 0? > <? xdoxslt:round ((somme (if: DAYS_LATE) div count (PAYMENT)), 0)? > <? end if? >

    <? If: DAYS_LATE = 0? > * <? end if? >

    <? If: DAYS_LATE > = 0? > <? xdoxslt:round ((somme (if: DAYS_LATE) div count (PAYMENT)), 0)? > <? end if? >

    I would like to assign the code above to a variable and use this variable in the following logic <? xdoxslt:IfElse (VARIABLE > 0, round (VARIABLE),-1 * round (xdoxslt:abs (VARIABLE)))? >

    to exercise a function of round_up ("symmetric" rounded). Oracle doesn't have a function for this yet...


    How can I make this work directly in the .rtf file?


    Thank you

    ATP

    Hi all

    I didn't change the data (sql).
    Also, I tried to make it work using the xdoxslt:set_variable () and xdoxslt:get_variable () functions. However, this was not necessary and makes more complex than required.

    It is now resolved using a formula of symmetric rounding (rounded to 0):

    I replaced the VARIABLE with my calculation: (sum (DAYS_LATE) count (PAYMENT) div)

    Thanks a lot for the replies and offers to help her

  • How to assign the user role by using a script?

    Hello

    I want to assign a role permission set to a local ESX 4 install any user account with a CLI command, so I can do during the ks.

    Did anyone done this before?

    Tips and tricks are welcome.

    THX

    Take a look at the vCLI esxcfg-user command that can be done outside the Console of the ESX Service or you can take a look by using vimsh on the Service Console:

    [root@himalaya ~]# vmware-vim-cmd vimsvc/auth
    Commands available under vimsvc/auth/:
    admin_account_disable     entity_permission_remove  role_add
    admin_account_enable      entity_permissions        role_permissions
    admin_account_is_enabled  permissions               role_remove
    entity_permission_add     privileges                roles
    

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    150 VMware developer

    If you find this information useful, please give points to "correct" or "useful".

  • How to assign the value of a variable to a quiz?

    Hi, I have a problem, I attempted to set the value of a variable for the quiz on the final value of the project, any suggestions?

    Sorry but I do not understand your question at all. If you talk about a quiz like cpQuizInfoPointsscored or cpInfoPercentage system variable, this is all simply impossible because the system variables are read-only.

  • How to assign multiple responsibilities of user OBIEE

    Hi all

    How to assign multiple user when responsibilities OBIEE integrated with EBS R12.

    For example, I XXX_Custom, XXXX_Custom1 responsibilities of user1 in EBS. When I navigate to EBS to OBIEE how to get these two responsibilities. It is currently only a single responsibility.

    Thank you
    Srikanth.

    Ensure that EBS GLOBAL security context. User_name is assigned to the: variable system target session USER.

    Also in init block group change cela roles and use SQL in DataSource code change.

    SELECT '' DISTINCT ROLES, RESPONSIBILITY_NAME OF
    FND_USER, FND_USER_RESP_GROUPS, FND_RESPONSIBILITY_VL
    WHERE
    FND_USER.user_id = FND_USER_RESP_GROUPS.user_id
    AND FND_USER_RESP_GROUPS. RESPONSIBILITY_ID = FND_RESPONSIBILITY_VL. RESPONSIBILITY_ID
    AND FND_USER_RESP_GROUPS. RESPONSIBILITY_APPLICATION_ID = FND_RESPONSIBILITY_VL. APPLICATION_ID AND
    FND_USER_RESP_GROUPS. START_DATE< sysdate="">
    (CASE WHEN FND_USER_RESP_GROUPS. End_date IS NULL THEN SYSDATE TO_DATE (FND_USER_RESP_GROUPS.end_Date) to ANOTHER END) > = SYSDATE
    AND FND_USER.user_id = (SELECT USER_ID FROM FND_USER WHERE USER_NAME = ' VALUEOF (NQ_SESSION.) THE USER) ";

    In order to change, just check the initialization of sage online and do not allow caching.

    Save the changes and deploy this RPD, restart OPMN services and you should now see all the responsibilities of the EBS to OBIEE.

    Have you created roles in EM with the same name of responsibility?

    I hope this helps. Pls mark if he does.

    Thank you
    SVS

    Thank you

  • How to assign the next value in the sequence directly in a variable?

    How to assign the next value in the sequence directly in a variable without using a table TWICE in PL/SQL.

    BluShadow wrote:

    How about a quick test on 11g, just to see if you directly select a sequence in a variable is significantly better than the mark of DOUBLE.

    ...

    Nope... no obvious difference.

    This is because there is none: Oracle's SELECT sequence. NEXTVAL FROM DUAL under the covers. The direct assignment is just a convenient encoding for us, but it does not change the work that accomplishes Oracle.

    create sequence s;
    alter system flush shared_pool;
    declare
    l_num number;
    begin
    l_num := s.nextval;
    end;
    /
    select sql_text from v$sql where parsing_schema_name = user;
    
    SQL_TEXT
    Report the number of l_num; begin l_num: = s.nextval; end;
    Select sql_text from v$ sql where parsing_schema_name = user
    Select double S.NEXTVAL
  • How to assign variables itemrender in a global public variable of my application.


    Hi friends,

    How to assign values to render internal elements in a global public variable. You can see example below.

    List an itemrender, the itemrender breast I use the data grid. The dataGrid control have itemrender.now I tried the values to assign public variable in my application data grid itemrender, but is it from the error... How can I slove u this problem Any One can help me.

    Example:

    public var myData:arrayCollection;

    < mx:List variableRowHeight = "true" dataChange = "validateNow ()" width = "900" id = "Lst_userlist" verticalScrollPolicy = "off" horizontalScrollPolicy = "off" "
    buttonMode = "true" >

    < mx:itemRenderer >

    < fx:Component >

    < mx:VBox paddingTop = "-5" horizontalScrollPolicy = "off" verticalScrollPolicy = "off" >

    < fx:Script >
    <! [CDATA]

    override public function set data(value:Object):void
    {
    ------

    -----
    }

    []] >

    < / fx:Script >

    < mx:VBox id = "vbox_grid" horizontalScrollPolicy = "off" verticalScrollPolicy = "off" width = paddingLeft '890' = "10" paddingTop = "5".

    backgroundColor = "#317152" color = "#FFFFFF" >

    < mx:DataGrid visible = "false" includeInLayout = "false" height = "100%" id = "membershipGrid" alternatingItemColors = "[#DCDCDC, F8F8FF #]".

    "5" paddingLeft = horizontalScrollPolicy = "off" color = 'black '.
    horizontalGridLines = "false" verticalScrollPolicy = 'auto' verticalGridLines = "false" rowHeight = "25".
    borderSkin = "{null}" showHeaders = 'true' borderVisible = "false" dataProvider = "{data.dataCollection}" width = "900" > "

    < mx:columns >

    < mx:DataGridColumn width = "180" headerText = "Name" minWidth = "150" sortable = "true" wordWrap = "true" >
    < mx:itemRenderer >
    < fx:Component >

    < mx:HBox horizontalScrollPolicy = "off" >

    < fx:Script >
    <! [CDATA]

    override public function set data(value:Object):void
    {
    -----

    -----

    }

    function Click_Name (): void
    {

    outerDocument.myData = data;  Here the error came

    }

    []] >

    < / fx:Script >
    < mx:Image id = "fileimg" buttonMode = "true" toolTip = "This is organization at the home page of the user" / >
    < s:Label id = "lbl_Gridcloumn_name" width = "200" buttonMode = "true" textDecoration = "underline" click = "Click_Name ()" / > "

    < / mx:HBox >
    < / fx:Component >

    < / mx:itemRenderer >
    < / mx:DataGridColumn >

    < / cloumn >

    < / datagrid >

    Error:

    MyData property possibly access not defined through a reference with static type com.istmanagement.views:ProgramAcessRights_ComponentInnerClass3.

    Thank you

    Mamoudou R.

    Have you tried outerDocument.outerDocument.myData?

  • How to assign a creative cloud license to a user name

    How to assign a creative cloud license to a user name? I can't get through to anyone useful adobe - they are all very polite but not very useful. Adobe are all to take your money, but not for providng any service.

    You have not provided enough information, if you have a mind-specific agreement.  Otherwise, sign this user for their own subscription and organize the system of payment for them.

  • How do you assign the user who has logged in to the current session?

    Hello

    in oracle forms, you might affected the user who is logged on any field, for example field_name: = USER_ID;

    I need assign the user that has connected to a field in jdeveloper 12. How do you do that please?

    Thank you.

    Try this: https://www.google.com/search?q=adf+get+current+user

    CM.

  • How to assign the pl/sql variable to a variable of the page element?

    I want to select count (*) in the emp table.

    assign this count (*) total to a pl/sql variable.

    How can I assign this varialbe pl/sql variable of page element?

    : p2_test = pl_total;

    Thank you.

    Good afternoon

    Try this:

    1. create a process Page:

    Declare
    pl_total number;
    Begin
    select count(*)
    into pl_total
    from emp_table;
    :P2_test := pl_total;
    End;

    Or a simpler approach:


    Begin
    select count(1)
    into :P2_test
    from emp_table;
    End;

    If you use count (1) rather that count (*), you do the inventory column 1 and not the entire file. Oracle then reads just column 1 instead of the whole of the record, speed up your query, if the table can have a large number of columns AND a lot of files.

    Good luck
    Don.

    You can reward this answer by marking as being useful or correct :)

  • Question: how to assign the VPN IP VPN client user using 5.4 ACS?

    I'm new to ACS5.4.  What I want to achieve is to leave the ACS5.4 to assign IP addresses to users who are connecting to our ASA using the Cisco VPN client.  ASA runs as a Radius of ACS5.4 client, and we have tested successfully for Radius Authentication.  But users always get "unknown error" in the client VPN, after to be authenticated successfully.  I think I used probably incorrect RADIUS attributes to an authorization policy.  Here's what I did:

    1. in the elements of the policy-> authorization permissions->-> authorization of network access profiles, I created a new profile and this profile is called the Radius CVPN3000/ASA/PIX7.x-DHCP-Network-Scope attribute.  An IP address is entered under this attribute as a static value.

    2. then, in access policies-> services-> client VPN IPSec with RADIUS Access (it's politics that I created)-> permission, I created an authorization policy allowing RADIUS previously created profile in order to be used.

    I missed something?  Maybe I got the wrong RADIUS attribute?  Thanks in advance for any help!

    ACS 5 doesn't have the ability to provide the IP addresses between the pools of IP addresses defined in ACS.

    You must assign static users on basis by user on ACS 5. You can also create a pool on the SAA and tap the name of the ACS 5 pool

    http://www.Cisco.com/en/us/docs/net_mgmt/cisco_secure_access_control_system/5.3/release/notes/acs_53_rn.html#wp216411

    Jatin kone
    -Does the rate of useful messages-

  • How to assign only read access to a user for HFM App

    Hello

    I have a doubt like the United States, the actual process of the stripe to assign a user as the read access only for request of HFM. I am new to this and I know that this need be done through HSS. Could then someone let me know the process

    Please ask you to close the post if it seems your problem.

    Thank you

    ~ KKT ~.

  • How to assign the value to a dynamically created flash variable.

    I want to change the value of a variable that is in another flash movie. I loaded the swf file. Inside the function "onLoadInit", I wrote code like below.

    loadListener.onLoadInit = function(target_mc:MovieClip):Void
    {

    This [target_mc + "."] contents.obj.' + mcSelfObj. m_TemparVariables [w] .varname] = 'Left ';

    where mcSelfObj. m_TemparVariables [w] .varname contains 'position', which is the variable I want to change. This declaration is not assign a value to the variable.

    If I hardcode the above statement as below it works

    target_mc.contents.obj.position = 'Left ';

    }

    In the previous version of flash, we used eval() to make over assignments.

    While you don't seem to use AS3, try...

    [mcSelfObj.m_TemparVariables [w] .varname] target_mc.contents.obj = "Left";

    based on what you say works, which is the best I can do to determine where the media should be.

    If these are all a form of variable identity rather than the names of instnance, then you will need to use parentheses for each instance and do not use points

  • How to assign the value to the application-level element

    Hello

    I'm learning to APEX.  I use version 4.2.6.

    My question is, I set a text field called 'FINANCIAL_YEAR' in the login page.  I wanted to know how to assign this value to a text element of Application level (on page sent), so that I can get this value through at my request.

    Thank you

    -Anand

    anand_gp wrote:

    Yes, I created a 'text area' under 'HTML' in the 'Home' page  Who accepts the exercise of a table through LOV.  I intend to assign this value to a global variable so that this variable can be read in any of the application to filter the result set from different tables (not yet built the rest of the application).  To do this, I was intending to use "Shared components"-> "Elements of Application".  I'm still not quite sure how it works.

    Start by reading the documentation on elements of application.

    Go to the shared components > Application parts and create your G_FINANCIAL_YEAR item. Value Session State Protection Restricted - can not be set the browser so that the value is not editable by the user, falsification of URLS or scripts.

    On the home page, if there is not already a button to submit the value of the fiscal year, add one in the HTML area, with the Action as a submit Pageclick. Otherwise, you can do without the button and using submit Page in Page Action when the changed value select the parameter in the list so he can undergo.

    Then, in the section of the Page processing, create a calculation:

    Point Type: Application-level element

    Calculate Item: Application: G_FINANCIAL_YEAR

    Point calculation: After submit

    Type of calculation: Value of the element

    Calculation:

    Run the application, select a value in the list of the fiscal year and submit the page. Review of current session state in the viewer of session state by clicking on the link of Session in the toolbar developer. Select the Elements of Application in the view list, and then click set. The element of your application and its current value must be visible. You can now reference value throughout your application by using the appropriate syntax.

    You should also consider if a default value (for example the current year) using a calculation Application from the point of calculation on the new Instance and coordinate the application point and part of the homepage using point application as the Source of value or an expression with Source page element, the value always, replacement of value that exists in the session state.

Maybe you are looking for

  • How to transfer music from the ipod and create a new library

    I want to create a new iTunes from an ipod content library.  How can I do this?

  • battery or solar powered iphone 6?

    I have an iPhone 6 and would like to know if I can safely power favorite free this device using a powered solar panel or an external battery such as those like below. I'm having a bit of time figure this out on my own and do not want to try it unless

  • Portege R500 on Vista screen rotation

    Hello I have a Portege R500. I installed WinXP on it as soon as it happened what do not have experience with Vista.I used the software iRotate to rotate my screen on the external display office. Later, I installed Windows Vista Enterprise but utlitie

  • Outlook Express jpg attachments.

    Outlook Express will send jpg attachments, but the receiver cannot see them and there is no indication that there is an attachment.  How can I reinstall Outlook Express, or is there a setting in IE8.0 I need to change? Monyocky

  • My battery is set up charges to 80%. How to change to a 100% load?

    My battery is set up charges to 80%. How to change to a 100% load? I have a samsung Q320 laptop Thank you!