Create Partition tables in PL/SQL using Execute Immediate

Hi
I have to create a partiton table in PL/SQL using Execute Immediate. I concat the necessary Create Table syntax into a variable and use Execute Immediate variable name. This gives a error ORA-00900: invalid SQL statement. However if i cut and paste the SQL statement from DBMS_OUTPUT, the table creation goes through without any problem.
What could be the issue. Has anyone face this before please.
I am using 10G DB

Thanks for your reply. It is a big code. I am pasting the part required.
v_sqlstmtout :='CREATE TABLE a_10(MYDATE DATE NOT NULL,ID NUMBER(14) NOT NULL)';
v_sqlstmtout := v_sqlstmtout || ' PARTITION BY RANGE (MYDATE) ';
v_sqlstmtout := v_sqlstmtout || 'SUBPARTITION BY HASH(id) ';
v_sqlstmtout := v_sqlstmtout || 'SUBPARTITION TEMPLATE(';
v_sqlstmtout := v_sqlstmtout || 'SUBPARTITION SP1,SUBPARTITION SP2) ';
v_sqlstmtout := v_sqlstmtout || '(PARTITION mth_dummy VALUES LESS THAN ';
v_sqlstmtout := v_sqlstmtout || '('||V_SQLSTMT3||')' || v_sqlstmt||')';
EXECUTE IMMEDIATE ''''||v_sqlstmtout||'''';
variables are substituted through data from different tables.
The output looks like the following
CREATE TABLE a_10(MYDATE DATE NOT NULL,ID NUMBER(14) NOT NULL)
PARTITION BY RANGE (mydate) SUBPARTITION BY HASH(id) SUBPARTITION
TEMPLATE(SUBPARTITION SP1,SUBPARTITION SP2) (PARTITION mth_dummy VALUES
LESS THAN ('01-MAY-2006'), PARTITION mth_JAN2007 VALUES LESS THAN
('01-FEB-2007'))
The above is the output from DBMS_OUTPUT. If i run this statement the table is created. Please help..

