Querying 2.5D data in Oracle 11g

I'm trying to use the SDO_RELATE function on some 2.5D data in 11g and have some questions:
Lets say if I have two tables with some points in one and two polygons in the other:
-- TEST_TABLE_A
CREATE TABLE TEST_TABLE_A (
VALUE          VARCHAR2(100),
GEOMETRY     MDSYS.SDO_GEOMETRY);
-- Metadata 
INSERT INTO user_sdo_geom_metadata VALUES ('TEST_TABLE_A','GEOMETRY', 
SDO_DIM_ARRAY(
SDO_DIM_ELEMENT('X', -10000000, 10000000, .001),
SDO_DIM_ELEMENT('Y', -10000000, 10000000, .001),
SDO_DIM_ELEMENT('Z', -100000, 100000, .001))
, 262152);
-- Create an index with sdo_indx_dims=3
CREATE INDEX TEST_TABLE_A_SPIND ON TEST_TABLE_A (GEOMETRY)
INDEXTYPE IS MDSYS.SPATIAL_INDEX
PARAMETERS ('sdo_indx_dims=3');
INSERT INTO TEST_TABLE_A (VALUE, GEOMETRY) VALUES
('POINT1', SDO_GEOMETRY(3001, 262152, SDO_POINT_TYPE(561802.689, 839675.061, 1), NULL, NULL));
INSERT INTO TEST_TABLE_A (VALUE, GEOMETRY) VALUES
('POINT2', SDO_GEOMETRY(3001, 262152, SDO_POINT_TYPE(561802, 839675, 1), NULL, NULL));
INSERT INTO TEST_TABLE_A (VALUE, GEOMETRY) VALUES
('POINT3', SDO_GEOMETRY(3001, 262152, SDO_POINT_TYPE(561808.234, 839662.731, 1), NULL, NULL));
-- TEST_TABLE_A
CREATE TABLE TEST_TABLE_B (
VALUE          VARCHAR2(100),
GEOMETRY     MDSYS.SDO_GEOMETRY);
-- Metadata
INSERT INTO user_sdo_geom_metadata VALUES ('TEST_TABLE_B','GEOMETRY', 
SDO_DIM_ARRAY(
SDO_DIM_ELEMENT('X', -10000000, 10000000, .001),
SDO_DIM_ELEMENT('Y', -10000000, 10000000, .001),
SDO_DIM_ELEMENT('Z', -100000, 100000, .001))
, 262152);
-- Create an index with sdo_indx_dims=3
CREATE INDEX TEST_TABLE_B_SPIND ON TEST_TABLE_B (GEOMETRY)
INDEXTYPE IS MDSYS.SPATIAL_INDEX
PARAMETERS ('sdo_indx_dims=3');
INSERT INTO TEST_TABLE_B (VALUE, GEOMETRY) VALUES
('NON-FLAT POLYGON',
SDO_GEOMETRY(3003, 262152, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(561902.814, 839647.609, 10.022,
561891.19, 839652.227, 10.424, 561879.129, 839656.427, 10.932, 561867.892, 839659.927, 11.136, 561851.813, 839664.222, 11.594,
561831.714, 839668.612, 11.797, 561802.689, 839675.061, 11.975, 561778.461, 839680.155, 12.611, 561753.474, 839685.085, 12.153,
561750.606, 839685.756, 12.026, 561748.963, 839671.963, 15.309, 561747.899, 839659.764, 16.35, 561798.912, 839651.036, 15.801,
561808.702, 839650.973, 15.225, 561844.265, 839648.912, 14.62, 561874.846, 839647.57, 13.018, 561897.681, 839647.338, 10.704, 561902.814, 839647.609, 10.022))
INSERT INTO TEST_TABLE_B (VALUE, GEOMETRY) VALUES
('FLAT POLYGON',
SDO_GEOMETRY(3003, 262152, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(561902.814, 839647.609, 1,
561891.19, 839652.227, 1, 561879.129, 839656.427, 1, 561867.892, 839659.927, 1, 561851.813, 839664.222, 1,
561831.714, 839668.612, 1, 561802.689, 839675.061, 1, 561778.461, 839680.155, 1, 561753.474, 839685.085, 1,
561750.606, 839685.756, 1, 561748.963, 839671.963, 1, 561747.899, 839659.764, 1, 561798.912, 839651.036, 1,
561808.702, 839650.973, 1, 561844.265, 839648.912, 1, 561874.846, 839647.57, 1, 561897.681, 839647.338, 1,
561902.814, 839647.609, 1))
COMMIT;So now, lets say I want to find out what polygon interacts with a particular point.
I would write this query like:
SELECT     /*+ORDERED*/ b.value
FROM     TEST_TABLE_b b, TEST_TABLE_a a
WHERE     sdo_relate (a.geometry, b.geometry, 'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
AND      a.value = 'POINT1';Running this I get:
SELECT  /*+ORDERED*/ b.value
ERROR at line 1:
ORA-29902: error in executing ODCIIndexStart() routine
ORA-13243: specified operator is not supported for 3- or higher-dimensional R-tree
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333But if I reverse the table order I get the correct answer
SQL> SELECT      /*+ORDERED*/ b.value
  2  FROM       TEST_TABLE_a a, TEST_TABLE_b b
  3  WHERE      sdo_relate (a.geometry, b.geometry, 'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
  4  AND                a.value = 'POINT1';
VALUE
FLAT POLYGON
1 row selected.Q1. Why do I get an error if I reverse the table order?
Then if I try to find what points in the polygons:
SQL> SELECT      /*+ORDERED*/ a.value
  2  FROM       TEST_TABLE_b b, TEST_TABLE_a a
  3  WHERE      sdo_relate (b.geometry, a.geometry, 'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
  4  AND                b.value = 'NON-FLAT POLYGON';
no rows selected
SQL> SELECT      /*+ORDERED*/ a.value
  2  FROM       TEST_TABLE_b b, TEST_TABLE_a a
  3  WHERE      sdo_relate (b.geometry, a.geometry, 'MASK=ANYINTERACT QUERYTYPE=WINDOW') = 'TRUE'
  4  AND                b.value = 'FLAT POLYGON';
VALUE
POINT1
POINT2
POINT3
3 rows selected.So this suggests that the Z value is considered in the SDO_RELATE query.
Q2. Is there anyway to run an SDO_RELATE query in 11g with 2.5D data, but get it to ignore the Z value?
I have tried using sdo_indx_dims=2 when creating the indexes, but I get the same result.
I'm using Enterprise Edition Release 11.1.0.6.0 on Windows server 2003 32bit.

DBA-009 wrote:
thx but how i can mask data with above give environment?What does "mask data" mean to you and what is the environment you are referring to?
Telling us that you are using 11.1 helps. But it is far from a complete description of the environment. What edition of the database are you using? What options are installed? What Enterprise Manager packs are licensed? Is any of this changable? Could you license another option for the database or another pack for Enterprise Manager if that was necessary?
What does it mean to you to "mask data"? Do you want to store the data on disk and then mask the data in the presentation layer when certain people query it (i.e. store the patient's social security number in the database but only present ***-**- and the last 4 digits to certain sets of employees)? Do you want to hide entire fields from certain people? Do you want to change the data stored in the database when you are refreshing a lower environment with production data? If so, do you need and/or want this process to be either determinisitic or reversable or both?
Justin

Similar Messages

  • How to mask data in oracle 11g database release 1

    how to mask data in oracle 11g database release 1
    my environment is
    Database: 11g release 1
    os: AIX 6 (64 bit)
    GC:10g release 1

    DBA-009 wrote:
    thx but how i can mask data with above give environment?What does "mask data" mean to you and what is the environment you are referring to?
    Telling us that you are using 11.1 helps. But it is far from a complete description of the environment. What edition of the database are you using? What options are installed? What Enterprise Manager packs are licensed? Is any of this changable? Could you license another option for the database or another pack for Enterprise Manager if that was necessary?
    What does it mean to you to "mask data"? Do you want to store the data on disk and then mask the data in the presentation layer when certain people query it (i.e. store the patient's social security number in the database but only present ***-**- and the last 4 digits to certain sets of employees)? Do you want to hide entire fields from certain people? Do you want to change the data stored in the database when you are refreshing a lower environment with production data? If so, do you need and/or want this process to be either determinisitic or reversable or both?
    Justin

  • Concept about Query Scn in Dataguard in Oracle 11g

    What are the details concepts behind the’ query scn’ in Dataguard in Oracle 11g. I read the concept from Oracle Datagaurd 11g Handbook but it was not clear for me.

    It's the highest SCN to which data is synchronised between the primary and secondary in a way that the secondary guaranteed read-consistent. It's therefore not possible to query an active standby for data modified after that SCN. At any given time, there might be transactions committed on the primary but not yet shipped or applied to the standby. You're not allowed to see those on the secondary. Not sure how much more detailed you want to get, really.
    Edited by: Catfive Lander on Jan 15, 2013 4:15 AM

  • Send encrypted data from oracle 11g to Ms SQL Server 12

    Hi every body,
    we want to send encrypted data from oracle 11g to Ms SQL Server 12:
    - data are encrypted to oracle
    - data should be sent encrypted to Ms SQL server
    - data will be decrypted in Ms SQL server by sensitive users.
    How can we do this senario, any one has contact simlare senario?
    can we use asymetric encription to do this senario?
    Please Help!!
    Thanks in advance.

    Hi,
      What you want to do about copying data from Oracle to SQL*Server using insert will work with the 12c gateway.  There was a problem trying to do this using the 11.2 gateway but it should be fixed with the 12c gateway.
    If 'insert' doesn't work then you can use the SQLPLUS 'copy' command, for example -
    SQL> COPY FROM SCOTT/TIGER@ORACLEDB -
    INSERT SCOTT.EMP@MSQL -
    USING SELECT * FROM EMP
    There is further information in this note available on My Oracle Support -
    Copying Data Between an Oracle Database and Non-Oracle Foreign Data Stores or Databases Using Gateways (Doc ID 171790.1)
    However, if the data is encrypted already in the Oracle database then it will be sent in the encrypted format. The gateway cannot decrypt the data before it is sent to SQL*Server.
    There is no specific documentation about the gateways and TDE.  TDE encrypts the data as it is in the Oracle database but I doubt that SQL*Server will be able to de-encrypt the Oracle data if it is passed in encrypted format and as far as I know it is not designed to be used for non-Oracle databases.
    The Gateway encrypts data as it is sent across the network for security but doesn't encrypt the data at source in the same way as TDE does.
    Regards,
    Mike

  • Cannot load any data from Oracle 11G data base

    Hi Gurus!
    We using SAP BI 7.0.
    We have a source system, which is an Oracle Data warehouse based on Oracle 11G data bases.
    We created the source system in the BI without any problem.
    The connection is open to the Oracle databases.
    We created data source in the BI (trn. RSA1), and when we would like to Read Preview Data (Display data source, Preview tab) we can't see anything.
    The system is working, in trn. SM50 we see the process is runing, but we can't see any data (we wait more than 5000 sec.)
    When we tried data load from the source system, we got a short dump with time-out (after 50000 sec.)
    Summarize:
    - the connection to the source system is OK,
    - the process is running
    - we can't see any Preview data
    Can somebody help us?
    Thank you.
    Best regards,
    Gergely Gombos

    We really need to know what errors or warnings the Cache Agent is reporting in the TimesTen ttmesg.log files, when an autorefresh fails, to be able to give advice. If the size of the datastore segment is 512MB (though you don't say how that is divided between Perm, Temp and Log Buffer) but you're only using 30MB of Perm, then on the face of it, it's not a problem in running out of memory. You say autorefresh doesn't complete when "there are a lot of updates on cached tables" - do you mean updates being done directly on the rows in the TimesTen cachegroups, by users? If so, it sounds to me like you have locking contention between the user updates, and the autorefresh mechanism trying to bring new rows in from Oracle. Again, the ttmesg.log should spell this out.

  • SOS!!!!----Error for Loading data from Oracle 11g to Essbase using ODI

    Hi all.
    I want to load data from oracle database to essbase using ODI.
    I configure successfully the physical and logical Hyperion essbase on Topology Manager, and got the ESSBASE structure of BASIC app DEMO.
    The problem is.
    1. When I try view data right click on the essbase table,
    va.sql.SQLException: Driver must be specified
         at com.sunopsis.sql.SnpsConnection.a(SnpsConnection.java)
         at com.sunopsis.sql.SnpsConnection.testConnection(SnpsConnection.java)
         at com.sunopsis.sql.SnpsConnection.testConnection(SnpsConnection.java)
         at com.sunopsis.graphical.frame.b.jc.bE(jc.java)
         at com.sunopsis.graphical.frame.bo.bA(bo.java)
         at com.sunopsis.graphical.frame.b.ja.dl(ja.java)
         at com.sunopsis.graphical.frame.b.ja.<init>(ja.java)
         at com.sunopsis.graphical.frame.b.jc.<init>(jc.java)
    I got answer from Oracle Supporter It's ok, just omit it. Then the second problem appear.
    2. I create an interface between oracle database and essbase, click the option "staging area deffirent from target"(meaning the staging is created at oracle database), and using IKM SQL to Hyperion Essbase(metadata), execute this interface
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 61, in ?
    com.hyperion.odi.essbase.ODIEssbaseException: Invalid value specified [RULES_FILE] for Load option [null]
         at com.hyperion.odi.essbase.ODIEssbaseMetaWriter.validateLoadOptions(Unknown Source)
         at com.hyperion.odi.essbase.AbstractEssbaseWriter.beginLoad(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
         at org.python.core.PyMethod.__call__(PyMethod.java)
         at org.python.core.PyObject.__call__(PyObject.java)
         at org.python.core.PyInstance.invoke(PyInstance.java)
         at org.python.pycode._pyx1.f$0(<string>:61)
         at org.python.pycode._pyx1.call_function(<string>)
         at org.python.core.PyTableCode.call(PyTableCode.java)
         at org.python.core.PyCode.call(PyCode.java)
         at org.python.core.Py.runCode(Py.java)
         at org.python.core.Py.exec(Py.java)
    I'm very confused by it. Anybody give me a solution or related docs.
    Ethan.

    Hi ethan.....
    U always need a driver to be present inside ur <ODI installation directory>\drivers folder.....for both the target and the source......Because ojdbc14.jar is the driver for oracle already present inside the drivers folder ....we don't have to do anything for it.....But for Essbase ...you need a driver......If u haven't already done this.....try this.....
    Hope it helps...
    Regards
    Susane

  • Low performances when querying data dictionary Oracle 11g

    Query:
    SELECT
    ucc_fk.column_name FK_COLUMN_NAME,
    ucc_pk.table_name PK_TABLE_NAME,
    ucc_pk.column_name PK_COLUMN_NAME
    FROM user_constraints uc_fk
    INNER JOIN user_cons_columns ucc_fk ON (ucc_fk.constraint_name = uc_fk.constraint_name)
    INNER JOIN user_constraints uc_pk ON (uc_pk.constraint_name = uc_fk.r_constraint_name)
    INNER JOIN user_cons_columns ucc_pk ON (ucc_pk.constraint_name = uc_fk.r_constraint_name AND ucc_pk.position = ucc_fk.position)
    WHERE
    uc_fk.constraint_type = 'R' AND
    uc_pk.constraint_type = 'P' AND
    uc_fk.table_name = 'TABLE_NAME';
    works ok on 10g but is very slow on 11g? How to improve performances?

    You dont need to join with user_constraints again unless you are trying to avoid references to a unique key.
    SELECT ucc_fk.column_name FK_COLUMN_NAME, ucc_pk.table_name PK_TABLE_NAME, ucc_pk.column_name PK_COLUMN_NAME
      FROM user_constraints uc_fk
           JOIN user_cons_columns ucc_fk
              ON (ucc_fk.constraint_name = uc_fk.constraint_name)
           JOIN user_cons_columns ucc_pk
              ON (ucc_pk.constraint_name = uc_fk.r_constraint_name
              AND ucc_pk.position = ucc_fk.position)
    WHERE uc_fk.constraint_type = 'R'
       AND uc_fk.table_name = 'TABLE_NAME';As you can see I have removed the join to user_constraints and hence the condition uc_pk.constraint_type = 'P'
    The reason being the it is already validated to be in ('P','U') for all r_constraint_names.
    G.

  • Different results for the same query and same data !  (oracle 9i)

    Hi,
    This is a mystery for me. I've got on my database exactly the same data that my customer (exported schema). We both launch the same query (generated by the software that we sold him). This query has a criteria IN (SELECT MAX()...) to get only data from the last year.
    The query gives 477 rows on my computer (correct answer), but no row on his! We have the same data! The only difference is the Oracle release : 9.2.0.6.0 for him, 9.2.0.1.0 for me.
    If he executes the subquery alone, it gives the expected result.
    If he replaces the MAX() in the subquery by the returned value (year 2016), he gets his 477 rows.
    I've rewritten the query with a NOT EXISTS, and now all is fine. (Less efficient but it works).
    I have no rational explication. Did I miss something ?
    Thanks for any answer.
    This is the query:
    SELECT ...
    FROM
    CRA, GRA, ...
    WHERE
    /* subselect */
    (CRA.COLLCOD, CRA.CRANEXE, CRA.CRANCODBUD, CRA.GRANNUM, CRA.CRANCOD1, CRA.CRANCOD2, CRA.CRANCOD3, CRA.CRANCOD4)
    IN (
    SELECT b.COLLCOD, MAX(cranexe), b.CRANCODBUD, b.GRANNUM, b.CRANCOD1, b.CRANCOD2, b.CRANCOD3, b.CRANCOD4
    FROM CRA b
    GROUP BY b.COLLCOD, b.CRANCODBUD, b.GRANNUM, b.CRANCOD1, b.CRANCOD2, b.CRANCOD3, b.CRANCOD4
    AND... /* other filters and joins */

    v9.2.0.1 was full of bugs. a lot of these bugs had to do with "incorrect results", typically associated with old stats or complex queries (certain types of subqueries were very likely to give wrong resutls, due to the way they were rewritten by the optimizer).
    apply the 9.2.0.6 patch set

  • Getting error while saving data to Oracle 11g from java 1.5

    I am getting the following error
    java.lang.ArrayIndexOutOfBoundsException: -25471
    at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:2677)
    at oracle.jdbc.driver.OraclePreparedStatement.sendBatch(OraclePreparedStatement.java:3681)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.sendBatch(OraclePreparedStatementWrapper.java:1139)
    Is this a java problem or oracle problem. My java version is 1.5.0_14 and my oracle is 11g. i have used the ojdbc5.jar also.
    Can any one please help me to resolve this problem

    This is the full stack trace. sorry i could not paste the code but this error comes when i try to do bulk insert. i am getting this error after inserting some records(may some 50 to 75 records).
    java.lang.ArrayIndexOutOfBoundsException: -25471
    at oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedStatement.java:2677)
    at oracle.jdbc.driver.OraclePreparedStatement.sendBatch(OraclePreparedStatement.java:3681)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.sendBatch(OraclePreparedStatementWrapper.java:1139)
    at PreparedStatement.sendBatch(PreparedStatement.java:554)
    at DBConnection.prepareCachedStatement(DBConnection.java:131)
    at PlannedWorkOrderPeer.insert(PlannedWorkOrderPeer.java:154)
    at PersistentMgr.insertObjs(PersistentMgr.java:1000)
    at Transaction.commit(Transaction.java:463)

  • Error in Import data in oracle 11g table

    I have a table with structure as
    SQL> desc PSACTIVIMG
    Name Null? Type
    ACTIVITYNAME NOT NULL VARCHAR2(30 CHAR)
    SEQNO NOT NULL NUMBER(38)
    PSIMAGEVER NOT NULL NUMBER(38)
    IMGSEG BLOB
    when the script try to insart data into this table ,after 5 row it fails and rollback all 5 row . i have taken a trace file for the same
    4-168 17.30.24 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Disconnect
    4-169 17.30.24 0.015000 Cur#1.3396.notSamTran RC=0 Dur=0.000000 Open Cursor Handle=04558628
    4-170 17.30.24 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 COM Stmt=INSERT INTO PSACTIVIMG (ACTIVITYNAME, SEQNO, PSIMAGEVER, IMGSEG) VALUES (:1, :2, :3, :4)
    4-171 17.30.24 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Bind-1 type=2 length=30 value=Create Reqs for Open Positions
    4-172 17.30.24 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Bind-2 type=19 length=1 value=0
    4-173 17.30.24 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Bind-3 type=19 length=1 value=1
    4-174 17.30.24 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Bind-4 type=23 length=2531 LONG BINARY DATA
    4-175 17.30.24 0.082000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Bind-1 type=2 length=17 value=Create W-2 Output
    4-176 17.30.24 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Bind-2 type=19 length=1 value=0
    4-177 17.30.24 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Bind-3 type=19 length=1 value=1
    4-178 17.30.24 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Bind-4 type=23 length=18170 LONG BINARY DATA
    2-5712 17.30.28 7.093000 Tuxedo session opened { DisconnectAll at044AE780, pid=2524}
    4-179 17.30.43 18.808000 Cur#1.3396.HRGOV RC=3114 Dur=0.006000 Rollback
    4-180 17.30.43 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Disconnect
    4-181 17.30.55 11.760000 Cur#1.3396.notSamTran RC=0 Dur=0.000000 Open Cursor Handle=04558628
    4-182 17.30.55 0.000000 Cur#1.3396.HRGOV RC=3114 Dur=0.000000 Commit
    4-183 17.30.55 0.001000 Cur#1.3396.HRGOV RC=3114 Dur=0.001000 Rollback
    4-184 17.30.55 0.000000 Cur#1.3396.HRGOV RC=0 Dur=0.000000 Disconnect
    4-185 17.30.56 1.544000 Cur#1.3396.HRGOV RC=8002 Dur=0.000000 Disconnect
    How to overcome this problem, please suggest some way .

    As long as I remember, you first have to insert empty_blob() and then update it.
    Check out these links:
    http://www.orafaq.com/wiki/BLOB
    http://arjudba.blogspot.com/2008/06/how-to-insert-blob-dataimage-video-into.html
    http://www.herongyang.com/JDBC/Oracle-BLOB-SQL-INSERT.html
    Or you can just Google it...
    :p

  • Using sqlldr to load old UNIFY data into oracle 11g

    I have a dump of an old UNIFY database whitch I need to build a controlfile to import to oracle using sql loader.
    the main problem is that the file is containing records for 64 tables
    the dumpfile is starting with the name of the table, and then data for each column in that table. like this:
    RSLT|0|26/09/2005|1281|2|LD|S1|0|0|  223|223.000000|Centra|27/09/2005|10:13|Centra|27/09/2005|10:13|3|0|3984|180|24069844193|379650048|247075485|134233305|0|
    SMPL|0|26/09/2005|1281|3||5|ALLE|2|1|177|0||26/09/2005|**:**|svi2|||**/**/****|**:**||0||0|0|**/**/****|00:01||286138573|2560|
    I have build the ny datamodel in oracle, and it is the same as in the old UNIFY system. so that is not a problem.
    but HOW do I tell sqlldr that there is not data from just one table but 64..??
    the tablenames and how to difference them is the main problem..
    This is an urgent issue.. I need helt fast.
    any suggestions?

    Hi,
    You can do something like that
    --- Control file--------------
    cat aa.ctl
    LOAD DATA
    INFILE '/home/oracle/MYSHELL/aa.txt'
    TRUNCATE
    INTO TABLE RSLT
    WHEN DBNAME = 'RSLT'
    FIELDS TERMINATED BY '|'
    DBNAME,
    col_1,
    col_2,
    col_3,
    col_4
    INTO TABLE SMPL
    WHEN DBNAME = 'SMPL'
    FIELDS TERMINATED BY '|'
    DBNAME position(1),
    col_1,
    col_2,
    col_3,
    col_4
    -- dat file----------
    cat aa.txt
    RSLT|0|26/09/2005|1281|2
    SMPL|0|26/09/2005|1281|3
    SQL> host sqlldr me/** control=aa.ctl
    SQL*Loader: Release 11.2.0.2.0 - Production on Wed Aug 14 02:15:37 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 2
    SQL> select * from SMPL;
    DBNAME     COL_1      COL_2                COL_3      COL_4
    SMPL       0          26/09/2005           1281       3
    SQL> select * from RSLT;
    DBNAME     COL_1      COL_2                COL_3      COL_4
    RSLT       0          26/09/2005           1281       2
    HTH

  • Select Record Between Date Gap-Oracle 11g, Windows 2008 server

    hello everyone,
    I have a sql query where I need to select only records with an 18 month gap between max(date) and previous date( no dates between max(date)
    and 18 month gap date), when I run the below query it should only select supid 130, not 120 (even though 120 does contain an 18 month gap date it also has a date that is less then the 18 month gap( '25-NOV-2012','DD-MON-YYYY').
    how would get the query to look back 18 months for the next date and evaluate the month_between.
    any help is greatly appreciated.
    example:
    create table supply(supID number(8), supply varchar2(20), supdate Date,supamount number(13,2));
    insert into supply values(100,'Tapes',to_date('01-AUG-2013','DD-MON-YYYY'),50.00);
    insert into supply values(100,'TV',to_date('01-APR-2013','DD-MON-YYYY'),250.00);
    insert into supply values(100,'Discs',to_date('25-DEC-2012','DD-MON-YYYY'),25.00);
    insert into supply values(120,'Tablets',to_date('25-AUG-2013','DD-MON-YYYY'),15.00);
    insert into supply values(120,'Paper',to_date('25-NOV-2012','DD-MON-YYYY'),35.00);
    insert into supply values(120,'Clips',to_date('20-NOV-2010','DD-MON-YYYY'),45.00);
    insert into supply values(120,'Binders',to_date('28-FEB-2012','DD-MON-YYYY'),25.00);
    insert into supply values(130,'Discs',to_date('25-JUL-2013','DD-MON-YYYY'),75.00);
    insert into supply values(130,'Calc',to_date('25-JAN-2012','DD-MON-YYYY'),15.00);
    insert into supply values(130,'Pens',to_date('15-DEC-2011','DD-MON-YYYY'),55.00);
       select * from supply p where to_char(p.supdate,'yyyy')='2013'
       and p.supid in(select s.supid from supply s where months_between(s.supdate,p.supdate)<-18)
         SUPID SUPPLY               SUPDATE    SUPAMOUNT
           120 Tablets              25-AUG-13         15
           130 Discs                25-JUL-13         75

    Something like this?
    select
    from (
    select
      supid
    , supply
    , supdate
    , supamount
    , lead(supdate) over (partition by supid order by supdate desc) ldate
    from supply
    where
    months_between(supdate,ldate) >= 18
    SUPID
    SUPPLY
    SUPDATE
    SUPAMOUNT
    LDATE
    130
    Discs
    07/25/2013
    75
    01/25/2012
    Ok. i see you want only he diff to max date.
    select
    from (
    select
      supid
    , supply
    , supdate
    , supamount
    , lead(supdate) over (partition by supid order by supdate desc) ldate
    , row_number() over (partition by supid order by supdate desc) rn
    from supply
    where
    months_between(supdate,ldate) >= 18
    and
    rn = 1
    Message was edited by: chris227
    extended

  • How to store and use the BLOB data in Oracle 11G?

    Recentlly,when I tested the Blob data in Oracle11G ,I found that there were too many differences between the SQL
    Server and the Orcale on the capabilities.In Orcale ,I created the table like this:
    create table point
    xid number(10) primary key,
    North number(30,15) default null,
    West number(30,15) default null,
    South number(30,15) default null,
    East number(30,15) default null,
    Area number(30,15) default null,
    Len number(30,15) default null,
    Geometry BLOB default null
    organization index overflow
    tablespace "Tab1"
    lob (Geometry) store as securefile
    tablespace "Tab1"
    enable storeage in row
    chunk 4096
    pctversion 20
    nocache
    no logging
    compress high
    and I stored 10248 rows in this table,
    then ,I used "select geometry from point where xid > ? and xid < ?" as the testing SQL langauage in Java and the
    programme runed once per 5000 pieces of memory.
    the total time used in Orcale is twice more than that in SQLServer.In my Application programs, once the same
    orders runed,their differences were three times and more.As usually,the capability of Orcale is more strongger
    than the SQLServer.Why?

    select geometry from point where xid > ? and xid < ?"Does an index on XID exist?
    Are statistics current for table & indexes?

  • Missing some records after Loading Data in Oracle 11g Release 1

    Hi All,
    I wrote a script to load one million records into the database using all insert commands.
    I know there is a faster way using SQL Loader- but i am in the process of learning but ran out of time.
    Anyhow, 1 million data was injected into the database but only 999998 records are there....does anyone know why?
    Is there a way I can find out which data was rejected?
    thanks

    Hello,
    It could be nice that your script spool a log.
    By that way, you could more easily catch the error and the detail of the rows rejected.
    Best regards,
    Jean-Valentin

  • How to do integration between Oracle 11g and SAP Data services

    HI All,
              i want to load data from Oracle 11g data base to some other data bases. we have installed oracle 11g server in one machine and Data services server in one machine.we installed oracle 11g client in data services server machine . i created data store for oracle and when i was executing job i got the following error.
    how to resolve this issue. do i need to do any configuration between two servers (Oracle 11g and data services), and do i need create ODBC for oracle in data services machine.
    if any one know the solution please help me out ASAP.
    Thanks,
    Ramana

    Hi,
    we installed oracle client "win64_11gR2_client" version on DS Server.
    but i need the steps after installing oracle client tool. meaning integration between those two servers(Oracle and DS Server).and what are the variable create on DS Server and paths for variable and how to create ODBC for Oracle on DS Server.
    Thanks,
    Ramana

Maybe you are looking for