Create table from another table including constraints

Hi,
Is there a way to create a table from another table including constraints.
CREATE TABLE COPY_EMP
as
SELECT *
FROM EMP
WHERE 1 =2 ;
This creates the table, but the constraints are not copied over.
I was reading about DBMS_REDEFINITION - can that be used for this scenario ?
Thanks!
Anand

>
I tried that, but the constraint names are posing a problem. And unfortunately our constraints are not named in a standard, so am finding it difficult to replace them.
Was just wondering if there were any simpler approach to this.
>
No - there isn't.
You will have to use new names for the constraints. That usually means extracting the DDL and manually changing the constraint names.

Similar Messages

  • Problem with creating site from another computer!

    Hi
    I have WebDB 2.2 and Oracle8i instaled on the same computer. I have a problem to create site from another computer. There is not any process when I try to create site. There is always 0%.
    But I have no problem with creating site on the origin computer.
    Does anybody know something about it?

    I am just not clear what to do once I have made changes and have published the new information.
    You shouldn't have to do anything. iWeb will save the information in the Domain.sites file. You can keep this file in a folder, or even on your desktop and iWeb will launch from a double-click on the file.

  • Copy table including constraints.. Same DB..

    Looking to find a way to copy a table, and to include all constraints over to the new table..
    right now I use..
    create table cust as select * from customers
    How can I amend that statement to include constraints..
    Thanks...

    To answer your question as far as I know it is not possible using CTAS but if you want to create a table only along with the constraints and other information
    search for dbms_metadata package in the oracle reference manual.
    Hope this helps.
    Regards
    Raj
    Edited by: R.Subramanian on Oct 30, 2008 9:26 AM

  • Create table with constraint and index

    If I create a table with constraint key; after that I create an unique index key, I got an error. Please see below.
    Does it mean when I create a table with constraint the unique index are automatically created and I could not create
    index key as I did as below?
    create table test_const(ename varchar2(50) not null,
    key_num number not null,
    descr varchar2(100),
    constraint constraint_test_const unique (ename, key_num));
    create unique index test_const_idx on test_const
    "ENAME","KEY_NUM"
    tablespace tmp_data;
    Error report:
    SQL Error: ORA-01408: such column list already indexed
    *01408. 00000 - "such column list already indexed"*

    Not too hard to check (the answer is yes by the way).
    ME_XE?create table test_const(ename varchar2(50) not null,
    key_num number not null,
    descr varchar2(100),
    constraint constraint_test_const unique (ename, key_num));
      2    3    4 
    Table created.
    Elapsed: 00:00:00.12
    ME_XE?select index_name, index_type
    from user_indexes where table_name = 'TEST_CONST';
      2 
    INDEX_NAME                     INDEX_TYPE
    CONSTRAINT_TEST_CONST          NORMAL
    1 row selected.
    Elapsed: 00:00:00.14
    ME_XE?

  • Creating playlist from another playlist

    So, I have all the latest software etc. Can I tell you what ***** about itunes? Remember when making a playlist you could access other playlists and pluck songs to add to your new playlist? You can't do that anymore. WHY?! Itunes Master, please bring this option back!

    I'm assuming you're referring to Music in iOS, not iTunes on Mac, right?  I'm extremely upset that this feature was removed.  I have 25,000 songs, so I use playlists in iOS to sort them a bit.  No longer having the ability to pull from those playlists to create or modify another has just taken me back 5 years.  I have to create and modify everything from my Mac now, as I did long ago.

  • Creating Contract from another contract

    hi
    is it possible to create a contract from another contract as a reference? Can i use the expired contracts again after changing its validty dates?
    thanks
    maniraj

    Hi
    It is possible to create a contract from another contract in MM.
    Please follow the steps
    1) Go to t code ME31K
    2) Initial screen press Copy document button
    3) Give the reference document no and mention the reference items ( from & to)
    4) Press enter
    Now you can see the items copied from the old contract.
    Hoep it helps.
    Thanks /Karthik
    Edited by: Karthik on Aug 13, 2009 9:27 AM

  • Create cursor from another cursor

    Hello,
    How do I create a cursor from the values of another cursor ?
    For Example,
    cursor c1
    select x, y from table 1;
    cursor c2
    select c1.x, c1.y, table 2.z
    from table 2
    where y := c1.y
    I get errors when I do this way. Can somebody help me out on this.
    Thanks
    Raj

    In this particular example, it's probably easiest to declare a single cursor that contains a join, i.e.
    cursor c1
    SELECT a.x, a.y, b.z
      FROM table1 a,
           table2 b
    WHERE a.y = b.yIf you really want to create the two cursors, though, you have to make sure that the first cursor is visible to the creation statement of the second. For example,
    for c1 in (select x, y from table1)
    loop
      for c2 in (select c1.x, c1.y, b.z from table2 b where b.y = c1.y)
      loop
      end loop;
    end loop;If you need more help, quoting the exact error an providing a snippet of the code you're using would be greatly helpful.
    Justin

  • Create script from another script using PROMPT

    Oracle 11
    Instead of having to link to another database I want to create 2 scripts that are executed from a shell script and run them separately. Script1 run in Database1 would create Script 2 by using PROMPT to create the second script while grabbing a date from database1 to pass into database2. I almost have it but the problem is ... Script2 uses COPY FROM and I have to put a "-" at the end of each line which the PROMPT takes as a literal instead of as part of the output.
    SCRIPT1:
    set pagesize 0
    set trimspool on
    set linesize 2000
    set echo off
    set verify off
    set feedback off
    set sqlblanklines on
    spool /home/michelle/sql_scripts/sl_dtc_copy2.sql
    PROMPT whenever sqlerror exit sql.sqlcode rollback
    PROMPT SET ARRAYSIZE 5000
    PROMPT SET COPYCOMMIT 20
    PROMPT set linesize 4000
    PROMPT
    PROMPT COPY FROM {username}/{pswd}@{DB2}  TO {username}/{pswd}@{DB2}
    PROMPT CREATE SL_DTC_TMP USING SELECT DISTINCT
    PROMPT col1, col2, col3
    PROMPT FROM dual
    PROMPT WHERE veh_data_elements_cd = 'ODO_READ'
    PROMPT and       dh.data_collected_timstm >= 
    select trunc(sysdate)-7 from dual;
    PROMPT and       substr(vdh.vin,10,1) in ('A','B','C','D')
    PROMPT /
    PROMPT spool off
    PROMPT exit
    spool off
    exitSCRIPT2 NOW:
    whenever sqlerror exit sql.sqlcode rollback
    SET ARRAYSIZE 5000
    SET COPYCOMMIT 20
    set linesize 4000
    COPY FROM {username}/{pswd}@{DB2}  TO {username}/{pswd}@{DB2}
    CREATE SL_DTC_TMP USING SELECT DISTINCT
    col1, col2, col3
    FROM dual
    WHERE veh_data_elements_cd = 'ODO_READ'
    and       dh.data_collected_timstm >=
    12-AUG-11
    and       substr(vdh.vin,10,1) in ('A','B','C','D')
    spool off
    exitSCRIPT2 HOW IT NEEDS TO BE:
    --- A [SPACE] AND A [-] at the end of each line
    --- THE DATE NEEDS TO HAVE SINGLE QUOTES AND PREFERABLY AT THE END OF THE PREVIOUS LINE
    whenever sqlerror exit sql.sqlcode rollback
    SET ARRAYSIZE 5000
    SET COPYCOMMIT 20
    set linesize 4000
    COPY FROM {username}/{pswd}@{DB2}  TO {username}/{pswd}@{DB2} -
    CREATE SL_DTC_TMP USING SELECT DISTINCT -
    col1, col2, col3 -
    FROM dual -
    WHERE veh_data_elements_cd = 'ODO_READ' -
    and       dh.data_collected_timstm >= '12-AUG-11' -
    and       substr(vdh.vin,10,1) in ('A','B','C','D')
    spool off
    exitTHANK YOU

    Try
    select 'whenever sqlerror exit sql.sqlcode rollback'                    ||chr(10)||
           'SET ARRAYSIZE 5000'                                             ||chr(10)||
           'SET COPYCOMMIT 20'                                              ||chr(10)||
           'set linesize 4000'                                              ||chr(10)||
           ' '                                                              ||chr(10)||
           'COPY FROM {username}/{pswd}@{DB2}  TO {username}/{pswd}@{DB2} -'||chr(10)||
           'CREATE SL_DTC_TMP USING SELECT DISTINCT -'                      ||chr(10)||
           'col1, col2, col3 -'                                             ||chr(10)||
           'FROM dual -'                                                    ||chr(10)||
           'WHERE veh_data_elements_cd = ''ODO_READ'' -'                    ||chr(10)||
           'and       dh.data_collected_timstm >= ''12-AUG-11'' -'          ||chr(10)||
           'and       substr(vdh.vin,10,1) in (''A'',''B'',''C'',''D'')'
           as Script
    from dual

  • How do I reference a dynamically created MovieClip from another MovieClip?

    Hi,
    I'd be grateful for any pointers to the following problem:
         I'm having trouble referencing dynamically created MovieClips (links in a side panel on a Flash website, created from an XML file) from the current MovieClip (the currently selected link).
         I wish to freeze the the link/MovieClip in its mouseOver state once it has been clicked - this part works. When a new link/MovieClip is clicked on, I wish to release the previously clicked-on link from its mouseOver state, which is what I've so far been unable to do.
         My problem seems to be referencing the previous link/MoveClip. I've used the trace statement trace(MovieClip(this).name) to determine that the MovieClips are named item0, item1, item2 and so on. However, I've been unable thus far to reference the previous clip thus far. I've tried to trace the route to the MovieClip from the stage, and also tried MovieClip(parent).item0.gotoAndStop and lots of other different permutations, but to no avail. It's the fact they seem to be in a container called 'panel' which is defeating me.
         Here's a live version I've uploaded, which might explain the problem better. Click on "UBER UNS" in the top menu bar to get to the page in question. It's the links on the left-hand side (Historie, Unser Team, etc.) which are the problem. You'll see that once they've been clicked on they remain in their mouseOver state.
         This is the code in question on the fla file, which is a file I did not create myself. The parts in black work fine; it's the red parts where the problem lies:
    import flash.display.MovieClip;
    panel.buttonMode = true;
    var lang:uint = 1;
    var url_Link:String=MovieClip(root).program.websiteXML .language[lang].pages.titlePage[MovieClip(root).program.linkPage].texts.pageList.txt[numT XT].@link;
    var urlPage:Number=Number(MovieClip(root).program.webs iteXML.language[lang].pages.titlePage[MovieClip(root).program.linkPage].texts.pageList.tx t[numTXT].@linkPage);
    var request:URLRequest;
    var linkIndex:uint;
    var lastClickedLink:MovieClip;   //This is supposed to store the last link that has been clicked - it doesn't work
    panel.addEventListener(MouseEvent.CLICK, clicLink);
    panel.addEventListener(MouseEvent.ROLL_OVER, mouseOverLink);
    panel.addEventListener(MouseEvent.ROLL_OUT, mouseOutLink);
    function mouseOverLink(event:MouseEvent):void {
          MovieClip(this).gotoAndPlay('s1');
    function mouseOutLink(event:MouseEvent):void {
          if(numTXT !== (linkIndex - 1)/5){         //freezes mouseOver state if this is the link for the current page
               MovieClip(this).gotoAndPlay('s2');
    function clicLink(event:MouseEvent):void {
          var linkpage:uint = MovieClip(root).program.linkPage;
          if (url_Link) {
               request = new URLRequest(url_Link);
               navigateToURL(request);
          } else {
               linkIndex = numTXT * 5 + 1;
               if(linkpage == 1){
                   MovieClip(root).chPages.cont.page_about_mc.page3Tu  rner_mc.gotoAndStop([linkIndex]);
              } else if (linkpage == 2){
                   MovieClip(root).chPages.cont.page3_mc.page3Turner_  mc.gotoAndStop([linkIndex]);
         lastClickedLink.gotoAndPlay('s2');  // this is supposed to release the previous clicked-on link from it's mouseOver state - doesn't work
         lastClickedLink = MovieClip(this).name;    //this is supposed to set the new link as the last link clicked after the old one has been released from it's mouseOver state - doesn't work
    If anyone can help, that would be great.

    What you might be after for that line is to use:
    lastClickedLink = MovieClip(event.currentTarget);
    For what you show, the name property of an object is a String, so I would expect you to be getting an error regarding trying to get a String to act like a MovieClip when you try to tell it to gotoAndPlay('s2').

  • Can't create Area from Rectangle2D (SSCCE included)

    Hi guys,
    I'm trying to create an Area from a Rectangle2D as a workaround for being unable to create an Area from a Line2D.
    It doesn't seem to work though; any idea why?
    Here's a little SSCCE so you can see what I mean.
    The area without any transformation applied displays fine (green). The 'line' produced from my Rectangle2D with the transformation also appears as desired (black). However, the Area produced from the transformation has no pixels in it (blue).
    Help would be much appreciated x:o)
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics2D;
    import java.awt.Shape;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.geom.AffineTransform;
    import java.awt.geom.Area;
    import java.awt.geom.Rectangle2D;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class Test implements ActionListener {
         private static Shape shape;
         private static Area area;
         private static JPanel component;
         public Test() {
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel contentPane = new JPanel();
              component = new JPanel();
              component.setBackground(Color.WHITE);
              component.setOpaque(true);
              JButton button = new JButton("Draw");
              button.addActionListener(this);
              button.setActionCommand("draw");
              button.setPreferredSize(new Dimension(100, 20));
              component.setPreferredSize(new Dimension(400, 200));
              frame.setPreferredSize(new Dimension(400, 300));
              contentPane.add(component);
              contentPane.add(button);
              frame.setContentPane(contentPane);
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              new Test();
         public void actionPerformed(ActionEvent event) {
              if (event.getActionCommand().equals("draw")) {
                   // Create graphics context
                   Graphics2D g2d = (Graphics2D) component.getGraphics();
                   // Create arbitrary endpoints for 'line'
                   double x1 = 20;
                   double x2 = 60;
                   double y1 = 5;
                   double y2 = 70;
                   double deltaX = x1 - x2;
                   double deltaY = y1 - y2;
                   // Instantiate rectangle and derived area
                   Rectangle2D.Double rectangle = new Rectangle2D.Double(x1, y1, Math.abs(deltaX), 10);
                   area = new Area(rectangle);
                   // Display area without transformation
                   g2d.setColor(Color.GREEN);
                   g2d.draw(area);
                   // Construct matrix transformation for y = mx + c
                   double m = deltaY / deltaX;
                   double c = y1 / (m * x1);
                   AffineTransform matrix = new AffineTransform(1, m, 0, 0, 0, c);
                   // Transform Shape and Area by constructed matrix
                   shape = matrix.createTransformedShape(rectangle);
                   area = area.createTransformedArea(matrix);
                   // Display the transformed Shape (black)
                   g2d.setColor(Color.BLACK);
                   g2d.draw(shape);
                   // Shift 5 pixels right
                   g2d.translate(5, 0);
                   // Display the transformed Area (blue)
                   g2d.setColor(Color.BLUE);
                   g2d.draw(area);
                   // Display transformed Area bounds as String
                   g2d.drawString(area.getBounds().toString(), 80, 100);
    }

    I just came back to this, and realised that Area probably doesn't like there being no fillable area, lol slaps forehead
    So this altered version works perfectly for a line of thickness 1:
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics2D;
    import java.awt.Shape;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.geom.AffineTransform;
    import java.awt.geom.Area;
    import java.awt.geom.Rectangle2D;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class Test implements ActionListener {
         private static Shape shape;
         private static Area area;
         private static JPanel component;
         public Test() {
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel contentPane = new JPanel();
              component = new JPanel();
              component.setBackground(Color.WHITE);
              component.setOpaque(true);
              JButton button = new JButton("Draw");
              button.addActionListener(this);
              button.setActionCommand("draw");
              button.setPreferredSize(new Dimension(100, 20));
              component.setPreferredSize(new Dimension(400, 200));
              frame.setPreferredSize(new Dimension(400, 300));
              contentPane.add(component);
              contentPane.add(button);
              frame.setContentPane(contentPane);
              frame.pack();
              frame.setVisible(true);
         public static void main(String[] args) {
              new Test();
         public void actionPerformed(ActionEvent event) {
              if (event.getActionCommand().equals("draw")) {
                   // Create graphics context
                   Graphics2D g2d = (Graphics2D) component.getGraphics();
                   // Create arbitrary endpoints for 'line'
                   double x1 = 20;
                   double x2 = 60;
                   double y1 = 5;
                   double y2 = 70;
                   double deltaX = x1 - x2;
                   double deltaY = y1 - y2;
                   // Instantiate rectangle and derived area
                   Rectangle2D.Double rectangle = new Rectangle2D.Double(x1, y1, Math.abs(deltaX), 1); // Here's what's changed
                   area = new Area(rectangle);
                   // Display area without transformation
                   g2d.setColor(Color.GREEN);
                   g2d.draw(area);
                   // Construct matrix transformation for y = mx + c
                   double m = deltaY / deltaX;
                   double c = y1 - (m * x1); // ** Sidenote: typo in the above version, d'oh!
                   AffineTransform matrix = new AffineTransform(1, m, 0, 1, 0, c); // Here's what's changed
                   // Transform Shape and Area by constructed matrix
                   shape = matrix.createTransformedShape(rectangle);
                   area = area.createTransformedArea(matrix);
                   // Display the transformed Shape (black)
                   g2d.setColor(Color.BLACK);
                   g2d.draw(shape);
                   // Shift 5 pixels right
                   g2d.translate(5, 0);
                   // Display the transformed Area (blue)
                   g2d.setColor(Color.BLUE);
                   g2d.draw(area);
                   // Display transformed Area bounds as String
                   g2d.drawString(area.getBounds().toString(), 80, 100);
    }

  • Create standby from another standby!

    Dear All,
    My database is 10gR2 and OS is Red Hat Enterprise Linux 4.
    I have an existing setup of primary database and standby database that is working fine.
    I want to add another standby database but i can only make changes to the existing stand by database, not want to disturb or restart primary database. I want to say i want to create a standby database for another standby database that is not in an open mode.
    I have tried my best to search the scenario on net but couldn't find any help. Please refer an article or document which can help me.
    Regards, Imran

    Handle:     misterimran
    Email:     misterimran
    Status Level:     Newbie
    Registered:     Jan 15, 2002
    Total Posts:     1,121
    Total Questions:      137 (119 unresolved)
    How much time will take to mark your questions as "ANSWERED"?

  • Create a table from another table and add constraint statement. Please help

    Previously, I post a question and it works as below:
    create table my_table
    PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
    TABLESPACE TAB_DATA
    as select t1, t5, t2, t3, t4 from orig_table;
    I have been trying to use the same strategy as I post earlier, but it doesn't work.
    CONSTRAINT "MY_TEMP" UNIQUE ("ID", "SNAME", "CNAME", "TIME", "SYSTEM_ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TAB_DATA" ENABLE
    CLUSTER MY_CLUSTER
    "CNAME"
    Below iis my SQL statement, but it doesn't work. Please help.
    create table my_table
    CONSTRAINT "MY_TEMP" UNIQUE ("ID", "SNAME", "CNAME", "TIME", "SYSTEM_ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TAB_DATA" ENABLE
    CLUSTER MY_CLUSTER
    "CNAME"
    as (select t1, t5, t2, t3, t4 from orig_table;

    Hi,
    Why do you need to combine the two action togather. You can get the things done in two steps.
    Create table tab1 as select * from tab2;
    Then you create any contraint that you want to create on tab2 using 'alter table add constraint'.
    Regards

  • Create table by another table query wid contraints

    how can we create table by another table but wid all the constraints of that table means
    create table emp_test as select * from emp
    it will create the replica of emp table but not constraints so how can i creat table along wid constraints

    Mushy wrote:
    i cant do this i have more than 200 tables to create wid the create table statement so any simple method to create table including constrains of that table otherwise i have to make a lot of changes in this codee etcc etcc
    thanks a lot for ur replyYou can automate it. Something to start with:
    SET SERVEROUTPUT ON FORMAT WORD_WRAPPED
    DECLARE
        v_new_def CLOB;
    BEGIN
        FOR v_rec IN (select table_name,dbms_metadata.get_ddl('TABLE',table_name) def from user_tables where table_name in ('EMP','DEPT')) LOOP
          v_new_def := v_rec.def;
          FOR v_list IN (select table_name from user_tables where table_name in ('EMP','DEPT')) LOOP
            v_new_def := replace(
                                 v_new_def,
                                 '"' || USER || '"."' || v_list.table_name || '"',
                                 '"' || USER || '"."' || v_list.table_name || '_TEST"'
          END LOOP;
          v_new_def := replace(
                               v_new_def,
                               '"PK_' || v_rec.table_name || '"',
                               '"PK_' || v_rec.table_name || '_TEST"'
          dbms_output.put_line(v_new_def);
        END LOOP;
    END;
      CREATE TABLE "SCOTT"."DEPT_TEST"
       (    "DEPTNO" NUMBER(2,0),
            "DNAME" VARCHAR2(14),
            "LOC" VARCHAR2(13),
             CONSTRAINT
    "PK_DEPT_TEST" PRIMARY KEY ("DEPTNO")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536
    NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE
    "USERS"  ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576
    MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
      CREATE TABLE "SCOTT"."EMP_TEST"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
            "JOB" VARCHAR2(9),
            "MGR" NUMBER(4,0),
            "HIREDATE" DATE,
            "SAL" NUMBER(7,2),
            "COMM" NUMBER(7,2),
            "DEPTNO" NUMBER(2,0),
             CONSTRAINT "PK_EMP_TEST" PRIMARY KEY
    ("EMPNO")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1
    MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"  ENABLE,
             CONSTRAINT
    "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
              REFERENCES "SCOTT"."DEPT_TEST" ("DEPTNO") ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1
    MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1
    FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    PL/SQL procedure successfully completed.
    SQL>  SY.

  • Using EJB from another connection pool in WLPI

    Hi All,
    I've deployed an entity bean (CMP) which used the connection pool other than the
    one used by WLPI. When I execute the business operation I've defined for this
    bean, the following exception is encountered:
    "Couldn't get connection: java.sql.SQLException: Connection has already been created
    in this tx context for pool named wlpiPool. Illegal attempt to create connection
    from another pool: oraclePool"
    Is there any other alternative for me to use the entity bean in WLPI?
    Thanks,
    Fred

    Instead of using mulitiple connection pool,we are using single connection pool.
    Our one application, accessing remote db also, for that we are using simple jdbc
    connection. No pool.
    We also tried OracleXAdriver. In that case, at the time of startup we are getting
    weird error.
    Thanks
    JIgnesh Patel
    "Fred" <[email protected]> wrote:
    >
    I simply turned all my CMP to BMP and get the connection from another
    connection
    pool. But that was not what I want. Is there any method that allows a
    CMP to use
    connection pool other than the wlpiPool pool in WLPI?
    Thanks
    "jignesh" <[email protected]> wrote:
    Hi Fred,
    We are also getting same error. How did you resolve this error ?
    I'd appreciate,if you can post resolution of this error.
    Thanks
    Jignesh Patel
    "Fred" <[email protected]> wrote:
    Hi All,
    I've deployed an entity bean (CMP) which used the connection pool other
    than the
    one used by WLPI. When I execute the business operation I've defined
    for this
    bean, the following exception is encountered:
    "Couldn't get connection: java.sql.SQLException: Connection has already
    been created
    in this tx context for pool named wlpiPool. Illegal attempt to create
    connection
    from another pool: oraclePool"
    Is there any other alternative for me to use the entity bean in WLPI?
    Thanks,
    Fred

  • Calling EJB from another EJB

    I need to make a several calls to the methods inside EJB1 from EJB2. I was getting
    the remote reference of the EJB2 inside the ejbCreate() of the EJB1, is it a good
    practice ?? If not, do I need to get remote reference of the EJB2 every time I
    need to call EJB2 method??
    Thanks in advance.

    To refer a Ejb from another Ejb include <ejb-ref> in ejb-jar.xml
    <session>
    <ejb-name>Ejb1</ejb-name>
    <ejb-ref>
    <ejb-ref-name>Ejb2</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.ejb.Ejb2Home</home>
    <remote>com.ejb.Ejb2</remote>
    </ejb-ref>
    <session>
    Include a <reference-discriptor> in weblogic-ejb-jar.xml
    <weblogic-enterprise-bean>
    <ejb-name>EjbSession</ejb-name>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>Ejb2</ejb-ref-name>
    <jndi-name>com.ejb.Ejb2Home</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-enterprise-bean>
    In Ejb1 bean class refer to Ejb2 method with a remote reference to Ejb2.
    InitialContext initialContext = new InitialContext();
    Ejb2Home ejb2Home = (Ejb2Home)initialContext.lookup("com.ejb.Ejb2Home");
    Ejb2 ejb2 = ejb2Home.findByPrimaryKey();
    Alex Pratt wrote:
    I need to make a several calls to the methods inside EJB1 from EJB2. I was getting
    the remote reference of the EJB2 inside the ejbCreate() of the EJB1, is it a good
    practice ?? If not, do I need to get remote reference of the EJB2 every time I
    need to call EJB2 method??
    Thanks in advance.

Maybe you are looking for