Similar Messages

  • Dynamic Sql Using Execute Immediate

    I am trying to construct a dynamic statement that takes in a supplied column name (COL_NAME), then do an Update on the column based on a supplied username. The table myTable has 4 columns and I would like to update a column thats supplied each time.
    NOT DYNAMIC
    PROCEDURE UpdateUser(aauser myTable.USERNAME%Type,COL_NAME varchar2, val varchar2) AS
    BEGIN
    Update myTable
    set userid = '002'
    where username= aauser;
    [b]DYNAMIC
    PROCEDURE UpdateUser(aauser myTable.USERNAME%Type,COL_NAME varchar2, val varchar2) AS
    BEGIN
    EXECUTE IMMEDIATE 'UPDATE myTable
    Set ' ||COL_NAME||' = val
    where myTable.username = aauser';
    END UpdateUser;
    However I get the following error when I execute this statement. Please help me.
    Connecting to the database Local.
    ORA-00904: "aaUser": invalid identifier
    ORA-06512: at "ANOLD.PUB", line 1433
    ORA-06512: at line 10
    Process exited.
    Disconnecting from the database Local.

    TEST@XE SQL> desc mytable
    Name                                                  Null?    Type
    USERNAME                                                       VARCHAR2(30)
    USERID                                                         VARCHAR2(30)
    COL3                                                           NUMBER
    COL4                                                           NUMBER
    TEST@XE SQL> insert into mytable values('TEST','001',1,2);
    1 row created.
    TEST@XE SQL> create or replace PROCEDURE UpdateUser(aauser myTable.USERNAME%Type,COL_NAME varchar2, val varchar2) AS
      2  BEGIN
      3     EXECUTE IMMEDIATE  'UPDATE myTable
      4     Set ' ||COL_NAME||' = ' || chr(39) ||val|| chr(39) ||
      5     ' where myTable.username = ' || chr(39) ||aauser|| chr(39);
      6  END UpdateUser;
    TEST@XE SQL> /
    Procedure created.
    TEST@XE SQL> exec UpdateUser('TEST','userid','002');
    PL/SQL procedure successfully completed.
    TEST@XE SQL> select * from mytable;
    USERNAME                       USERID                                    COL3            COL4
    TEST                           002                                          1               2
    TEST@XE SQL> exec UpdateUser('TEST','col3',111);
    PL/SQL procedure successfully completed.
    TEST@XE SQL> select * from mytable;
    USERNAME                       USERID                                    COL3            COL4
    TEST                           002                                        111               2
    TEST@XE SQL>

  • Using EXECUTE IMMEDIATE with Create Table SQL Statement not working

    Hi ,
    I am all the privileges given from the SYSTEM user , but still i am not able to create a table under procedure . Please see these and advice.
    create or replace procedure sp_dummy as
    begin
    Execute Immediate 'Create table Dummy99_99 (Dummy_Field number)';
    end;
    even i tried this way also
    create or replace PROCEDURE clearing_Practise(p_file_id in varchar2, p_country in VARCHAR2,p_mapId in VARCHAR2)
    AUTHID CURRENT_USER AS
    strStatusCode VARCHAR2(6);
    BEGIN
    EXECUTE IMMEDIATE 'create table bonus(name varchar2(50))';
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('ERROR Creating Table');
    END ;

    William Robertson wrote:
    Since the syntax is correct, my guess is you do not have CREATE TABLE system privilege granted directly to your account. A common scenario is that you have this privilege granted indirectly via a role, allowing you to create tables on the command line, but stored PL/SQL is stricter and requires a direct grant and therefore the procedure fails with 'insufficient privileges'.A bit like he's already been told on his first thread...
    Using of Execute Immediate in Oracle PLSQL
    Generally you would not create tables from stored PL/SQL. Also as you have found out, it's best not to hide exceptions with 'WHEN OTHERS THEN [some message which gives less detail than the one generated by Oracle]'.Again like he was told on the other thread.
    There's just no telling some people eh! :)

  • Using execute immediate creating a table from another

    hi friend i wanted to create a table from a select statement in a pl sql procedure. i am using execute immediate but getting problems with it pls can anyone help me.
    here is the query i am using
    EXECUTE IMMEDIATE 'CREATE TABLE table_name AS  (SELECT * FROM  a_view   WHERE column_name LIKE '%some_string%');
    i need to know if this can be done and if yes how. pls help me its bit urgent too. the schema name is same and the privileges are available to create tables too.

    Your syntax is wrong.
    If you would use a syntax higlighted editor, it would show.
    Yout try to execute a string where another string is embedded. Please use two times single quote or use the 'q' function:
    This one is correct:
    EXECUTE IMMEDIATE 'CREATE TABLE table_name AS (SELECT * FROM  a_view WHERE column_name LIKE ''%some_string%'')';
    or this one:
    EXECUTE IMMEDIATE q'|CREATE TABLE table_name AS (SELECT * FROM  a_view WHERE column_name LIKE '%some_string%')|';
    good luck

  • Create temp table using EXECUTE IMMEDIATE

    Is there any performance issue in creating globally temp table
    using EXECUTE IMMEDIATE or creating globally temp table from
    SQL PLUS.
    Any response will be greatly appreciated.
    null

    Anish,
    Creating tables is likely to be an expensive operation.
    Performance issues can only be considered in comparison to
    alternatives.
    Alternatives include: PLSQL tables, cursors and/or recoding so
    that tmp tables are not required. (One of our consultants reckons
    that sqlserver temp tables are usually used to get around
    limitations in sqlserver, ie slightly more complicated sql
    statements could be used instead of simpler sql and temporary
    tables).
    I would think creating the temp table once during sqlplus would
    be cheaper than creating and deleting it repeatedly at run time.
    Note that EXECUTE IMMEDIATE may do an implicit commit (dbms_sql
    certainly does). This may be got over my using the PRAGMA
    AUTONOMOUS_TRANSACTION; direction which places a
    procedure/function in a seperate transaction.
    Turloch
    P.S. We have some difficulty in getting information back from the
    field/customer sites. If you have questions and answers that are
    likely to be useful to other Oracle Migration Workbench
    users, and migrators in general, please send them in for possible
    inclusion in our Frequently Asked Question list.
    Oracle Migration Workbench Team
    Anish (guest) wrote:
    : Is there any performance issue in creating globally temp table
    : using EXECUTE IMMEDIATE or creating globally temp table from
    : SQL PLUS.
    : Any response will be greatly appreciated.
    Oracle Technology Network
    http://technet.oracle.com
    null

  • CREATE TEMPORARY TABLE USING EXECUTE IMMEDIATE

    Hi All,
    i have a question,
    how can i create a temporary table using EXECUTE IMMEDIATE ??
    Like:
    CREATE GLOBAL TEMPORARY table new_table as (Select * from old_table);
    Thanks,
    Edited by: xDeviates on Jun 11, 2012 3:13 PM

    It looks like you are approaching the problem incorrectly. As I suggested in Dynamic Select, it sounds like you, at most, want a function that returns a SYS_REFCURSOR (it's still not obvious to me why you would even want/ need to resort to dynamic SQL in the first place)
    CREATE OR REPLACE FUNCTION get_dynamic_cursor( p_table_name IN VARCHAR2 )
      RETURN sys_refcursor
    IS
      l_rc sys_refcursor;
    BEGIN
      OPEN l_rc FOR 'SELECT * FROM ' || dbms_assert.sql_object_name( p_table_name );
      RETURN l_rc;
    END;which you can then call from your application
    SQL> variable rc refcursor;
    SQL> exec :rc := get_dynamic_cursor( 'EMP' );
    PL/SQL procedure successfully completed.
    SQL> print rc
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        801
            20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1601        300
            30
          7521 WARD       SALESMAN        7698 22-FEB-81       1251        500
            30
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7566 JONES      MANAGER         7839 02-APR-81       2976
            20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1251       1400
            30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2851
            30
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7782 CLARK      MANAGER         7839 09-JUN-81       2451
            10
          7788 SCOTT      ANALYST         7566 19-APR-87       3001
            20
          7839 KING       PRESIDENT            17-NOV-81       5001
            10
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7844 TURNER     SALESMAN        7698 08-SEP-81       1501          0
            30
          7876 ADAMS      CLERK           7788 23-MAY-87       1101
            20
          7900 JAMES      CLERK           7698 03-DEC-81        951
            30
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7902 FORD       ANALYST         7566 03-DEC-81       3001
            20
          7934 MILLER     CLERK           7782 23-JAN-82       1301
            10
    14 rows selected.Justin

  • Error while insert data using execute immediate in dynamic table in oracle

    Error while insert data using execute immediate in dynamic table created in oracle 11g .
    first the dynamic nested table (op_sample) was created using the executed immediate...
    object is
    CREATE OR REPLACE TYPE ASI.sub_mark AS OBJECT (
    mark1 number,
    mark2 number
    t_sub_mark is a class of type sub_mark
    CREATE OR REPLACE TYPE ASI.t_sub_mark is table of sub_mark;
    create table sam1(id number,name varchar2(30));
    nested table is created below:
    begin
    EXECUTE IMMEDIATE ' create table '||op_sample||'
    (id number,name varchar2(30),subject_obj t_sub_mark) nested table subject_obj store as nest_tab return as value';
    end;
    now data from sam1 table and object (subject_obj) are inserted into the dynamic table
    declare
    subject_obj t_sub_mark;
    begin
    subject_obj:= t_sub_mark();
    EXECUTE IMMEDIATE 'insert into op_sample (select id,name,subject_obj from sam1) ';
    end;
    and got the below error:
    ORA-00904: "SUBJECT_OBJ": invalid identifier
    ORA-06512: at line 7
    then when we tried to insert the data into the dynam_table with the subject_marks object as null,we received the following error..
    execute immediate 'insert into '||dynam_table ||'
    (SELECT

    887684 wrote:
    ORA-00904: "SUBJECT_OBJ": invalid identifier
    ORA-06512: at line 7The problem is that your variable subject_obj is not in scope inside the dynamic SQL you are building. The SQL engine does not know your PL/SQL variable, so it tries to find a column named SUBJECT_OBJ in your SAM1 table.
    If you need to use dynamic SQL for this, then you must bind the variable. Something like this:
    EXECUTE IMMEDIATE 'insert into op_sample (select id,name,:bind_subject_obj from sam1) ' USING subject_obj;Alternatively you might figure out to use static SQL rather than dynamic SQL (if possible for your project.) In static SQL the PL/SQL engine binds the variables for you automatically.

  • Selecting data from a table using Execute Immediate in 9i

    Hi,
    I was wondering how I would be able to do a SELECT on a table using EXECUTE IMMEDIATE. When I tried it (with the proc below), I got the following below. Can anyone tell me what I am doing wrong?
    Using Scott/Tiger I tried this:
    SQL> ed
    Wrote file afiedt.buf
    1 CREATE OR REPLACE PROCEDURE P2
    2 IS
    3 v_SQL VARCHAR2(100);
    4 BEGIN
    5 v_SQL := 'Select * from Emp';
    6 EXECUTE IMMEDIATE v_SQL;
    7* END;
    SQL> /
    Procedure created.
    SQL> exec p2
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> exec p2
    PL/SQL procedure successfully completed.
    SQL>
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

    1 CREATE OR REPLACE PROCEDURE P2
    2 IS
    3 v_SQL VARCHAR2(100);
    erec emp%rowtype;
    4 BEGIN
    5 v_SQL := 'Select * from Emp';
    6 EXECUTE IMMEDIATE v_SQL into erec;
    7* END;
    SQL> /

  • Oracle 11G Copying a table using execute immediate

    I want to copy the contents of one table into another using execute immediate.
    This keeps failing with the following error
    ORA-00903: invalid table name
    ORA-06512: at "TABLE_COPY", line 6
    ORA-06512: at line 8
    create or replace
    procedure TABLE_COPY(
    TABLE1 varchar2,
    TABLE2 varchar2)
    is
    begin
    execute immediate 'insert into '||TABLE2||' (select * from '||TABLE1||')';
    end;
    Edited by: user9213000 on 24-Jan-2013 07:38

    user9213000 wrote:
    I want to copy the contents of one table into another using execute immediate.
    This keeps failing with the following error
    ORA-00903: invalid table name
    ORA-06512: at "TABLE_COPY", line 6
    ORA-06512: at line 8
    create or replace
    procedure TABLE_COPY(
    TABLE1 varchar2,
    TABLE2 varchar2)
    is
    begin
    execute immediate 'insert into '||TABLE2||' (select * from '||TABLE1||')';
    end;
    Edited by: user9213000 on 24-Jan-2013 07:38The standard advice when (ab)using EXECUTE IMMEDIATE is to compose the SQL statement in a single VARCHAR2 variable
    Then print the variable before passing it to EXECUTE IMMEDIATE.
    COPY the statement & PASTE into sqlplus to validate its correctness.

  • Unable to Create Partitioned Table

    Hi All,
    I was trying to create a partitioned table using following
    Create table customers (custcode number(5),
    Name varchar2(20),
    Addr varchar2(10),
    City varchar2(20),
    Bal number(10,2))
    Partition by list (city),
    Partition north_India values (‘DELHI’,’CHANDIGARH’),
    Partition east_India values (‘KOLKOTA’,’PATNA’),
    Partition south_India values (‘HYDERABAD’,’BANGALORE’,’CHENNAI’),
    Partition west India values (‘BOMBAY’,’GOA’);
    It is throwing me an error
    ORA-00922: missing or invalid option
    Will you please tell me what is wrong with this query? Is it possible to create partitioned table using select statement (create table as select... Partition by...)?
    Regards
    ~Pravin

    Pravin
    Will you please tell me what is wrong with this query?I see 4 errors in the syntax. Therefore, I strongly suggest you to have a lock to this:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#i2146309
    In addition, have a look to the error message. If I run your script in SQL*Plus it clearly shows where the problem is. E.g.:
    SQL> Create table customers (custcode number(5),
      2  Name varchar2(20),
      3  Addr varchar2(10),
      4  City varchar2(20),
      5  Bal number(10,2))
      6  Partition by list (city),
      7  Partition north_India values (‘DELHI’,’CHANDIGARH’),
      8  Partition east_India values (‘KOLKOTA’,’PATNA’),
      9  Partition south_India values (‘HYDERABAD’,’BANGALORE’,’CHENNAI’),
    10  Partition west India values (‘BOMBAY’,’GOA’);
    Partition by list (city),
    ERROR at line 6:
    ORA-00922: missing or invalid option
    Is it possible to create partitioned table using select statement?Yes. With the usual syntax.
    HTH
    Chris Antognini
    Author of Troubleshooting Oracle Performance, Apress 2008 (http://top.antognini.ch)

  • Error while creating partition table

    Hi frnds i am getting error while i am trying to create a partition table using range
    getting error ORA-00906: missing left parenthesis.I used the following statement to create partition table
    CREATE TABLE SAMPLE_ORDERS
    (ORDER_NUMBER NUMBER,
    ORDER_DATE DATE,
    CUST_NUM NUMBER,
    TOTAL_PRICE NUMBER,
    TOTAL_TAX NUMBER,
    TOTAL_SHIPPING NUMBER)
    PARTITION BY RANGE(ORDER_DATE)
    PARTITION SO99Q1 VALUES LESS THAN TO_DATE(‘01-APR-1999’, ‘DD-MON-YYYY’),
    PARTITION SO99Q2 VALUES LESS THAN TO_DATE(‘01-JUL-1999’, ‘DD-MON-YYYY’),
    PARTITION SO99Q3 VALUES LESS THAN TO_DATE(‘01-OCT-1999’, ‘DD-MON-YYYY’),
    PARTITION SO99Q4 VALUES LESS THAN TO_DATE(‘01-JAN-2000’, ‘DD-MON-YYYY’),
    PARTITION SO00Q1 VALUES LESS THAN TO_DATE(‘01-APR-2000’, ‘DD-MON-YYYY’),
    PARTITION SO00Q2 VALUES LESS THAN TO_DATE(‘01-JUL-2000’, ‘DD-MON-YYYY’),
    PARTITION SO00Q3 VALUES LESS THAN TO_DATE(‘01-OCT-2000’, ‘DD-MON-YYYY’),
    PARTITION SO00Q4 VALUES LESS THAN TO_DATE(‘01-JAN-2001’, ‘DD-MON-YYYY’)
    ;

    More than one of them. Try this instead:
    CREATE TABLE SAMPLE_ORDERS
    (ORDER_NUMBER NUMBER,
    ORDER_DATE DATE,
    CUST_NUM NUMBER,
    TOTAL_PRICE NUMBER,
    TOTAL_TAX NUMBER,
    TOTAL_SHIPPING NUMBER)
    PARTITION BY RANGE(ORDER_DATE) (
    PARTITION SO99Q1 VALUES LESS THAN (TO_DATE('01-APR-1999', 'DD-MON-YYYY')),
    PARTITION SO99Q2 VALUES LESS THAN (TO_DATE('01-JUL-1999', 'DD-MON-YYYY')),
    PARTITION SO99Q3 VALUES LESS THAN (TO_DATE('01-OCT-1999', 'DD-MON-YYYY')),
    PARTITION SO99Q4 VALUES LESS THAN (TO_DATE('01-JAN-2000', 'DD-MON-YYYY')),
    PARTITION SO00Q1 VALUES LESS THAN (TO_DATE('01-APR-2000', 'DD-MON-YYYY')),
    PARTITION SO00Q2 VALUES LESS THAN (TO_DATE('01-JUL-2000', 'DD-MON-YYYY')),
    PARTITION SO00Q3 VALUES LESS THAN (TO_DATE('01-OCT-2000', 'DD-MON-YYYY')),
    PARTITION SO00Q4 VALUES LESS THAN (TO_DATE('01-JAN-2001', 'DD-MON-YYYY')))In the future, if you are having problems, go to Morgan's Library at www.psoug.org.
    Find a working demo, copy it, then modify it for your purposes.

  • Error in creating partition table in oracle spatial by ankur

    Hi,
    Am working on Oracle 10.2.0.3
    Am not able to create partition table in Oracle
    i have all the required columns in node and edge table ......the moment i try to create partition table using exec sdo_router_partition.partion_router i get the following error:
    ERROR at line 1:
    ORA-00947: not enough values
    ORA-06512: at "MDSYS.SDO_ROUTER_PARTITION", line 1510
    ORA-06512: at "MDSYS.SDO_ROUTER_PARTITION", line 661
    ORA-06512: at line 1
    Can someone help ??

    hey i have found the solution myself :)

  • Delete From More than 1 table without using execute immediate

    Hi,
    Am new to PL/SQL, I had been asked to delete few of the table for my ETL jobs in Oracle 10G R2. I have to delete(truncate) few tables and the table names are in another table with a flag to delete it or not. So, when ever I run the job it should check for the flag and for those flag which is 'Y' then for all those tables should be deleted without using the Execute Immediate, because I dont have privilages to use "Execute Immediate" statement.
    Can anyone help me in how to do this.
    Regards
    Senthil

    Then tell you DBA's, or better yet their boss, that they need some additional training in how Oracle actually works.
    Yes, dynamic sql can be a bad thing when it is used to generate hundreds of identical queries that differ ony in the literals used in predicates, but for something like a set of delte table statements or truncate table statements, dynamic sql is no different in terms of the effect on the shared pool that hard coding the sql statements.
    This is a bad use of dynamic sql, because it generates a lot of nearly identical statements due to the lack of bind variables. It is the type of thing your DBA's should, correctly, bring out the lead pipe for.
    DECLARE
       l_sql VARCHAR2(4000);
    BEGIN
       FOR r in (SELECT account_no FROM accounts_to_delete) LOOP
          l_sql := 'DELETE FROM accounts WHERE account_no = '||r.account_no;
          EXECUTE IMMEDIATE l_sql;
       END LOOP;
    END;This will result in one sql statement in the shared pool for every row in accounts_to_delete. Although there is much else wrong with this example, from the bind variable perspective it should be re-written to use bind variables like:
    DECLARE
       l_sql  VARCHAR2(4000);
       l_acct NUMBER;
    BEGIN
       FOR r in (SELECT account_no FROM accounts_to_delete) LOOP
          l_sql := 'DELETE FROM accounts WHERE account_no = :b1';
          EXECUTE IMMEDIATE l_sql USING l_acct;
       END LOOP;
    END;However, since you cannot bind object names into sql statements, the difference in terms of the number of statements that end up in the shared pool between this:
    DECLARE
       l_sql VARCHAR2(4000);
    BEGIN
       FOR r in (SELECT table_name, delete_tab, trunc_tab
                 FROM tables_to_delete) LOOP
          IF r.delete_tab = 'Y' THEN
             l_sql := 'DELETE FROM '||r.table_name;
          ELSIF r.trunc_tab = 'Y' THEN
             l_sql := 'TRUNCATE TABLE '||r.table_name;
          ELSE
             l_sql := NULL;
          END IF;
          EXECUTE IMMEDIATE l_sql;
       END LOOP;
    END;and something like this:
    BEGIN
       DELETE FROM tab1;
       DELETE FROM tab2;
       EXECUTE IMMEDIATE 'TRUNCTE TABLE tab3';
    END;or this as a sql script
    DELETE FROM tab1;
    DELETE FROM tab2;
    TRUNCTE TABLE tab3;is absolutley nothing.
    Note that if you are truncating some of the tables, and wnat/need to use a stored procedure, you are going to have to use dynamic sql for the truncates anyway since trncate is ddl, and you cannot do ddl in pl/sql wiothout using dynamic sql.
    John

  • Create partition table upto level 3

    Hi All,
    I want to create partition table using 3 columns. could you please tell me is that possible to do in oracle 11G. if can please tell me the way to create
    PARTITION BY LIST (Acct_type)
    SUBPARTITION BY LIST (PERIOD)
    and needs to partition this using another column.( account_source)
    please help me.
    Regards,
    krish

    Hello,
    3 levels of partition are not possible.
    But perhaps you can combine 2 levels as follows:
    With Oracle 11g you can use a virtual column:
    CREATE TABLE F_ACCOUNT_PART
    acc_type varchar2(100),
    acc_source varchar2(100),
    period date,
    acc_type_source varchar2(201) as (acc_type||'_'||acc_source) )
    PARTITION BY LIST (acc_type_source)
    PARTITION FA_AA_ACC1 VALUES ('AA-ACC1') TABLESPACE USERS,
    PARTITION FA_BB_ACC1 VALUES ('BB-ACC1') TABLESPACE USERS,
    PARTITION FA_CC_ACC1 VALUES ('CC-ACC1') TABLESPACE USERS,
    PARTITION FA_DD_ACC1 VALUES ('DD-ACC1') TABLESPACE USERS,
    PARTITION FA_AA_ACC2 VALUES ('AA-ACC2') TABLESPACE USERS,
    PARTITION FA_BB_ACC2 VALUES ('BB-ACC2') TABLESPACE USERS,
    PARTITION FA_CC_ACC2 VALUES ('CC-ACC2') TABLESPACE USERS,
    PARTITION FA_DD_ACC2 VALUES ('DD-ACC2') TABLESPACE USERS,
    PARTITION all_other VALUES (DEFAULT) TABLESPACE USERS
    )For versions prior to 11g you have to build a new column acc_type_source and fill the values cancatenated.
    Maik

  • Create temp table in PL/SQL

    How to create temp table in PL/SQL procedure/function?
    In SQL plus, I can create a table using
    create table <table name>
    on commit reserve ..

    If you're referring to temp table similar as the temp table of informix .. the answer is you cannot create a temp table in oracle than will automatically be cleaned by oracle session.
    However its possible to create a remporary table but this will be a permanent part of your schema.. and you'll be the one responsible for dropping this table.
    regards,
    Victor ([email protected])
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Mike Chan:
    How to create temp table in PL/SQL procedure/function?
    In SQL plus, I can create a table using
    create table <table name>
    on commit reserve ..
    <HR></BLOCKQUOTE>
    null

Maybe you are looking for

  • Creating an xml document from filenames of selected files

    Hey guys, I am totally new to automator and applescript so please be kind! I have an xml/flash image portfolio website which has image galleries. Each gallery has an xml document which specifies a thumbnail and full size photo to be displayed in the

  • The material document 4900000476 2009 does not have materials relevant for

    Dear SAP Experts, I have created the Subcontracting Purchase order for the finished product.In Material Data I have entered the subcomponents.I have done the transfer posting of that particular components to that vendor with 541 Mov Type, When i go t

  • Nothing listed under Analysis | Reports in FDM Web Client

    When navigating to Analysis | Reports in the FDM web client, we do not have anything listed on the page. We just have a blank white panel, with an "English Groups" (unpopulated) and a format drop-down list, and a "Publish" button. We have run numerou

  • MacBook Pro Retina stopped detecting wifi network in one location.

    Hey everyone, experiencing kind of a weird problem and was hoping someone would be able to help.   I was doing some studying at a Starbucks, connected to their WiFi network when randomly my computer lost connection to their network and was no longer

  • Project-network- subactivities

    Hi Guru's In my business scanerio, i have an project in which there is sub- activity( eg planing, designing, testing etc. all are service activity) my resouces ( employee in service project) will be allocated in subactivity level & their invoice shou