[Solved]SIMPLE Question ON "CREATE TABLE as SELECT".

Hi there,
I was wondering how to work it out smartly and briefly.
For example, I already have a "tableA" as following.
tableA
id name
1 name1
2 name2
create table tmp as
select id, name from tableA;
It will create the tmp table successfully.
If I want to add a new column 'tel' in tmp table,
I can run as following.
create table tmp as
select id, name, 999 tel, 'aaaaaaaaa' ps from tableA;
It will add 'tel NUMBER' column and 'ps char(9)' in tableA.
If I want to add 'col varchar(50)' in tableA,
I do not want to make a string which contains 50 characters in Select command.
How can I make it work in a smart way?
Thanks.
Phil
Message was edited by:
user615355

Is there a reason that you need this to be in a single statement? You would normally be better served here with a separate CREATE TABLE and INSERT (possibly as a direct path operation).
That said, you could use the CAST operator, i.e.
SCOTT @ jcave102 Local> create table a as select cast('a' as varchar2(50)) col1 from dual;
Table created.
Elapsed: 00:00:00.48
SCOTT @ jcave102 Local> desc a;
Name                                                  Null?    Type
COL1                                                           VARCHAR2(50)
SCOTT @ jcave102 Local> Justin

Similar Messages

  • Create table as select (CTAS)statement is taking very long time.

    Hi All,
    One of my procedure run a create table as select statement every month.
    Usually it finishes in 20 mins. for 6172063 records and 1 hour in 13699067.
    But this time it is taking forever even for 38076 records.
    When I checked all it is doing is CPU usage. No I/O.
    I did a count(*) using the query it brought results fine.
    BUT CTAS keeps going on.
    I'm using Oracle 10.2.0.4 .
    main table temp_ip has 38076
    table nhs_opcs_hier has 26769 records.
    and table nhs_icd10_hier has 49551 records.
    Query is as follows:
    create table analytic_hes.temp_ip_hier as
    select b.*, (select nvl(max(hierarchy), 0)
    from ref_hd.nhs_opcs_hier a
    where fiscal_year = b.hd_spell_fiscal_year
    and a.code in
    (primary_PROCEDURE, secondary_procedure_1, secondary_procedure_2,
    secondary_procedure_3, secondary_procedure_4, secondary_procedure_5,
    secondary_procedure_6, secondary_procedure_7, secondary_procedure_8,
    secondary_procedure_9, secondary_procedure_10,
    secondary_procedure_11, secondary_procedure_12)) as hd_procedure_hierarchy,
    (select nvl(max(hierarchy), 0) from ref_hd.nhs_icd10_hier a
    where fiscal_year = b.hd_spell_fiscal_year
    and a.code in
    (primary_diagnosis, secondary_diagnosis_1,
    secondary_diagnosis_2, secondary_diagnosis_3,
    secondary_diagnosis_4, secondary_diagnosis_5,
    secondary_diagnosis_6, secondary_diagnosis_7,
    secondary_diagnosis_8, secondary_diagnosis_9,
    secondary_diagnosis_10, secondary_diagnosis_11,
    secondary_diagnosis_12, secondary_diagnosis_13,
    secondary_diagnosis_14)) as hd_diagnosis_hierarchy
    from analytic_hes.temp_ip b
    Any help would be greatly appreciated

    Hello
    This is a bit of a wild card I think because it's going to require 14 fill scans of the temp_ip table to unpivot the diagnosis and procedure codes, so it's lilkely this will run slower than the original. However, as this is a temporary table, I'm guessing you might have some control over its structure, or at least have the ability to sack it and try something else. If you are able to alter this table structure, you could make the query much simpler and most likely much quicker. I think you need to have a list of procedure codes for the fiscal year and a list of diagnosis codes for the fiscal year. I'm doing that through the big list of UNION ALL statements, but you may have a more efficient way to do it based on the core tables you're populating temp_ip from. Anyway, here it is (as far as I can tell this will do the same job)
    WITH codes AS
    (   SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            primary_PROCEDURE       procedure_code,
            primary_diagnosis       diagnosis_code,
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_1    procedure_code,
            secondary_diagnosis_1    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_2    procedure_code ,
            secondary_diagnosis_2    diagnosis_code     
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_3    procedure_code,
            secondary_diagnosis_3    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_4    procedure_code,
            secondary_diagnosis_4    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_5    procedure_code,
            secondary_diagnosis_5    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_6    procedure_code,
            secondary_diagnosis_6    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_7    procedure_code,
            secondary_diagnosis_7    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_8    procedure_code,
            secondary_diagnosis_8    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_9    procedure_code,
            secondary_diagnosis_9    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_10  procedure_code,
            secondary_diagnosis_10    diagnosis_code
        FROM
            temp_ip
        UNION ALL
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_11  procedure_code,
            secondary_diagnosis_11    diagnosis_code
        FROM
            temp_ip    
        SELECT
            bd.primary_key_column_s,
            hd_spell_fiscal_year,
            secondary_procedure_12  procedure_code,
            secondary_diagnosis_12    diagnosis_code
        FROM
            temp_ip
    ), hd_procedure_hierarchy AS
    (   SELECT
            NVL (MAX (a.hierarchy), 0) hd_procedure_hierarchy,
            a.fiscal_year
        FROM
            ref_hd.nhs_opcs_hier a,
            codes pc
        WHERE
            a.fiscal_year = pc.hd_spell_fiscal_year
        AND
            a.code = pc.procedure_code
        GROUP BY
            a.fiscal_year
    ),hd_diagnosis_hierarchy AS
    (   SELECT
            NVL (MAX (a.hierarchy), 0) hd_diagnosis_hierarchy,
            a.fiscal_year
        FROM
            ref_hd.nhs_icd10_hier a,
            codes pc
        WHERE
            a.fiscal_year = pc.hd_spell_fiscal_year
        AND
            a.code = pc.diagnosis_code
        GROUP BY
            a.fiscal_year
    SELECT b.*, a.hd_procedure_hierarchy, c.hd_diagnosis_hierarchy
      FROM analytic_hes.temp_ip b,
           LEFT OUTER JOIN hd_procedure_hierarchy a
              ON (a.fiscal_year = b.hd_spell_fiscal_year)
           LEFT OUTER JOIN hd_diagnosis_hierarchy c
              ON (c.fiscal_year = b.hd_spell_fiscal_year)HTH
    David

  • DB Link Create table as select

    I ve a query which starts with create table as select ..
    When I run the select part of the query, it runs in 2 sec.
    But the whole query runs in 10min. It is fetching data from dblink.
    I think if select can finish in 2 sec. All is left to do is create table and insert.
    Why is takin so long?
    Oracle DB version 9.2.0.8

    When I run the select part of the query, it runs in 2 sec.Does the select finish in 2 seconds or does it start returning rows in 2 seconds?
    Big difference.

  • Identify tablspace in create table as select

    I am trying to run a create table as select query that specifies which tablspace to create the table in. When I run the query below I get an error, any ideas?
    create table roi_call_record_backup as (select * from prod.roi_call_record)
    tablespace roi_data01;
    null

    Try this ...
    create table roi_call_record_backup
    tablespace roi_data01
    as
    (select * from prod.roi_call_record)
    null

  • Question on Creating Table From Insert statement

    Hi,
    I want to create a table using a DBlink from another database using the create/insert statement. Will it also transfer the constraints or do I have to do it manually afterwards? Thanks.
    Create table T1
    SELECT a,b,c from T2 from DB@dblink;

    As discussed above, the constraints, indexes, triggers are not copied. Only NOT NULL constraints are copied.
    Look at this thread Re: Copying table structure.
    for copying triggers/indexes from source table to destination table.
    Thanks,
    Navaneeth

  • [SOLVED :)] Need help with adf table row selection

    Hi,
    In my application I am displaying results in a table. The DisplayRow property of table is set to Selected
    There are Next and Back buttons which help user to view details associated to the next/previous rows.
    I am using ADF 11g
    When user clicks Next or Previous button, then the selection of the row should also gets updated
    To achieve this i wrote below piece of code:
    this.tblS.getSelectedRowKeys().clear();+
    this.tblS.setRowIndex(count);+
    RowKeySet rks =  tblS.getSelectedRowKeys();+
    rks.add(tblS.getRowKey());+
    rks =  tblS.getSelectedRowKeys();+
    ISSUE:_
    When i run application and click Next/Previous Button, all functionalities do take place properly, but a null pointer exception is also thrown._+
    If i remove DisplayRow property of table from Selected to Default, every thing works good and no Exception is thrown_+       
    But as records in my table are going to be around 50-60 everytime, i need to set DisplayRow property of table to Selected.
    Is there any way to achieve this? Solve this problem?
    Some more details:_
    I am using a POJO class to create DataController. This DataController is having a view Object which is used to create results table.
    I have defined Primary key for my POJO Data Controller.
    Here is code of xml file:*
    +<?xml version="1.0" encoding="UTF-8" ?>+
    +<JavaBean xmlns="http://xmlns.oracle.com/adfm/beanmodel" version="11.1.1.52.5"+
    id="ProductListBean" Package="xxadf.mm.resources"
    BeanClass="xxadf.mm.resources.ProductListBean"
    isJavaBased="true">
    +<Attribute Name="Product" Type="java.lang.String" PrimaryKey="true"/>+
    +<Attribute Name="Stock" Type="java.lang.String"/>+
    +<Attribute Name="Rate" Type="java.lang.String"/>+
    +<Attribute Name="Accuracy" Type="java.lang.String"/>+
    +<Attribute Name="Details" Type="java.lang.String"/>+
    +<ConstructorMethod IsCollection="true"+
    Type="xxadf.mm.resources.ProductListBean"
    BeanClass="xxadf.mm.resources.ProductListBean"
    id="ProductListBean"/>
    +</JavaBean>+
    Error Log:*
    SEVERE: Server Exception during PPR, #1
    java.lang.NullPointerException
    at oracle.adfinternal.view.faces.model.binding.RowDataManager.getRowIndex(RowDataManager.java:200)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.getRowIndex(FacesCtrlHierBinding.java:506)
    at org.apache.myfaces.trinidad.component.UIXIterator._fixupFirst(UIXIterator.java:414)
    at org.apache.myfaces.trinidad.component.UIXIterator.__encodeBegin(UIXIterator.java:392)
    at org.apache.myfaces.trinidad.component.UIXTable.__encodeBegin(UIXTable.java:168)
    at org.apache.myfaces.trinidad.component.UIXCollection.encodeBegin(UIXCollection.java:517)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeHorizontalChild(PanelGroupLayoutRenderer.java:458)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$100(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:618)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:560)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:317)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:392)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:641)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:560)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:317)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.access$100(ShowDetailItemRenderer.java:31)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:491)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:464)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer._encodeChildren(ShowDetailItemRenderer.java:406)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.encodeAll(ShowDetailItemRenderer.java:114)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:1523)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer.access$500(PanelTabbedRenderer.java:38)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer$BodyEncoderCallback.processComponent(PanelTabbedRenderer.java:969)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer$BodyEncoderCallback.processComponent(PanelTabbedRenderer.java:920)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer._renderTabBody(PanelTabbedRenderer.java:519)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer.encodeAll(PanelTabbedRenderer.java:233)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:221)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:820)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1494)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:771)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
    at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:685)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:261)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:193)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Please Help I have been struggling with this issue for long.
    Thanks and Regards
    Manav Ratra
    Edited by: user11255144 on Feb 8, 2010 5:33 AM

    Hi Arun,
    Thanks for replying.
    Actually in my application there is one result table and a section that is displaying complete details of the product selectd in result table.
    The next/previous buttons are not binded with result table.
    What I am doing is, I am puuliing data from VO and displaying it on form, whenever any of these buttons is clicked.
    As soon as these buttons are clicked data is coming up, but selection state of table is not getting updated.
    So to update selection state i wrote piece of code described in my previous post.
    Everything works fine if displayRow property of table is not set to selected.
    If i set display row property of table to selected, then i get a null pointer exception with message log defined in previous post.
    Although NPE is thrown, yet all data is properly fetched and table selection is also updated. But am not able to get how this NPE is coming and hpw to fix it .
    (I need to keep displayRow = selected, for all other cases NPE is not thrown)
    Please help..
    Thanks and Regards
    Manav Ratra

  • Question on Creating table from another table and copying the partition str

    Dear All,
    I want to know whether is there any way where we can create a table using another table and have the partitions of the new table to be exactly like the used table.
    Like
    CREATE TABLE TEST AS SELECT * FROM TEMP;
    The table TEMP is having range and hash partitions.
    Is there any way when we use the above command, we get the table partitions of TEMP to be copied to the new table TEST.
    Appreciate your suggestions on this one.
    Thanks,
    Madhu K.

    may this answer your question...
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:595568200346856483
    Ravi Kumar

  • To make the query more efficient (create table wiht select command)

    Hi,
    I have written this query to create another table, but it takes approx two hours while both tables are indexed with 891353, 769023, i have used the following query.
    create table source1 as select a.idx, a.source from tt a where a.idx not in (select b.idx from ttt b)
    thanks

    Try this one if you're on oracle 8i or older
    create table source1 as
      select a.idx, a.source
        from tt a
       where not exists (select null from ttt b where a.idx = b.idx)

  • CREATE TABLE AS SELECT PROBLEM

    Dear members,
    I created a table whose definition is a select query.
    for ex: I created a table xx_customer as :
    create table xx_customer as
    select customer_name,customer_number
    from xx_ar_customer
    where org_id = '87'when i run the query
    select  count(*)
    from xx_customer;The count was 120 records.
    This was done as part of performance tunning.
    Now few days after the table xx_customer was created few records were inserted into table xx_ar_customer for org_id = '87' .
    So ideally the count should be more than 120 but its not.
    when i run the same query again
    select  count(*)
    from xx_customer;I get count as 120 Records which is wrong.
    It looks like it not refreshing data. If i run the table definition query i am getting count as more than 120 but if i do a select on the table count is still 120.
    Any ideas?
    Thanks
    Sandeep

    Hi,
    795291 wrote:
    I cant create view. I tried that before. If i use view then my query runs for a very long time and if i create a table then the run time is reduced by half :)
    So if we create Table as a select statement, then will it give data at the point of time it was created? Exactly!
    Will it not give latest data?Not unless the latest data happens to be the same as the data at the time it was created.
    CREATE TABLE AS is kind of like putting a photograph of yourself on your web site. If you smile, that doesn't mean the picture smiles.
    CREATE VIEW is kind of like hanging a video camea from your hat, and streaming the output to your web page. As soon as you smile, the picture smiles. It's more expensive than a still picture.
    A compromise apprioach is a Materialized View , which is really a type of table. Like any other table, it occupies space, and is relatively fast to use. You can define a materialized view to be refreshed at regular intervals (once a day, once an hour, once a week, ...) or whenever there is a change in the base table(s).

  • Create table as select statement.

    Hello Oracle Gurus,
    I am trying to create a table using select * from other table.
    The procedure that I am following is this:-
    I have a temp table whose signature is on commit delete rows.
    I insert records in this table.
    when I do select * from temp_table,perm_table I get some rows.
    then I try to create a result_table using this
    CREATE TABLE result_table
    AS SELECT * FROM temp_table,perm_table;
    I see the table in created but number of records in 0. Can anyone please explain where commit takes place while sequence in this query occurs.
    Thanks
    Edited by: user10696492 on Nov 10, 2009 8:47 AM

    Create table statement is a ddl - so an implicit commit is performed before the create statement begins. The implicit commit will delete all the rows from the temp table. If it is feasible change the definition of the temp table to on commit preserve rows.

  • "Create Table from select Query" Vs "Insert into"

    Hi
    Schenaio:
    My Select Query returns more than 10 million records, these records needs to be inserted into another table.
    Approach 1:
    I created table called TABLE1, and inserted the records using INSERT statement as a batch (batch size is 5000).
    Approach 2:
    I create table like,
    CREATE TABLE TABLE1 AS <SELECT QUERY>
    Here Apporach-1 took almost 40 minutes to complete the insert but Approach-2 took only 6 minutes.
    If anybody knows why it is? And is there any way to improve the performance of Approach-1?.
    Thanks
    Nidhi

    Most "batch" methods execute the same query multiple times. Row filtering is done after the rows are fetched from the source. The process of fetching all the rows could be a FullTableScan.
    Therefore, a FullTableScan is executed for each batch of 5000 rows.
    However, your query and batch definitions may well be different. We haven't seen the query and the execution plan.
    Another point : How are you "filtering" the rows (i.e the second execution inserts rows 5001 to 10000 and does not attempt to reinsert rows 1 to 5000) ?
    What is the overhead imposed by the filter ? (does the third execution have to exclude rows 1 to 10000 and inserts rows 10001 to 15000 and so on)
    Hemant K Chitale

  • Create Table As Select From Select

    Table_2
    CREATE TABLE TABLE_2
    "ID" VARCHAR2(10),
    "EXCL" VARCHAR2(10),
    "SEQ" NUMBER(10)
    Inserts
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('123456' ,'' ,1 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('123456' ,'EX' ,2 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('123456' ,'' ,3 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('321654' ,'' ,4 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('123798' ,'EX' ,5 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('123785' ,'' ,6 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('654787' ,'' ,7 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('654787' ,'' ,8 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('654787' ,'' ,9 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('985217' ,'EX' ,10 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('985217' ,'' ,11 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('937158' ,'' ,12 );
    INSERT INTO TABLE_2 (ID ,EXCL ,SEQ ) VALUES ('937158' ,'' ,13 );
    Select *
    ID EXCL SEQ
    123456 1
    123456 EX 2
    123456 3
    321654 4
    123798 EX 5
    123785 6
    654787 7
    654787 8
    654787 9
    985217 EX 10
    985217 11
    937158 12
    937158 13
    I need to create a table based on for all Records which are EXC not null - but I need to bring through all the records which have the same ID as EXC not null field.
    Desired output: -
    ID EXCL SEQ
    123456 1
    123456 EX 2
    123456 3
    123798 EX 5
    985217 EX 10
    985217 11
    Any ideas folks?

    Hi,
    Here's one way:
    CREATE     TABLE     table_x
    AS
    SELECT     *
    FROM     table_2
    WHERE     id     IN (
                     SELECT  id
                     FROM    table_2
                     WHERE   excl     IS NOT NULL
    ;By the way, whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    You'll get better answers quicker if people can read:ID EXCL SEQ
    123456 1
    123456 EX 2
    123456 3
    123798 EX 5
    985217 EX 10
    985217 11
    (for example) rather than
    Deeds_2001 wrote:
    ID EXCL SEQ
    123456 1
    123456 EX 2
    123456 3
    123798 EX 5
    985217 EX 10
    985217 11

  • Sync with manually created tables or selected publication items

    HI
    I have the following situation :
    Server side:
    Table1, Table2,Table3,Table4,Table5,Table6
    Client type1 :
    Table1, Table2,Table3,Table4
    Client type2:
    Table3,Table4,Table5,Table6
    so i cant create two different publications for clients.
    I have 1 publication with Table1, Table2,Table3,Table4,Table5,Table6
    In this situation, is it possible to synchronize with manually created lite database and tables, or mobile server knows how to sync only with snapshots created by his own ?
    Sync process reports "sync ok" but nothing happens
    And one more question is :
    can i use some sync api to create database with snapshots
    1,2,3,4 for client1 and snapshots 3,4,5,6 for client2?
    Today it works in following way:
    1)install mobile client on mobile devices
    2)install mobile application type 1 and 2 on mobile devices
    3)call msync to create database with snapshots 1-6 on all devices
    4)client type 1 do not use tables 5,6 sync only tables 1,2,3,4
    5)client type 2 do not use tables 1,2, sync only tables 3,4,5,6

    only tables defined in the application and synchronised down to the client will be synchronised - manually created tables on the client are ignored (list of tables to be synchronised is controlled by the table c$table_list in the concli database)
    for your requirement, either
    use one application for both client types, but ignore the 'unused' tables in the client software - advantage=easy, disadvantage overhead in synchronising and composing data not needed
    or
    create two seperate applications .no problem about using the same table in multiple applications, we do that for reference data all of the time, sequences cannot be shared (but there is a work around for that), and then associate each client user to one or the other application - advantage=better meets the requirement, disadvantage=maintenance and different database names in the client configuration

  • Performance issue Create table as select BLOB

    Hi!
    I have a performance issue when moving BLOB´s between tables. (The size of images files are from 2MB to 10MB).
    I'm using follwing statement for example,
    "Create table tmp_blob as select * from table_blob
    where blob_id = 333;"
    Is there any hints that I can give when moving data like this or is Oracle10g better with BLOB's?

    Did you find a resolution to this issue?
    We are also having the same issue and wondering if there is a faster mechanism to copy LOBs between two table.

  • Proble creating Table Type = Select in 10gR3

    In a very simple example case I have a customers table that I am trying to create a Table Type of Select in the physical layer.
    Using the Admin tool I create "New Physical tabe" and enter select * from customer where region = 'East'
    If I "Update All Row Counts" it now shows 56 rows - which is correct
    If I try and "view data" I get an error
    [nQSError: 17001] Oracle Error Code: 936, messgae: ORA-00936: missing expression at OCI cal OCIStmtExecute.
    [nQSError: 17010] SQL Statement preparation failed.
    If I deploy the view I can go to sqlplus and select from it.
    I have tried qualifying table name and selecting specific columns - I know its not a permission issue and presumably the fact that it counted rows correctly confirms it must have generated correct SQL.
    I'm puzzled - what am I missing here?

    This is standard behavior..Update Row Count work fine since SELECT COUNT (*) FROM (select * from customer where region = 'East') is a valid SQL, View Data doesn't work since your columns aren't named, so OBI cant select col1, col2, etc.
    Hope this explains.
    Michael
    Edited by: mkooloos on Jan 17, 2011 3:48 PM

Maybe you are looking for

  • Win 7 in Boot Camp: Drivers will not install from snow leopard cd.

    I have a early 2011 Macbook Pro (8,1). I am loading Windows 7 with Boot Camp, but cannot get any of the drivers to install. (ethernet, video, etc) I have tried both the Snow Leopard cd (I think it's Boot Camp 3.2?), and also downloading drivers onlin

  • Link/RE-link to word docs with form fields?

    Trying something new, and when I took the InDesign 2 day class the instructor was not very familiar with linking to word docs, she just never used the feature. So, I have multiple contributors who will onlly work in word. I am trying to set up a temp

  • How to import a project.

    Hi , I downloaded the source named ILOG.zip. I am ataaching this file. But i am not able to import this project into my flex. Please guide me. Regards, Tanushri.

  • Are Itunes playlists stored in Previous System folder

    I re-installed Leopard and my old files are stored in a folder called previous system. I tried to find back the playlists that I had running under Itunes, but I can not find them in this previous system folder. Therefore my questions: Are they backed

  • Performance issue with MKPF table

    Hi All, My requirement is  to get the material documents based on process orders. For this   I used XBLNR(Reference Document Number ) in where condition  of  SELECT statement on  MKPF table. But this is taking more time for accessing the table. Then