Dbms_metadata.get_ddl returns unusable create index statement

Hello everybody,
I'm trying to write a procdeure that automatically deletes all duplicate record and rebuild all table indexes after an sqlldr load with direct path.
In short the procdeure indentifies the indexes, read them using dbms_metadata.get_ddl('INDEX', 'IDX_UNIQUE_TEST') drops them, deletes the duplicated records and then recreates the indexes.
However after the sqlldr, get_ddl function returns the following result:
CREATE UNIQUE INDEX "MYUSER"."IDX_UNIQUE_TEST" ON "EDWH"."FOREX_ORD_PRC_INTRADAY" "C_ORD_TYP", "C_ORD", "D_INI_VAL", "C_PRC_TYP")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "MYTABLESPACE"
ALTER INDEX "MYUSER"."IDX_UNIQUE_TEST"  UNUSABLE
As you can see there is an ALTER INDEX at the end that makes the whole statement invalid.
Has anyone already seen that? I've tried to google it but with no chance. Help with this would really be appreciated.
Thanks in advance
Ross

Mmh, yes it is unusable before the get_ddl, but how comes it returns both the create index and the alter index unusable statements?
I've tried to make the index unusable with the alter index ... unusable statement but get_ddl still returned the create index only.
I'm guessing that production server (10.2.0.4.0) is behaving differently from test machine (9.2.0.4.0). Any idea on that?
Ross

