Selection from Another schema by default without schema name qualifier.

Hi
Oracle10g release 2, LinuxOS
i want my schema (User_1) to always select,insert, update, delete the objects from another schema (User_2) without passing full schema qualifier every time whenever i don't pass any schema name explicitly.
i.e. if i pass the following guerry
select * from table_a;
the table of user User_2.table_a (User_2.table_a) will be queried by default instead of table (User_1.table_a)
and the same implementation is also required in Functions , procedures, sequences etc.
Wishes

Three relatively easy options
1) Create private synonyms in User_1's schema for each object in User_2's schema, i.e.
CREATE SYNONYM table_a
   FOR user_2.table_a2) Create public synonyms for each object in User_2's schema. This will make it possible for all users to query user_2's objects without specifying the schema name
CREATE PUBLIC SYNONYM table_a
   FOR user_2.table_a3) Change the current schema for the session (potentially in a login trigger)
ALTER SESSION SET current_schema = USER_2There are other options that are a bit more complicated like using enterprise users with shared schemas. But most people are perfectly happy with one of these three.
Justin

Similar Messages

  • How to populate a table based on a row selection from another table.

    Hi, i just started to use ADF BC and Faces. Could some one help me or point me a solution on the following scenario .
    By using a search component , a table is being displayed as a search result. If i select any row in the resulted table , i need to populate an another table at the bottom of the same page from another view. These two tables are related by primary key . May i know how to populate a table based on a row selection from another table. Thanks
    ganesh

    I understand your requirement and the tutorial doesn't talk about Association between the views so that you can create a Master-Detail or in DB parlance, a Parent-Child relationship.
    I will assume that we are dealing with two entities here: Department and Employees where a particular Department has many Employees and hence a Parent-Child relationship.
    Firstly, you need to create an Association between the two Entities - Department and Employees. You can do that by right clicking on the model's entity and then associating the two entities with the appropriate key say, DepartmentId.
    Once you have done that, you need to link the two entities in the View section with this Association that you created. Then go to AppModule and make sure that in the Available View Objects: 'EmployeesView' appears under 'DepartmentView' as "EmployeesView via <link you created>". Shuttle the 'DepartmentView' to the right, Data Model and then shuttle
    "EmployeesView via <link you created>" to the right, Data Model under 'DepartmentView'.
    This will then be reflected in your Data Controls. After that, you simply would have to drag this View into your page as a Master-Detail form...and then when you run this page, any row selected in the Master table, would display the data in the Detail table.
    Also, refer to this link: [Master-Detail|http://baigsorcl.blogspot.com/2010/03/creating-master-detail-form-in-adf.html]
    Hope this helps.

  • Selecting from another schema

    If I want to select table from another schema, I have to type
    select * from [username].table_name.
    What can I do inorder not to write shema name all the time.
    for instance:
    instead of writing
    select * from [username].table_name.
    select * from table_name.

    create synonym for the object in other schema:
    create synonym <syn-name> for schema.tablename;
    then use syn-name in place of schema.tablename in ur query
    like
    select * from syn-name;

  • Setting current row of a view based on row selected from another view.

    Hi,
    We have two Views V1 and V2. Both views are based on the same tables except that V1 is based on multiple tables. In our application we are showing a read only table which is based on V1. The user can select a particular record for edit. But the edit page is based on V2 and as a result the first record always shows up for editing even though the user may have selected another record.
    Is there a way we can pass the primary key of the record selected from V1 to V2 and set that record as the current record.
    We have tried setCurrentRowWithKey, but this did not help.
    Regards
    RHY

    Hello,
    post the PK as an URL parameter within the link you open the edit page. Then read this parameter in your page (the page with this link) action class and send it to an ActionBinding:
    JUCtrlActionBinding action = (JUCtrlActionBinding) bc.findCtrlBinding("nameOfBinding");
    ArrayList arrayList= new ArrayList();
    arrayList.add(0,primaryKey);
    action.setParams(arrayList);
    action.doIt();
    In your AppModule create a method nameOfBinding with primaryKey as in parameter
    public void nameOfBinding (Number primaryKey )
    getV2().setWhereClause("PRIMARY_KEY=:0");
    getV2().setWhereClauseParam(0,primaryKey );
    getV2().executeQuery();
    In the AppModule you have to publish this method in "ClientInterface".
    Create an Action binding for this method in your list jsp.
    Hope this helps
    Britta

  • Is there a way to fill a cell with a value based on the selection from another cell?

    For example: If have a drop down menu created for Cell A1 with options (Dog 1, Cat 2, Bird 3). Is there a way to fill cell A2 automatically when I select from the drop down menu.
    So if I selected 'Cat' in A1, cell A2 would automatically input the 2.

    I suggest an extensible method that allows you to add other animals:
    This method adds a small table called "Animal Lookup" that matches names (same as in the pop-up menu) with a value.
    The table on the left uses this table to retrieve the value based on the animal:
    B2=VLOOKUP(A2, Animal Lookup :: A:B, 2, 0)
    select B2 and fill down

  • How do i populate one field based upon a drop down select from another field?

    Here is what I am trying to do:
    Field 1 is a drop down selection list that requires a user to make a mandatory selection which in this case is a list of apartment complexes. What I am trying to accomplish is once that user makes a selection from the drop down list (Field1) that it will populate Field 2 (standard txt) with the corresponding apartment complexes address.
    So I pick Talan Apartments from field 1, it would populate field 2 with Talan Apartments address. I tried messing around with calculation scripts but I'm fighting a loosing battle here. Some help would be greatly appreciated!

    Hi,
    Here is a sample: https://acrobat.com/#d=Hi0ZwVgVB1PWbxc6OJ0z4A where the script in the exit event of the dropdown sets the value of the address object.
    Good luck,
    Niall

  • Update table with select from another table

    Hallo,
    I'd like to update table b with codes from a mapping table a.
    a has:
    town_id, town_code, town_name
    b has town_code, town_id, town_population, town_zip_code,...
    Table a has all the details - town_id, town_code and town_name and acts as the mapping between town_id and town_code
    In table b, town_code is null. I want to update the column b.town_code with town_code from table a where a.town_id = b.town_id.
    How will the update query look like?
    I tried
    UPDATE B SET town_code = (SELECT A.town_code FROM A,B WHERE A.town_id=B.town_id)
    and I get the error 'single-row subquery returns more than one row'
    Will appreciate your assistance

    This is what I did.
    First, I created and populated the TOWN_INFO table:
    CREATE TABLE "TOWN_INFO"
    (     "TOWN_ID" NUMBER,
         "TOWN_CODE" NUMBER,
         "E_MAIL" CHAR(15 BYTE)
    Table Created.
    insert all
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3024,'[email protected]')
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3040,'[email protected]')
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3052,'[email protected]')
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3065,'[email protected]')
    into TOWN_INFO (TOWN_ID, E_MAIL) values (3066,'[email protected]')
    select * from dual
    5 rows created.
    The following creates and populates the mapping table:
    CREATE TABLE "TOWN_MAPP"
    (     "TOWN_CODE" NUMBER,
         "TOWN_ID" VARCHAR2(255 BYTE),
         "TOWN_NAME" CHAR(6 BYTE)
    insert all
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3024,'1001','TOWN_1')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3040,'1003','TOWN_3')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3052,'1002','TOWN_2')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3065,'1004','TOWN_4')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3066,'1006','TOWN_6')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3088,'1007','TOWN_7')
    into TOWN_MAPP (TOWN_ID,TOWN_CODE, TOWN_NAME) values (3020,'1009','TOWN_9')
    select * from dual
    7 rows created.
    And now the update query:
    UPDATE TOWN_INFO
    SET TOWN_CODE=(SELECT B.TOWN_CODE FROM TOWN_MAPP B, TOWN_INFO C
    WHERE B.TOWN_ID=B.TOWN_ID)
    SET TOWN_CODE=(SELECT B.TOWN_CODE FROM TOWN_MAPP B, TOWN_INFO C
    ERROR at line 2:
    ORA-01427: single-row subquery returns more than one row
    Thanx in advance
    Edited by: user9954260 on Apr 13, 2010 7:40 AM
    Edited by: user9954260 on Apr 13, 2010 7:44 AM

  • How to show value from another Object as Default value from Prompt

    Hi,
       I am creating a web Report with the following filter :
    Enrollment Date FROM :   01/01/2011 12:00:00 AM  (Default 1st day of previous month)
    Enrollment Date TO :     01/02/2010 12:00:00 AM    (Default: 1st day of current month)
    There are values for Enrollment date from 01/01/ 2004 till today but user want to have a default value as in brackets above.
    When I select prompt option for 'Enrollment Date' all the dates (from 01/01/ 2004 till today) are shown as usual. Database is Oracle and I am able to create Objects in Universe that show the default required dates, but not sure how I use them in the prompt. Is there any way or workaround?
    Nanda Kishore.

    If i Understand Correctly you requirement you want to set a default value for date in prompt but user should have the ability to change these values if the want ?
    In order to implement this you can create a Object in Universe with definition
    Date Choice - @prompt('Default or Custom Date','A',{'Default','Custom'},mono,constrained)
    Then use this along with the date prompt in query filter as follows.
          Set Data choice =Default
            Date1= Default Date
            and
            Date2= Default Date
      OR
           Set Date Choice=Custom
            Date1 = Prompt
            and
            Date2= Prompt

  • Select from another table within a select

    Hello all,
    Here is my problem. I am working with thousands of records in each of the tables I am accessing. In the following code it takes about 1min-2min to process this select statement. I get the results I want but the query time is unacceptable. With all of my queries combined it would take over 10 days to complete this code. I would like to cut this time down as much as possible and feel this is the only way to achieve this. I have also tried temp tables to store the rows from the second select statement, no luck. Any input would be greatly appreciated.
    Thanks
    select count(*)
         from first_table
         where id='1'
                   and contract_year='2006'
                   and site_code='00007'
                   and district='00002'
                   and std_id in (select std_id from second_table where attempt = 'Y' and scale ='Y');     

    A few thoughts. First, you could try this...
    SELECT COUNT(*)
    FROM   first_table a,
           second_table b
    WHERE  a.id='1'
    AND    a.contract_year='2006'
    AND    a.site_code='00007'
    AND    a.district='00002'
    AND    a.std_id = b.std_id
    AND    b.attempt = 'F'
    AND    b.scale = 'Y';If you have no indexes, you could try the PARALLEL hint to improve the query. You could CACHE one or both tables to improve performance. Of course, indexes are always a preferred option!. As a final thought, if this is really going to take 10 days, perhaps the procedure(s) you are executing are inherently inefficient. You might want start there first.
    Greg Pike
    http://www.singlequery.com

  • Populate field based on selection from another field?

    I'm using a Data Connection with a SQL query that returns two fields (StNameFull and ADDRKEY). I have a drop-down list called "Address" with the list items dynamically bound to StNameFull, so the user can select the address.
    What I'm trying to do is populate the second field "Key" with the corresponding record, based on the selection made from the drop-down list.
    Is it possible to script this so that when the Address is selected the Key will automatically fill in with the key that matches the address selcted?
    I currently have "Key" as a text field bound to ADDRKEY, but not sure how to have it check what was selected in "Address"
    Thanks so much,
    - Kevin

    Yes it is possible but you will have to write some script to do it. You wil also have to ge the DataConenction to execute a SQL statement. There is a good blog on this topic at this location:
    http://forms.stefcameron.com/2006/09/29/selecting-specific-database-records/
    Paul

  • How to update one lov based on value selected from another lov.

    Hi ,
    I have a form in which I created the 2 LOVs for my event_date field and event_name field each which is stored in one table.
    t I want to update the event_date LOV everytime event_name is selected.
    How can I achieve this.
    Thanks.
    Neeti.

    Hi,
    You can do this using dynamic LOVs. Here are the steps for populating a employee LOV on selecting a department.
    1) Create a dynamic lov say emloyee_lov with a bind variable like this
    select empno,ename from scott.emp
    where deptno = :dept
    2) Create a form on scott.emp.
    3) In the empno field which should be a LOV type of field, associate it with
    the above employee LOV.
    4) Then set the binding(s) for the bind variable(s) defined in the lov by
    selecting the deptno column.
    This would help.
    Thanks,
    Sharmila

  • Transfering music from another ipod to itunes without erasing ipod

    i want to transfer ipod contents to my laptop without erasing the contents of the ipod

    Yes, read this
    http://discussions.apple.com/thread.jspa?threadID=121879

  • ADF Faces - filtering a selectOneChoice after select from another

    Hi,
    I'm new to ADF faces and I've been experimenting with developing applications using Jdeveloper 10.1.3 and ADF faces. I've run into a little problem.
    I have two selectOnceChoice fields on a page (division and dept.) When user selects a Division I would like to filter the dept. But it seems that the value I get when I try to filter when the div changes is the array index not the value of the division. Basically what I've done is set the valueChangeListener to a function on the backing bean for the Div selectOneChoice and set auto submit to true. If I look at the values on the valueChangeEvent they are the indexes not the actual values. I've tried using ExecuteWithParms in the page def and binding to to #{bindings.div.inputValue} but the results are the same the inputValue at this point contains the array pointer not the actual value. as seem by turning on -Djbo.debugoutput=console.
    Does anybody have any suggestions?
    Thanks
    Chris

    Scott - check out Re: How to do? Save-and-Return with ADF Faces and ADF BC, JDev 10.1.3
    John

  • Create a table which has columns from another table in other schema

    Hi All
    I need to create a table which is table driven i.e., the columns of that table need to be inserted from another table in a different schema...Can any one help me with this??

    create table newtab (--column spec here--) as
    Select --columns here-- from otherschema.tablename;max

  • OracleBulkCopy WritetoServer does Select * from TableName , fix it please

    In Odp.Net latest version , whenever OracleBulkCopy.WritetoServer is called. It internally calls "Select * from TableName " to validate the table schema.
    I did some debugging and found that this is called in function GetMetaData() in OracleBulkCopy class .
    Please fix this issue by appending where 1=0 in the select clause so that it does not do a full table scan for every bulk copy insert.
    The whole advantage of OracleBulkcopy performance improvement is lost because of this line.
    When the Destination Table has < 1 lakh records this is not a big issue, but it degrades very badly when the destination table name has million records .
    Please release a patch as soon as possible.

    yes 100% sure, we even captured the trace logs from the Oracle Db end and we saw that "Select * from Tablename" was executed. See the trace below.
    To elaborate on it, I am a .Net Consultant, i even went into the Odp.Net dll code and verified that GetMetaData function is called when WritetoServer is called on a new OracleBulkCopyInstance.
    trace below
    SQL ID: 46dym63c8qhxd
    Plan Hash: 0
    select *
    from
    TABLEX
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.01 0 60 0 0
    Execute 0 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 1 0.01 0.01 0 60 0 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 94
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 0.00 0.00
    SQL ID: 5s2vzq2q78n3w
    Plan Hash: 0
    LOCK TABLE "SCHEMAX"."TABLEX" IN ROW EXCLUSIVE MODE NOWAIT
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.00 0.00 0 0 0 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 94 (recursive depth: 1)
    SQL ID: dbxwyh9wxp32b
    Plan Hash: 0
    LOCK TABLE "SCHEMAX"."TABLEX" PARTITION ("P3") IN EXCLUSIVE MODE
    NOWAIT
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.00 0.00 0 0 0 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 94 (recursive depth: 1)
    SQL ID: 9y27jut66ajz5
    Plan Hash: 0
    INSERT /*+ SYS_DL_CURSOR */ INTO "SCHEMAX"."TABLEX" PARTITION ("P3")
    ("PARTITION_ID","GID","SEGMENT_ID","RID","STATUS",
    "VERIFIC","FILE_ID","RECORD_ID","SUB_REC_ID",
    "S_ID2","FILLER1","FILLER2","FILLER3","FILLER4","FILLER5",
    "FILLER6","FILLER7","FILLER8","FILLER9","FILLER10","FILLER11","FILLER12",
    "FILLER13","FILLER14","FILLER15","FILLER16","FILLER17","FILLER18",
    "FILLER19","FILLER20","FILLER21","FILLER22","FILLER23","FILLER24",
    "FILLER25","FILLER26","FILLER27","FILLER28","FILLER29","FILLER30",
    "ID_BODY","CODE","EXP_DATE","SUB_RECORD_3","OCCUR",
    "PARENT","SEGMENT","ID_VALUE","IS_ID")
    VALUES
    (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
    NULL,NULL,NULL,NULL)
    Edited by: Y2KPRABU on Jul 16, 2012 11:38 PM

Maybe you are looking for

  • Closing the browser window, after the dialog box

    How are you handling the 'NO' scenario ? Moreover are u firing the plug even before popping up the message ? Please check this once.. it might be the cause for it.

  • IPod will not mount!!

    I'm having huge difficulties with my iPod 4g 20 gb. I own one emac (running tiger) and an imac (running jaguar). I hardly ever use my iPod with the imac but i decided to try it out and listen to the iPod straight through the imac speakers while worki

  • I have deleted imovie and emptied my trash by accident and i was wondering if anyone knew how to get it back

    Hi i am alice I have deleted imovie and emptyied my trash by accident and i was wondering if anyone could tell me how to get it back thx alice

  • Cannot connect I-Pad to Router

    I had to reset my I-pad and lost the router connection.  I did not remember the password for my router, so I went in and changed it.  When I go to Settings-Wi-Fi and see the network and type in that new password...it won't let me connect to the route

  • Losing database connections in remote objects

    Hi, I have an interesting problem. I have a couple of remote objects that bear database connections. They are pooled in another remote object and provided by registry on request to the client. However, when I check the connections after a while, all