Using sequence in different schemas

Hi all,
If i have a sequence testSeq created in schema A, and an insert statement is used in schema B,is it possible to include testSeq.nextVal in the insert statement of schema B?

hi,
see this
SQL> conn user1/user1@XE
Connected.
SQL> create sequence empno_seq
  2  minvalue 1
  3  maxvalue 100
  4  increment by 1
  5  nocycle
  6  nocache
  7  noorder;
Sequence created.
SQL> grant select on empno_seq to user2;
Grant succeeded.
SQL> conn user2/user2@XE
Connected.
SQL> select user1.empno_seq.nextval from dual;
   NEXTVAL
         1
SQL> /
   NEXTVAL
         2
SQL> /
   NEXTVAL
         3
SQL> /
   NEXTVAL
         4
SQL> conn user1/user1@Xe
Connected.
SQL> ;
  1* select user1.empno_seq.nextval from dual
SQL> /
   NEXTVAL
         5
SQL> /
   NEXTVAL
         6
SQL> /
   NEXTVAL
         7
SQL> /
   NEXTVAL
         8
It can be used in    by having  required privileges .Thanks,
Edited by: prakash on Feb 28, 2012 5:11 AM

Similar Messages

  • Using sequence in diff schema (OWB 10g R1)

    I am trying to use a sequence belonging to instance A schema 1...in a mapping whose objects (source, target tables) are in instance B schema 2.
    How do i do this in OWB ?
    I imported the sequence from the schema 1 into the mapping using a DBLINK...betn the 2 schemas. i did not deploy the sequence using deployment mgr into target schema. I executed the mapping after deploying other objects...and I am getting an error: sequence doesn't exist.
    i even stated the schema and the particular db link name in the configuration of the particular mapping before executing.
    i am trying to run the following SQL statement (it inserts records appropriately in TOAD) using OWB....but am unable to generate a mapping in OWB with the @CDW.WORLD. That could be the potential problem.
    INSERT INTO TEST_TARGET.TEST_TAB_VW (ATTRIBUTE, VALUE,PROFIT_CENTER,PC_ID)
    VALUES ('TESTING','VAL',300098210,[email protected])
    Your guidance will be invaluable.
    Thank you all.
    Message was edited by:
    fire_fighting

    Urghh,
    developing and not being allowed to create a sequence. You have a tough task.
    I can think of two ways to do this. But I can not test it myself, sorry.
    First, create a source module. One in wich you normally only have source tables and views. Let this point to the database/schema where you have the sequence. with a dblink. Import the defenition of your sequence. Use your sequence in a mapping you make in a dwh module. If you generate the mapping, it should be with the dblink information. Just as it would generate the connection for a source table or view.
    If this does not work. The dirty way is to make the sequence in the dwh module and just use it in your mapping. After deployment of your mapping, edit the mapping source. It is just plain pl/sql. Find every occurence of the sequence and replace it with one on the remote server. Perhaps you can make a macro for it.
    There are many good reasons why you don't want to use post-generation-steps. Maintenance, documentation, error-prone etc.
    But it works. :-)
    Hope this helps.
    Maarten Vinkhuyzen

  • Export sequence from once schema to another using dbms_datapump

    Hello,
    Can anybody help me how to export only sequences from one schema to another using dbms_datapump or using any other packages.
    I cannot use the expdp/impdp from command prompt.
    Thanks.

    Hello Richard,
    No luck yet, it's new one now.
    declare
    l_dp_handle NUMBER;
    v_job_state varchar2(4000);
    l_last_job_state VARCHAR2(30) := 'UNDEFINED';
    l_job_state VARCHAR2(30) := 'UNDEFINED';
    l_sts KU$_STATUS;
    v_logs ku$_LogEntry;
    v_row PLS_INTEGER;
    BEGIN
    dbms_output.put_line('get_sequence - Started');
    l_dp_handle := DBMS_DATAPUMP.open(operation => 'IMPORT',
    job_mode => 'SCHEMA',
    remote_link => 'PSUP_DATA',
    version => 'LATEST');
    dbms_output.put_line('get_sequence - get handle :'||l_dp_handle);
    DBMS_DATAPUMP.add_file(handle => l_dp_handle,
    filename => 'test.log',
    directory => 'DMPDIR',
    filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE); dbms_output.put_line('get_sequence - add file');
    DBMS_DATAPUMP.METADATA_FILTER(l_dp_handle, 'SCHEMA_LIST', '''PSUP_DATA'''); dbms_output.put_line('get_sequence - metadata filer1');
    DBMS_DATAPUMP.METADATA_FILTER(l_dp_handle,
    'INCLUDE_PATH_EXPR',
    'IN (''SEQUENCE'')'); dbms_output.put_line('get_sequence - metadata filer2');
    DBMS_DATAPUMP.METADATA_REMAP(l_dp_handle,
    'REMAP_SCHEMA',
    'PSUP_DATA',
    'IRIS_DATA'); dbms_output.put_line('get_sequence - metadata remap');
    DBMS_DATAPUMP.start_job(l_dp_handle); dbms_output.put_line('get_sequence - starting job');
    DBMS_DATAPUMP.WAIT_FOR_JOB(l_dp_handle, v_job_state);
    dbms_output.put_line('get_sequence - completed');
    exception
    WHEN OTHERS THEN
    dbms_datapump.get_status(NULL, 8, 0, v_job_state, l_sts);
    v_logs := l_sts.error;
    v_row := v_logs.FIRST;
    LOOP
    EXIT WHEN v_row IS NULL;
    dbms_output.put_line('logLineNumber=' || v_logs(v_row).logLineNumber);
    dbms_output.put_line('errorNumber=' || v_logs(v_row).errorNumber);
    dbms_output.put_line('LogText=' || v_logs(v_row).LogText);
    v_row := v_logs.NEXT(v_row);
    END LOOP;
    RAISE;
    end;
    get_sequence - Started
    get_sequence - get handle :58
    get_sequence - add file
    declare
    ERROR at line 1:
    ORA-31623: a job is not attached to this session via the specified handle
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 2772
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3886
    ORA-06512: at line 43
    ORA-39001: invalid argument value
    I go ogled some of adive i could see is grant create table to user, but my user is having DBA role as well.
    Please help.

  • Different Schemas in different environments for same tables used in a Universe

    Hi,
    I have a Universe in Development where I have tables pointed to a schema (DW) in DEV but in TEST/INT I have the same tables under a different schema (TESTDW). So when I promote the Universe & reports from DEV to TEST, I will be getting errors as the schema is incorrect. So we need to find a way so that we can define the schema globally instead of having it at the individual table.
    I know we can repoint the schemas, etc but i need to avoid extra work in other environments.
    Known Solutions: Promote the reports to TEST, then select all the tables & change the schema by Right Clicking the selected tables and selecting Change Qualifier/Owner.
    One of the few reasons, I don't want to follow this route, because I have lot of derived tables which I need to change it manually by editing the SQL Statement,  &  also If I add new tables or columns again in future & promote them to TEST, then again I have to change the schema.
    Did anyone faced this kind of issue?Is there any other way that we can use like Begin_Sql , etc?
    (FYI, I am using BO4.0 SP5)

    Mark, Thanks a lot for your concern. We actually have same schema name across all 3 environments but there is a huge project going on in my company which is kind of hard to explain, so our team has decided to go ahead with a different names for schemas as 2 different teams will be working on paralelly on these schemas & they will combine them after a year or so. (I know this is not a solution)
    Thanks Swapnil for Synonyms solution. Your solution might have worked, if we were using BO 4.1 SP5 but unfortunately we are using BO 4.0 and in this version I can't view any synonym tables in the universe.

  • Any way to use a single application but point it to different schemas?

    From the searching I have done, it appears that when an end-user runs an application, it can only be associated with a pre-defined schema, which I guess I just need confirmation of. What I was hoping to be able to do was either dynamically change to a different schema at run-time, or create an end-user that is associated with a different schema than the one the application is associated to so the user could use the one application but access a given schema.
    The scenario is that in our production environment, we need to maintain a separate schema for each client we manage data for. But we'd like to maintain one application end users would use but could run against any one of the client schemas. However, it seems that we willneed to make a copy of the application within the production workspace for each client schema that would be the owner schema if I understand how this works. Thus, if we have 7 different schemas we would have to have 7 copies of the application, one associated with each application.
    Thanks in advance!
    Monte Malenke

    Thanks Scott for quick response.
    We will go with different workspace for each schema.
    Just to give you quick background of my requirement. We have a 3 oracle E-Business versions (11.5.8, 11.5.9 and R12 in future) and APEX installed on another 11g database. We don't want to installed APEX on EBS database because of DB patching issues, our EBS 11i database version is 9i DB, future oracle EBS supoort and at the same time we want to use APEX 3.1.2 with 11g. We want use APEX for custom EBS Web UI development.
    We are planning to create separate schema on APEX database for each EBS instance and DB link which points to EBS database. Under APEX schema we are planning to create a view (on our custom table which are same across all EBS instances) using DB link under each schema.
    We will develop APEX application under one of the workspace and they deploy to other workspaces. We have also looked into creating APEX pages based on pl/sql procedure and we can do dynamic sql to query data from EBS instances. But its lots of code (create pl/sql api for every table) and we can not take a advantages of some of the APEX build-in wizard like master-detail, APEX record locking etc
    Based on your APEX experience; Do you think this the way we should go? OR Is there any better way?.
    Thanks in advance
    RK

  • DB2 to Oracle conversion using SQL Developer Migration Wizard - different schemas

    I am performing a conversion between DB2  to Oracle 11 XE, using the SQL Developer Migration Wizard. Specifically I am trying to migrate the DB2User schema over to Oracle.
    Using the migration wizard, when I pick the Oracle target connection to be the same schema ( DB2User schema ) the migration is successful and all data is converted.
    However if I pick a different Oracle target connection ( say OracleUser ) , I run into issues.
    Firstly , the table schema is not created. When I check the project output directory, the .out file has the following errors:
       CREATE USER DB2User IDENTIFIED BY DB2User DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP
            SQL Error: ORA-01031: insufficient privileges
            01031. 00000 -  "insufficient privileges"
        connect DB2User/DB2User
        Error report:
        Connection Failed
        Commit
        Connection created by CONNECT script command disconnected
    I worked around this by manually executing the .sql in the project output directory using the OracleUser id  in the new DB.
    Then I continue with the migration wizard and perform the Move Data step.
    Now - the message appears as succuessful, however, when I review the Migrationlog.xml file, i see errors as follows:
    <level>SEVERE</level>
      <class>oracle.dbtools.migration.workbench.core.logging.MigrationLogUtil</class>
      <message>Failed to disable constraints: Data Move</message>
      <key>DataMove.DISABLE_CONSTRAINTS_FAILED</key>
      <catalog>&lt;null&gt;</catalog>
      <param>Data Move</param>
      <param>oracle.dbtools.migration.workbench.core.logging.LogInfo@753f827a</param>
      <exception>
        <message>java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist</message>
      <level>WARNING</level>
      <class>oracle.dbtools.migration.datamove.online.TriggerHandler</class>
      <message>ORA-01031: insufficient privileges
    </message>
    I think what is happening is that the wizard is attempting to perform the 'move data' process using the DB2User id.
    How do I tell the wizard that the target schema is different than my source schema.
    My requirement is that I need to be able to migrate the DB2User schema to different schemas in the same Oracle database
    ( since we will have multiple test environments under the same database ) .
    Thanks in advance .
    K.

    Perhaps the following from the SQL Developer documentation is helpful for you:
    Command-Line Interface for Migration
    As an alternative to using the SQL Developer graphical interface for migration operations, you can use the migration batch file (Windows) or shell script (Linux) on the operating system command line. These files are located in the sqldeveloper\sqldeveloper\bin folder or sqldeveloper/sqldeveloper/bin directory under the location where you installed SQL Developer.
    migration.bat or migration.sh accepts these commands: capture, convert, datamove, delcaptured, delconn, delconverted, driver, generate, guide, help, idmap, info, init, lscaptured, lsconn, lsconverted, mkconn, qm, runsql, and scan. For information about the syntax and options, start by running migration without any parameters at the system command prompt. For example:
    C:\Program Files\sqldeveloper\sqldeveloper\bin>migration
    You can use the -help option for information about one or more actions. For the most detailed information, including some examples, use the -help=guide option. For example:
    C:\Program Files\sqldeveloper\sqldeveloper\bin>migration -help=guide
    Regards
    Wolfgang

  • Using different schemas

    Is there some easy way of switching between two database schemas?
    In the .jdo metadata files we have table references like this:
    <schema>.<table>
    Let's say that we for some reason have to change the name of
    the schema or have to execute the JDO code against different
    schemas. In these situations, we don't want to change the
    metadata files. Is there some property with a "default schema"
    or something similar? I tried to use the SchemaName property,
    but it didn't help.
    Thanks,
    Joakim Bissmark

    Joakim-
    The SchemaName property is meant to do that. Otherwise, if your driver
    allows you to choose the schema based on a Driver property, could can
    use the com.solarmetric.kodo.ConnectionProperties property to configure
    the Connection (see the docs on this property for more details).
    If this does not help, can you provide more information about your
    database to us? The term "schema" means different things to different
    databases.
    In article <[email protected]>, Joakim Bissmark wrote:
    Is there some easy way of switching between two database schemas?
    In the .jdo metadata files we have table references like this:
    <schema>.<table>
    Let's say that we for some reason have to change the name of
    the schema or have to execute the JDO code against different
    schemas. In these situations, we don't want to change the
    metadata files. Is there some property with a "default schema"
    or something similar? I tried to use the SchemaName property,
    but it didn't help.
    Thanks,
    Joakim Bissmark
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • How can I use two sequences w/ different frame rates

    I shot wedding (on Sony Z5) initially (1st tape) in DV widescreen (29.97/ 30 fps) but tapes 2, 3 & 4 were shot 1080p24 fps  Big mistake; now obvious.
    Edited all in FCP 6. On trying to cut & paste sequences together I get " cannot nest sequences with different editing timebases".
    I have 23 min.intro/ ceremony sequence as stand alone QT mov now. How can I best convert that and/or merge it w/ the rest ( 62 min. 24 fps  sequences), or perform other action to unite the diff  frame rates into one, w/ best looking quality for the DVD/ bride & groom? Trying to beat Xmas deadline...
    Thanks in advance! Happy Holidays to all.
    3 Ghz Intel Core 2 Duo / 8 GB / OS 10.6.8  FCP 6.0.6

    I went back and forth on this.
    Ordinarily, I'd conform to the format that the majority of the footage was shot in. But if you're going to DVD, and it's going to be compressed to 480 anyway, then why not down convert the 1080 footage to 480?.  At the same time, I would imagine re-timing the 24 (23.98?) to 29.97 would look reasonably consistent with the 29.97 SD.
    This could be done in FCP, but I think Compressor will produce a better result. The adjustments you need are in the Settings menu in the Encoder (with Audio set to pass through), Geometry (720x480 16:9 Anamorphic), and Frame Controls (Resize Filter set to Best).
    This will not be a short encode, so I would first test a short section to double check your settings and sound sync are right, and to compare against the quality of tape 1.
    Good luck.
    Russ

  • HTML DB application using table in a different schema

    I need to create a new HTML DB application. The table is in a different schema than mine. The DBA granted me rights to see it and I can see it from iSQL. HTML DB does not give the alternative of selecting this table.

    This thread covers your issue.
    New to HTML DB, have questions about service admin and schemas
    Ask your DBA to add workspace to schema mapping.
    Sergio

  • How to change all fk constraints in schema to refer to different schema

    Hi,
    We wish to change all the fk constraints which point to tables on one schema to same table names but owned by a different schema.
    Is this possible?
    Thinking of query user_constraints
    select *
    from user_constraints r
    where r.constraint_type = 'R'
    and r.r_owner = 'REF'
    can put this inside loop but can you modify fk constriant to refer to table owned by different schema
    11.2.0.3
    Don't really want to need to drop and recreate.
    Thanks
    Edited by: user5716448 on 06-Apr-2012 04:26

    Yes. You need to drop the constraint and recreate it using the clause 'new_schema.objct_name' in the constraint creation statement.
    For example, if you want to change the constraint cons_1 to point to some column col_1 in schema sch_2 then the sequence of statements will be like,
    ALTER TABLE TAB_1 DROP CONSTRAINT CONS_1;
    ALTER TABLE TAB_1 ADD CONSTRAINT CONS_1 FOREIGN KEY COL_1 REFERENCES SCH_2.TAB_1(COL_1);
    Remember, you have to have all the privileges required to use/reference the table in schema_2.

  • Sequence number different in DB than from assignSequenceNumber()

    I am using TopLink 10.1.3 DP4 (I think - inside JDev build 3565). I am attempting to use a sequence in a schema that I DO NOT OWN - I cannot make modifications tot he database sequence because there are other applications in place running against it.
    The database sequence is in a 10g database, with an interval of 1 and a cache of 20.
    My object uses the value of the sequence as the sole element of its primary key. I am creating a new object, registering it with a UnitOfWork using registerNewObject(obj). It seems that this does not make a clone, since the object returned by this method is the same identity as the object passed in.
    My project sequencing policy is set as follows:
    <project-sequencing-policy>
    <sequencing-policy>
    <preallocation-size>1</preallocation-size>
    <sequencing-type>Use native sequencing</sequencing-type>
    <name-field-handle>
    <field-handle/>
    </name-field-handle>
    <counter-field-handle>
    <field-handle/>
    </counter-field-handle>
    <sequencing-policy-table></sequencing-policy-table>
    </sequencing-policy>
    </project-sequencing-policy>
    Platform is 10g
    <platform-name>Oracle10g</platform-name>
    The sequence is accessed through a synonym (since JDev couldn't seem to reference a sequence in a different schema from a user's login).
    <sequence-number-name>EVENT_SEQ_SYN</sequence-number-name>
    <uses-sequencing>true</uses-sequencing>
    When I commit my new object, I can see the insert statements in the log claiming a value of 'x' for the primary key. The row in the database actually has a primary key of 'y', where 'x = y - preallocation size' and 'y = sequence last number - preallocation size'. I think I would get the right number if I could set the preallocation size to 0 (performance problems understood) but TopLink chokes on this at run-time.
    Is this problem familiar to anyone?
    Failing using native sequencing, I tried to write custom SQL for the insert statement, but I couldn't find any decent examples anywere on how to do that. I found in a deep google search an example that showed you could use hash (#) to reference the value of a property, but what if the value that needs to be inserted in the database is held in an indirect referenced object? For example, if I was trying to write an insert sql for a Pet object with an indirect reference (valueHolder) to its owner, and I needed to put the owner id in the row - how would I write that insert statement in the 'custom sql' pane in workbench?
    Thanks for your help.
    Dave

    Very strange case.
    I tried to reproduce it using TopLink Employee example - and couldn't.
    Here's the code:
        //  to get debug info
        session.setLogLevel(SessionLog.ALL);
        session.login();
        UnitOfWork uow = session.acquireUnitOfWork();
        Employee emp = new Employee();
        emp.setFirstName("sequencingTest");
        uow.registerNewObject(emp);
        uow.assignSequenceNumber(emp);
        uow.commit();
        System.out.println("firstName = "+emp.getFirstName() +"; id="+ emp.getId());And here's the log:
    [TopLink Info]: 2006.01.26 04:49:05.734--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--TopLink, version: Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060116)
    [TopLink Config]: 2006.01.26 04:49:06.171--DatabaseSessionImpl(18)--Connection(19)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
         platform=>Oracle9Platform
         user name=> "test"
         datasource URL=> "jdbc:oracle:thin:@localhost:1521:orcl"
    [TopLink Config]: 2006.01.26 04:49:10.140--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:orcl
         User: TEST
         Database: Oracle Version: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    With the OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
         Driver: Oracle JDBC driver Version: 10.1.0.4.0
    [TopLink Finest]: 2006.01.26 04:49:10.625--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequencing connected, state is Preallocation_NoTransaction_State
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence PROJ_SEQ: preallocation size 1
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence ADDRESS_SEQ: preallocation size 1
    [TopLink Finest]: 2006.01.26 04:49:10.718--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequence EMP_SEQ: preallocation size 1
    [TopLink Info]: 2006.01.26 04:49:11.453--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])-- login successful
    [TopLink Finer]: 2006.01.26 04:49:11.703--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--acquire unit of work: 48
    [TopLink Finest]: 2006.01.26 04:49:11.703--UnitOfWork(48)--Thread(Thread[main,5,main])--Register the new container bean Employee: sequencingTest
    [TopLink Finest]: 2006.01.26 04:49:11.734--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--Execute query ValueReadQuery()
    [TopLink Fine]: 2006.01.26 04:49:11.750--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--SELECT EMP_SEQ.NEXTVAL FROM DUAL
    [TopLink Finest]: 2006.01.26 04:49:12.328--DatabaseSessionImpl(18)--Thread(Thread[main,5,main])--sequencing preallocation for EMP_SEQ: objects: 1 , first: 3,469, last: 3,469
    [TopLink Finest]: 2006.01.26 04:49:12.328--UnitOfWork(48)--Thread(Thread[main,5,main])--assign sequence to the object (3,469 -> Employee: sequencingTest )
    [TopLink Finer]: 2006.01.26 04:49:12.328--UnitOfWork(48)--Thread(Thread[main,5,main])--begin unit of work commit
    [TopLink Finer]: 2006.01.26 04:49:12.421--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--begin transaction
    [TopLink Finest]: 2006.01.26 04:49:12.437--UnitOfWork(48)--Thread(Thread[main,5,main])--Execute query InsertObjectQuery(Employee: sequencingTest )
    [TopLink Finest]: 2006.01.26 04:49:12.625--UnitOfWork(48)--Thread(Thread[main,5,main])--Assign return row DatabaseRecord(
         EMPLOYEE.VERSION => 1)
    [TopLink Fine]: 2006.01.26 04:49:12.625--UnitOfWork(48)--Connection(39)--Thread(Thread[main,5,main])--INSERT INTO EMPLOYEE (EMP_ID, L_NAME, F_NAME, GENDER, END_DATE, START_DATE, MANAGER_ID, START_TIME, END_TIME, ADDR_ID, VERSION) VALUES (3469, NULL, 'sequencingTest', NULL, NULL, NULL, NULL, {t '09:00:00'}, {t '17:00:00'}, NULL, 1)
    [TopLink Fine]: 2006.01.26 04:49:12.640--UnitOfWork(48)--Connection(39)--Thread(Thread[main,5,main])--INSERT INTO SALARY (SALARY, EMP_ID) VALUES (0, 3469)
    [TopLink Finer]: 2006.01.26 04:49:12.781--DatabaseSessionImpl(18)--Connection(39)--Thread(Thread[main,5,main])--commit transaction
    [TopLink Finer]: 2006.01.26 04:49:12.796--UnitOfWork(48)--Thread(Thread[main,5,main])--end unit of work commit
    [TopLink Finer]: 2006.01.26 04:49:12.796--UnitOfWork(48)--Thread(Thread[main,5,main])--release unit of work
    firstName = sequencingTest; id=3469
    If I understood correctly, the problem is x showing up in insert as a value to be assigned to PK and y actually inserted into the db. If that's the case could there be a BeforeInsert trigger on the table? To test try inserting through jdbc using concrete pk value.

  • JDBC Lookup - Import table data from a different schema in same DB

    Hi XI Experts,
    We are facing an issue while importing a Database table into the external definition in PI 7.1.
    The details are as below:
    I have configured user 'A' in PI communication channel to access the database. But the table that I want to access is present in schema "B". Due to this, I am unable to view the table that I have to import in the list available.
    In other words, I am trying to access a table present in a different schema in the same database. Please note that my user has been given all the required permissions to access different schema. Even then, I am unable to access the table in different schema.
    Kindly provide your valuable suggestions as to how I can import table which is present in another schema but in the same Database.
    Regards,
    Subbu

    If you are using PI 7.1, then you can do JDBC Lookup to import JDBC meta data (table structures from DB). Configure a jdbc receiver communication channel where you specify username and password which has permission to access schema A and Schema B of database. Specify database name in the connection string. Then you might have access to import both schema.
    Please refer these links
    SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups
    How to use JDBC Lookup in PI 7.1 ?

  • Accessing tables from different schema in CDS and AMDP

    Hi All,
    We are working on a HANA system which has several schema replicated from SAP R/3/Non SAP systems. We have BW 7.4 SP9 deployed on the same system and accessing the HANA views using latest BW virtual objects such as Open ODS , Composite providers etc.
    We are also using the BW system for few ABAP based data processing developments. We are currently accessing HANA views in ABAP programs by creating dictionary views based on external HANA views.
    We would like to however use recent possibilities of CDS and AMDP for better life cycle management of ABAP based solutions. The open SAP course on this subject was of very good help. Thanks a lot "open SAP team" for that. I would however have few open questions,
    As I understand AMDP gives us full flexibility of writing sql procedures within ABAP development environment, but can we access tables from different schema into AMDP code. If yes, then sample code would help.
    If the answer of first question is yes, then how do we manage transports between development and production systems where the schema names would be different. Currently in open HANA developments, such transport is manged using Schema mapping.
    Can I also use different schema tables in CDS views.
    We are updating few tables in ABAP dictionary after applying processing logic in ABAP program as detailed in step 1. With the new approach using AMDP, can we directly update database schema tables which will give us an optimization advantage.
    New ABAP HANA program interfaces are quite promising and we would like to use them to optimize many data intensive applications.
    Thanks & Regards,
    Anil

    Hi Anil,
    I can only answer 1. and 2. (and would be interested into 3. as well):
    1.
    Yes you can access tables from a different schema and also HANA views. In this case no 'using' is needed.
    Examples:
        RESULT = SELECT
        FROM
              "SAP_ECC"."T441V" AS t,
              "_SYS_BIC"."tmp.package/AFPO" AS a.
        WHERE ...
    2. In this case, if you need schema mapping: You could use HANA (projection) views which just forward to a different schema, also see example.
    Best regards,
    Christoph

  • Can multiple APEX application use the same parsing schema?

    Hi,
    I have 4.2 APEX thru pl/sql Gatewat, 11gr2 DB and using theme 24.
    Due to the APEX limitation for version control I would be splitting 1 big ERP applications into 24 different APEX applications and each application would be considered as 1 unit for version control.
    I have about 800 tables and I would assume that all of these would need to be stored in 1 schema since a lot of these table are linked thru FK.
    Can I have multiple APEX APPS using the same parsing schema? or is there a better way to do this?
    Thanks in advance!

    Hi,
    Multiple applications can have same (one) parsing schema.
    You can test that on e.g. apex.oracle.com, where normally you have only one schema and you create multiple applications and all use that same schema.
    Regards,
    Jari
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai
    Edited by: jarola on Jan 28, 2013 7:15 PM

  • Moving Subpartitions to a duplicate table in a different schema.

    +NOTE: I asked this question on the PL/SQL and SQL forum, but have moved it here as I think it's more appropriate to this forum. I've placed a pointer to this post on the original post.+
    Hello Ladies and Gentlemen.
    We're currently involved in an exercise at my workplace where we are in the process of attempting to logically organise our data by global region. For information, our production database is currently at version 10.2.0.3 and will shortly be upgraded to 10.2.0.5.
    At the moment, all our data 'lives' in the same schema. We are in the process of producing a proof of concept to migrate this data to identically structured (and named) tables in separate database schemas; each schema to represent a global region.
    In our current schema, our data is range-partitioned on date, and then list-partitioned on a column named OFFICE. I want to move the OFFICE subpartitions from one schema into an identically named and structured table in a new schema. The tablespace will remain the same for both identically-named tables across both schemas.
    Do any of you have an opinion on the best way to do this? Ideally in the new schema, I'd like to create each new table as an empty table with the appropriate range and list partitions defined. I have been doing some testing in our development environment with the EXCHANGE PARTITION statement, but this requires the destination table to be non-partitioned.
    I just wondered if, for partition migration across schemas with the table name and tablespace remaining constant, there is an official "best practice" method of accomplishing such a subpartition move neatly, quickly and elegantly?
    Any helpful replies welcome.
    Cheers.
    James

    You CAN exchange a subpartition into another table using a "temporary" (staging) table as an intermediary.
    See :
    SQL> drop table part_subpart purge;
    Table dropped.
    SQL> drop table NEW_part_subpart purge;
    Table dropped.
    SQL> drop table STG_part_subpart purge;
    Table dropped.
    SQL>
    SQL> create table part_subpart(col_1  number not null, col_2 varchar2(30))
      2  partition by range (col_1) subpartition by list (col_2)
      3  (
      4  partition p_1 values less than (10) (subpartition p_1_s_1 values ('A'), subpartition p_1_s_2 values ('B'), subpartition p_1_s_3 values ('C'))
      5  ,
      6  partition p_2 values less than (20) (subpartition p_2_s_1 values ('A'), subpartition p_2_s_2 values ('B'), subpartition p_2_s_3 values ('C'))
      7  )
      8  /
    Table created.
    SQL>
    SQL> create index part_subpart_ndx on part_subpart(col_1) local;
    Index created.
    SQL>
    SQL>
    SQL> insert into part_subpart values (1,'A');
    1 row created.
    SQL> insert into part_subpart values (2,'A');
    1 row created.
    SQL> insert into part_subpart values (2,'B');
    1 row created.
    SQL> insert into part_subpart values (2,'B');
    1 row created.
    SQL> insert into part_subpart values (2,'C');
    1 row created.
    SQL> insert into part_subpart values (11,'A');
    1 row created.
    SQL> insert into part_subpart values (11,'C');
    1 row created.
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> create table NEW_part_subpart(col_1  number not null, col_2 varchar2(30))
      2  partition by range (col_1) subpartition by list (col_2)
      3  (
      4  partition n_p_1 values less than (10) (subpartition n_p_1_s_1 values ('A'), subpartition n_p_1_s_2 values ('B'), subpartition n_p_1_s_3 values ('C'))
      5  ,
      6  partition n_p_2 values less than (20) (subpartition n_p_2_s_1 values ('A'), subpartition n_p_2_s_2 values ('B'), subpartition n_p_2_s_3 values ('C'))
      7  )
      8  /
    Table created.
    SQL>
    SQL> create table STG_part_subpart(col_1  number not null, col_2 varchar2(30))
      2  /
    Table created.
    SQL>
    SQL> -- ensure that the Staging table is empty
    SQL> truncate table STG_part_subpart;
    Table truncated.
    SQL> -- exchanging a subpart out of part_subpart
    SQL> alter table part_subpart exchange subpartition
      2  p_2_s_1 with table STG_part_subpart;
    Table altered.
    SQL> -- exchanging the subpart into NEW_part_subpart
    SQL> alter table NEW_part_subpart exchange subpartition
      2  n_p_2_s_1 with table STG_part_subpart;
    Table altered.
    SQL>
    SQL>
    SQL> select * from NEW_part_subpart subpartition (n_p_2_s_1);
         COL_1 COL_2
            11 A
    SQL>
    SQL> select * from part_subpart subpartition (p_2_s_1);
    no rows selected
    SQL>I have exchanged subpartition p_2_s_1 out of the table part_subpart into the table NEW_part_subpart -- even with a different name for the subpartition (n_p_2_s_1) if so desired.
    NOTE : Since your source and target tables are in different schemas, you will have to move (or copy) the staging table STG_part_subpart from the first schema to the second schema after the first "exchange subpartition" is done. You will have to do this for every subpartition to be exchanged.
    Hemant K Chitale
    Edited by: Hemant K Chitale on Apr 4, 2011 10:19 AM
    Added clarification for cross-schema exchange.

Maybe you are looking for

  • Ipod touch 4 stuck on a blinking apple logo while updating to iOS 6.1.3

    The update had already downloaded on my device. However when it was installing it went into a loop of blinking apple logo. Is the install happenng or is it just stuck. How to fix this. Pl help.

  • Report to List Incoming Payments and related Invoices

    Hi Experts, I would like a query which lists Incoming Payments and also the related Invoices which were paid. Is there a table which links together the ORCT and OINV tables? Thanks Greig

  • Open a New Browser menu button

    When I click the "open FlashPaper document in a new browser window" button on the FlashPaper menu bar, a new window opens showing a bunch of nonsense. The FlashPaper document does not appear. This does not happen when I am viewing the pages locally.

  • How do I get rid of file icons in launchpad? help

    hi, just had a link up with a lexmark rep and he has left loads of file icons on my laptop in launchpad. tried the wiggle effect but that doesnt work. how do I delete these please?

  • Query: Beginner's Question: Notification on Approval

    Hi All, Iam new to workflow. As a subordinate, I have created an absence notification. With superior's loginid, I have approved the same. But no notification message is sent to the subordinate's inbox that the absence notif. is approved. But I see th