Similar Messages

  • Dbms_metadata.get_ddl returns text of table script but not the view

    Hi all
    I am using a DDL trigger like
    CREATE OR REPLACE TRIGGER SYS.log_ddl AFTER DDL
    ON DATABASE
    declare
    n_text varchar2(2000);
    begin
    if ora_sysevent='CREATE' and ora_dict_obj_type='VIEW' then
    select dbms_metadata.get_ddl
    (ora_dict_obj_type ,ora_dict_obj_name,ora_dict_obj_owner)
    into n_text from dual;
    elsif ora_sysevent='CREATE' and ora_dict_obj_type='TABLE' then
    select dbms_metadata.get_ddl
    (ora_dict_obj_type ,ora_dict_obj_name,ora_dict_obj_owner) into n_text from dual
    end if;
    end;
    on execution
    the first condition produces an error if the view does not already exists
    ORA-31603: object "TEST" of type VIEW not found in schema "SHAI"
    but the second condition of table creation executs successfuly and return the script of the table
    what can be the main theory behind this.

    I think some of the bug fixes were targeted for 9.2.0.5, but I can't tell you for certain.
    One of the things I really don't like about DBMS_METADATA is that it returns an error if a specified object does not exist. For example, I created a sql script that would accept a schema name as the input parameter and would generate all the ddl for the schema. If the schema did not have a particular object, for example a sequence, the call to DBMS_METADATA to generate the sequence ddl would return an error instead of returning nothing. I had error checking in the script, so this caused problems. (Oracle's response is that this is expected behaviour).
    This might be what is happening with your call.
    Dan

  • Create Index statement doesnt propagate to Logical Standby

    Hi,
    We have a logical standby 10.2.0.3 for our primary database in 10.2.0.3. An index which was created in primary hasnt propagated to standby. The index cannot be seen in the standby . The index was not skipped or DML/DDLs on that particular table were not skipped as well. Any ideas about this behaviour ?

    Was it created with nologging option?
    Check for unrecoverable transactions:
    set linesize 132
    set pages 100
    col name format a55
    SELECT name, unrecoverable_change# FROM v$datafile;

  • DBMS_METADATA.GET_DDL doesn't include function parameters

    Sometimes, when I call DBMS_METADATA.GET_DDL to get the DDL statement for a function (which we always do to ensure we're starting from the source that's actually in production), the returned text doesn't include the parameters. Other times, it does, and I'm not able to see any pattern.
    I was going to just make a function and show the output, but that did show the parameters. Then I tried calling GET_DDL while logged in as SYS as SYSDBA on my development database, and I still did not get the parameters, so I don't think it's a permissions issue.
    Does anyone have any idea what's going on here?

    It's really difficult to show you exactly what I'm doing when I can't consistently reproduce the problem, as I described.
    But here, I'll try.
    declare
         the_ddl clob;
    begin
         the_ddl := dbms_metadata.get_ddl('FUNCTION', '*****', '*****');
         dbms_output.enable(null);
         dbms_output.put_line(the_ddl);
    end;
    /Sometimes, it produces output like this:
    CREATE OR REPLACE FUNCTION "*****"."*****" (
         ***** in varchar2,
         ***** in number,
    ) return *****
    ...And other times, it produces output like this:
    CREATE OR REPLACE FUNCTION "*****"."*****" return *****
    ...I am not able to determine any consistent reason for this. In our production database, I can log in as myself and get the parameters for a specific function, but another user (that our automated process uses) doesn't see the parameters. In my development database, I log in as myself and I do not see the parameters, but I still don't see them when I log in as SYS AS SYSDBA.
    For what it's worth, if I recreate the function on my development database, then subsequent calls do show the parameters.

  • How to suppress SCHEMA_OWNER when using DBMS_METADATA.GET_DDL

    Hi,
    I was wondering, is it possible to suppress the owner when using dbms_metadata.get_ddl?
    SQL> select * from v$version where rownum = 1
    BANNER                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    SQL> exec dbms_metadata.set_transform_param (dbms_metadata.session_transform,'SEGMENT_ATTRIBUTES',false)
    SQL> select dbms_metadata.get_ddl('TABLE','EMP') from dual
    DBMS_METADATA.GET_DDL('TABLE','EMP')                                           
      CREATE TABLE "SCOTT"."EMP"                                                   
       (     "EMPNO" NUMBER(4,0) NOT NULL ENABLE,                                      
         "ENAME" VARCHAR2(10),                                                         
         "JOB" VARCHAR2(9),                                                            
         "MGR" NUMBER(4,0),                                                            
         "HIREDATE" DATE,                                                              
         "SAL" NUMBER(7,2),                                                            
         "COMM" NUMBER(7,2),                                                           
         "DEPTNO" NUMBER(2,0)                                                          
       )I would like to get rid of the "SCOTT". Alternatively to change it into something else.
    Is that possible, without post processing the output, that is?
    Regards
    Peter

    Hi Karthick,
    I was afraid that would be the answer. It can be done, but it seems rather convoluted:
    SQL> create or replace function get_table_ddl(table_name    varchar2
                                            ,schema        varchar2 default user
                                            ,new_owner     varchar2 default null)
       return clob
    is
       v_handle        number;
       v_transhandle   number;
       v_ddl           clob;
    begin
       v_handle := dbms_metadata.open('TABLE');
       dbms_metadata.set_filter(v_handle, 'SCHEMA', schema);
       dbms_metadata.set_filter(v_handle, 'NAME', table_name);
       v_transhandle := dbms_metadata.add_transform(v_handle, 'MODIFY');
       dbms_metadata.set_remap_param(v_transhandle,'REMAP_SCHEMA',schema,new_owner);
       v_transhandle := dbms_metadata.add_transform(v_handle, 'DDL');
       dbms_metadata.set_transform_param(v_transhandle,'SEGMENT_ATTRIBUTES',false);
       v_ddl := dbms_metadata.fetch_clob(v_handle);
       dbms_metadata.close(v_handle);
       return v_ddl;
    end;
    Function created.
    SQL> select get_table_ddl('EMP') from dual
    GET_TABLE_DDL('EMP')                                                           
      CREATE TABLE "EMP"                                                           
       (     "EMPNO" NUMBER(4,0) NOT NULL ENABLE,                                      
         "ENAME" VARCHAR2(10),                                                         
         "JOB" VARCHAR2(9),                                                            
         "MGR" NUMBER(4,0),                                                            
         "HIREDATE" DATE,                                                              
         "SAL" NUMBER(7,2),                                                            
         "COMM" NUMBER(7,2),                                                           
         "DEPTNO" NUMBER(2,0)                                                          
    1 row selected.Regards
    Peter

  • ORA-01502 error in case of unusable unique index and bulk dml

    Hi, all.
    The db is 11.2.0.3 on a linux machine.
    I made a unique index unusable, and issued a dml on the table.
    Howerver, oracle gave me ORA-01502 error.
    In order to avoid ORA-01502 error, do I have to drop the unique index ,and do bulk dml, and recreate the index?
    Or Is there any other solution without re-creating the unique index?
    create table hoho.abcde as
    select level col1 from dual connect by level <=1000
    10:09:55 HOHO@PD1MGD>create unique index hoho.abcde_dx1 on hoho.abcde (col1);
    Index created.
    10:10:23 HOHO@PD1MGD>alter index hoho.abcde_dx1 unusable;
    Index altered.
    Elapsed: 00:00:00.03
    10:11:27 HOHO@PD1MGD>delete from hoho.abcde where rownum < 11;
    delete from hoho.abcde where rownum < 11
    ERROR at line 1:
    ORA-01502: index 'HOHO.ABCDE_DX1' or partition of such index is in unusable stateThanks in advance.
    Best Regards.

    Hi. all.
    The following is from "http://docs.oracle.com/cd/E14072_01/server.112/e10595/indexes002.htm#CIHJIDJG".
    Is there anyone who can show me a tip to avoid the following without dropping and re-creating an unique index?
    •DML statements terminate with an error if there are any unusable indexes that are used to enforce the UNIQUE constraint.
    Unusable indexes
    An unusable index is ignored by the optimizer and is not maintained by DML. One reason to make an index unusable is if you want to improve the performance of bulk loads. (Bulk loads go more quickly if the database does not need to maintain indexes when inserting rows.) Instead of dropping the index and later recreating it, which requires you to recall the exact parameters of the CREATE INDEX statement, you can make the index unusable, and then just rebuild it. You can create an index in the unusable state, or you can mark an existing index or index partition unusable. The database may mark an index unusable under certain circumstances, such as when there is a failure while building the index. When one partition of a partitioned index is marked unusable, the other partitions of the index remain valid.
    An unusable index or index partition must be rebuilt, or dropped and re-created, before it can be used. Truncating a table makes an unusable index valid.
    Beginning with Oracle Database 11g Release 2, when you make an existing index unusable, its index segment is dropped.
    The functionality of unusable indexes depends on the setting of the SKIP_UNUSABLE_INDEXES initialization parameter.
    When SKIP_UNUSABLE_INDEXES is TRUE (the default), then:
    •DML statements against the table proceed, but unusable indexes are not maintained.
    •DML statements terminate with an error if there are any unusable indexes that are used to enforce the UNIQUE constraint.
    •For non-partitioned indexes, the optimizer does not consider any unusable indexes when creating an access plan for SELECT statements. The only exception is when an index is explicitly specified with the INDEX() hint.
    •For a partitioned index where one or more of the partitions are unusable, the optimizer does not consider the index if it cannot determine at query compilation time if any of the index partitions can be pruned. This is true for both partitioned and non-partitioned tables. The only exception is when an index is explicitly specified with the INDEX() hint.
    When SKIP_UNUSABLE_INDEXES is FALSE, then:
    •If any unusable indexes or index partitions are present, any DML statements that would cause those indexes or index partitions to be updated are terminated with an error.
    •For SELECT statements, if an unusable index or unusable index partition is present but the optimizer does not choose to use it for the access plan, the statement proceeds. However, if the optimizer does choose to use the unusable index or unusable index partition, the statement terminates with an error.Thanks in advance.
    Best Regards.

  • Create index in SQL using a variable

    Hello, need to programatically create an index in a SQL script using a variable for the tablespace name.
    VARIABLE ts_name VARCHAR2(50)
    BEGIN
    SELECT tablespace_name INTO :ts_name
    from user_indexes
    where TABLE_NAME = 'PREFERRED_CUSTOMER';
    end;
    How would I now issue a create index statement like the one below but substituting the tablespace name with the ts_name variable from above?
    CREATE UNIQUE INDEX XAK2PREFERRED_CUSTOMER ON FOCUS.PREFERRED_CUSTOMER (PREFERRED_CUST_NUM) TABLESPACE FOCUSPCIX;
    Thank you,
    David

    I am upgrading a customer database to unicode and I need to convert certain columns to NCHAR base. I am using an alter table command to do this. To make it fasted I need to drop indexes and recreate them at the end. Not all of our customers have used the default tablespace naming conventions so rather than having to change the script each time I was hoping to make the tablespace name portion of the create index DDL dynamic. Thank you,
    David

  • DBMS_METADATA.GET_DDL Not working

    Hi All,
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    I am creating table as:
    create table XX as select * from fnd;
       select   DBMS_METADATA.GET_DDL('TABLE','xx') from dualI get the below given error:
    Error starting at line 1 in command:
    select DBMS_METADATA.GET_DDL('TABLE','xx') from dual
    Error report:
    SQL Error: ORA-31603: object "xx" of type TABLE not found in schema "A395513"
    ORA-06512: at "SYS.DBMS_METADATA", line 1548
    ORA-06512: at "SYS.DBMS_METADATA", line 1585
    ORA-06512: at "SYS.DBMS_METADATA", line 1902
    ORA-06512: at "SYS.DBMS_METADATA", line 2793
    ORA-06512: at "SYS.DBMS_METADATA", line 4333
    ORA-06512: at line 1
    31603. 00000 - "object \"%s\" of type %s not found in schema \"%s\""
    *Cause:    The specified object was not found in the database.
    *Action:   Correct the object specification and try the call again.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Oracle names are stored in dictionary in upper case (unless quoted name is used at create time). Use XX as table name:
    SQL> create table XX as select * from emp;
    Table created.
    SQL> set long 1000
    SQL> select   DBMS_METADATA.GET_DDL('TABLE','xx') from dual;
    ERROR:
    ORA-31603: object "xx" of type TABLE not found in schema "SCOTT"
    ORA-06512: at "SYS.DBMS_METADATA", line 1548
    ORA-06512: at "SYS.DBMS_METADATA", line 1585
    ORA-06512: at "SYS.DBMS_METADATA", line 1902
    ORA-06512: at "SYS.DBMS_METADATA", line 2793
    ORA-06512: at "SYS.DBMS_METADATA", line 4333
    ORA-06512: at line 1
    no rows selected
    SQL> select   DBMS_METADATA.GET_DDL('TABLE','XX') from dual;
    DBMS_METADATA.GET_DDL('TABLE','XX')
      CREATE TABLE "SCOTT"."XX"
       (    "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)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    DBMS_METADATA.GET_DDL('TABLE','XX')
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    SQL> SY.

  • DBMS_METADATA.get_ddl issues

    When you run, select dbms_metadata.get_ddl('USER', 'scott') FROM DUAL; gives following error...
    ORA-31603: object "scott" of type USER not found in schema "SYSTEM"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA", line 2805
    ORA-06512: at "SYS.DBMS_METADATA", line 4333
    ORA-06512: at line 1
    But this works...
    select dbms_metadata.get_ddl('USER', UPPER('scott')) FROM DUAL ;
    This gives result..
    DBMS_METADATA.GET_DDL('USER',U
    CREATE USER "SCOTT" IDENTIFIED BY VALUES 'F894844C34402B67'
    DEFAULT TABLESPACE "USERS"
    TEMPORARY TABLESPACE "TEMP"
    PASSWORD EXPIRE
    ACCOUNT LOCK
    I think the supplied object_name is case-sensitive. but why is it so.

    SQL> create user new_user identified by pwd;
    User created.
    SQL> select dbms_metadata.get_ddl('USER','NEW_USER') from dual;
    DBMS_METADATA.GET_DDL('USER','NEW_USER')
       CREATE USER "NEW_USER" IDENTIFIED BY VALUES 'D1ADB54B2BC01B82'
          TEMPORA
    SQL> select dbms_metadata.get_ddl('USER','new_user') from dual;
    ERROR:
    ORA-31603: object "new_user" of type USER not found in schema "SYSADM"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA", line 653
    ORA-06512: at "SYS.DBMS_METADATA", line 1260
    ORA-06512: at line 1
    no rows selected
    SQL> create user "new_user" identified by pwd;
    User created.
    SQL> select dbms_metadata.get_ddl('USER','new_user') from dual;
    DBMS_METADATA.GET_DDL('USER','NEW_USER')
       CREATE USER "new_user" IDENTIFIED BY VALUES 'D1ADB54B2BC01B82'
          TEMPORAnew_user and "new_user" are two differents users.
    Nicolas.

  • Error in dbms_metadata.get_ddl ...

    Hi,
    I am using
    "Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    PL/SQL Release 9.2.0.6.0 - Production" .
    I am trying to Execute dbms_metadata.get_ddl to get the table structure
    select dbms_metadata.get_ddl( 'TABLE', 'EMP', 'SCOTT' ) from dual ;
    I am getting following error
    ERROR:
    ORA-06502: PL/SQL: numeric or value error
    ORA-31605: the following was returned from LpxXSLResetAllVars in routine
    kuxslResetParams:
    LPX-1: NULL pointer
    ORA-06512: at "SYS.UTL_XML", line 0
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 3430
    ORA-06512: at "SYS.DBMS_METADATA_INT", line 4259
    ORA-06512: at "SYS.DBMS_METADATA", line 458
    ORA-06512: at "SYS.DBMS_METADATA", line 615
    ORA-06512: at "SYS.DBMS_METADATA", line 1221
    ORA-06512: at line 1
    Can any one help me in this regard how to overcome the Error ?
    Thanks in Advance
    Venkatesh .P

    Hi,
    There was a bug #2736436 in 9.2.0.1 and 9.2.0.5 :
    If a constraint is against a partitioned table then DBMS_METADATA.GET_DDL returns ORA-31605 and LPX-410 when attempting to get the DDL of the constraint.
    Seems to be solve in 9.2.0.6 patchset.
    Hmm, it seems that you're already in 9.2.0.6...
    Nicolas.

  • WHEN TO USE LOGGER IN CREATE INDEX?

    HI ALL,
    WHEN TO USE LOGGER IN CREATE INDEX STATEMENT? AND WHEN TO USE NOLOGGING?
    HOW IS INDEX PHYSICALLY STORED IN DATABASE?
    THANKS IN ADVANCE.
    SANDESH

    NOLOGGING means that information is not written into the redo logs (relatively faster than LOGGING). However, this also means that if you need to recover your database, the index cannot be recovered (since the info cannot be found in the redo logs).
    Use NOLOGGING if you need the speed (big indexes) and/or you don't care about being able to recover the index (i.e. if it is acceptable if you recreate it manually after possible database recovery). Alternatively, create the index with NOLOGGING, alter the index to LOGGING and backup the database. Only after the successfull backup will the index be recoverable (with that backup, not an older one).
    Typically you should use LOGGING rather than NOLOGGING because the overhead of creating the backup/recovery and insecurity on being able to recover (and pressure that goes along with it) is to great. This option will be handy only in rare cases (e.g. when creating staging area tables/indexes in a datawarehouse. They don't need recovery and will therefore speed up when using NOLOGGING).
    Hope this helps,
    Lennert

  • Problems with creating index

    I have over 1500MB free in tablespace
    I use for indexes. When I attempt to create
    index which should have about 300MB
    it ends with error ORA-01652
    unable to extend temp segment in tablespace
    where my indexes reside.
    Why Oracle needs so much space to create an index,
    is there any way to do it without increasing
    the size of tablespace?

    Oracle needs no extra space in the tablespace beyond what is required to hold the index (INITIAL plus any additional extents allocated). My guess would be that you do not have a large enough contiginous chunk of free space to hold an additional extent.
    If your tablespace is dictionary managed, look at the INITIAL, NEXT and PCTINCREASE parameters of your CREATE INDEX statement (or the tablespace defaults if you are not supplying them). Compare these to the sizes of the free space chunks in your index tablespace.
    SELECT file_id, block_id, blocks, bytes
    FROM dba_free_space
    WHERE tablespace_name = 'YOUR_INDEX_TBS'
    ORDER BY blocks DESCcompare the sizes of the first few rows here with the sizes of INITIAL and NEXT.
    HTH
    John

  • Unable to create index ..can anyone help me

    Dan,
    I have created the following table and the values are as following,
    create table zonetemp(
    name varchar2(15),
    SHAPE MDSYS.SDO_GEOMETRY)
    insert into zonetemp values('Raju',
    MDSYS.SDO_GEOMETRY(2003,null,null,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),
    MDSYS.SDO_ORDINATE_ARRAY(10,30,40,10)))
    insert into zonetemp values('Kalpan',
    MDSYS.SDO_GEOMETRY(2003,null,null,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),
    MDSYS.SDO_ORDINATE_ARRAY(0,20,40,0)))
    insert into zonetemp values('Chetan',
    MDSYS.SDO_GEOMETRY(2003,null,null,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),
    MDSYS.SDO_ORDINATE_ARRAY(0,40,40,20)))
    commit
    I am unable to index the table.
    exec geocoder_http.setup_locator_index('ZONETEMP','SHAPE');
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13219: failed to create spatial index table [ZONET_SHAPE_IDX_HL13N1$]
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 7
    ORA-06512: at line 1
    ORA-06512: at "MDSYS.GEOCODER_HTTP", line 168
    ORA-06512: at line 1
    My Query :
    SELECT NAME FROM ZONETEMP A
    WHERE SDO_FILTER(A.SHAPE,MDSYS.SDO_GEOMETRY(2001,null,MDSYS.SDO_POINT_TYPE(20,20, 0), NULL, NULL)),'QUERYTYPE='WINDOW') ='TRUE'
    Basically these gemoteries are polygon.
    what i want to do is query this table with the operator SDO_FILTER with reference geomotry as POINT and find the corresponding polygon in which it is found.
    Is it Possible?Is this a valid Query?
    N.B for the ploygon definations one can asssume a gird layout of 40*40.
    null

    Hi Raju,
    There are a few things I would change below.
    The first is that optimized rectangles (which you are using) need to be specified as lower left then upper right, assuming the lowest values are in the lower left corner of the coordinate system.
    The way you've specified them is upper left, lower right which will not work.
    The second thing I would change is your create index statement. You shouldn't be using locater to create the index - locator is a separate product should be used only with point geometries.
    Your create index statement should look something like this:
    create index zonetemp_sidx on zonetemp(shape)
    indextype is mdsys.spatial_index
    parameters ('sdo_level=NN');
    where NN above is an integer number representing the tiling level you are going to use for the index. This is workload dependent, but I will give you a range of 8-12 to start with - you can protype using real data and figure out what gives you the best performance - if it is 12 you may want to go higher.
    Also, you will have had to preload user_sdo_geom_metadata.
    Finally, your query looks good, although I would change it slightly to set the third ordinate to NULL rather than 0, i.e.:
    SELECT NAME
    FROM ZONETEMP A
    WHERE SDO_FILTER (A.SHAPE,
    MDSYS.SDO_GEOMETRY(2001,null,
    MDSYS.SDO_POINT_TYPE(20,20,NULL),
    NULL, NULL)),'QUERYTYPE='WINDOW')
    ='TRUE'
    Hope this helps,
    dan

  • Create Create table statement dynamicallly

    I am trying to create a SP that  return a “Create table  “statement dynamically using a table called “Employee” in database. How can I create a dynamic Create Table
    statement using sys.table? The create table statement should contains all the columns from Employee table.. i am using SQL server 2008 R2

    Hi SSAS_5000,
    If you don't care about the constraints,dependency on the Table Employee and what you'd like is the table structure, you may use the below statement where the create statement generated from the SP is executed.
    SELECT TOP 1 * INTO desiredTable FROM Eemploy;
    TRUNCATE TABLE desiredTable
    If you have question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • How to create index on Global Temporary Table?

    Hi,
    Can i create index with storage parameters on global temporary table? If possible, how?
    Thanks

    Yes. You can create an index on a global temporary table (GTT) with the regular 'CREATE INDEX' statement.
    Not sure though if you are allowed to locate it in a specific tablespace. Why would you want to do that anyway?
    My guess is, like the GTT, indexes on GTT's also default to the temporary tablespace.

Maybe you are looking for

  • OS command syntax to run RPG program (FTP Adapter)

    Hi All, I try to run RPG program from File Adapter OS command, I do not know correct OS syntax. RPG program will create sales order in JD, PI and JD is on IBM i5 OS. I am able to run OS command like "mkdir" but i do not know correct syntax to run RPG

  • PNA Guided Calibration: GPIB write error in for loop

    Hi, I have a LabVIEW program that creates a Guided Power Calibration on a PNA. After initializing everything properly, I have a for loop that loops through all the manual steps that the user must go through (ex: Connect Channel A of Power meter to Po

  • Permission not given to copy books to Nook after download

    permission not given to copy books to Nook after downloading to computer. What change needs to be made?

  • Unable to process file to proxy 40 mb file

    Hi Friends, I am encountering the error when i am trying to send 40 mb file via file to proxy, SAP PI Version is 7.1 Error Message in RWB: Transmitting the message to endpoint http://p1342134dev200.test.lichtsinfotech.co.uk:50000/sap/xi/engine?type=e

  • Where can i download Personal Oracle7

    Where can i download free personal oracle 7 for Windows98? So that we may better diagnose DOWNLOAD problems, please provide the following information. - Server name - Filename - Date/Time - Browser + Version - O/S + Version - Error Msg