Problems creating table in MathScript

ENGLISH: Hello I'm reading coordinates x and Y, they may be together or separated, such X10Y20 or X 10 or 20, I managed to separate them and read, now that I wanted to put them in a table, but can't, I did following annex, F (1, T) = X, where T is the value of each increment would keep well in different positions of the table except that each value that adds to the previous guess the value zero, sorry - for me typing errors, do not speak English, speaks only of the Portuguese and I use a translator.

Português: Ola estou lendo coordinated some em X e Y, elas shaped estar juntas, UO entraba, exemplo X10Y20 UO X 10 UO Y20, ja separa las e ler, agora EU queria could love-las em uma matriz, mas nao can, EU fiz a seguinte programacao, M (1, T) = X, T wave e o cada increase assim iria save em posicoes diferent valor da matriz , that so a cada valor than scene os anteriores assumem o valor zero, desculpe - me por haver digitacao erros, não falo ingles, so falo portugues e estou using um tradutor.

Advertisement


Tags: NI Products

Similar Questions

  • Need help - multilevel nested table - create table problem

    Hello

    My version of oracle db: 11g

    I just created a table that contains a nested multi-level table.

    Here is the code:

    create or replace type sdef_t_nt_empNames21 is table of the varchar2 (50);

    create or replace type sdef_ot_SCmarks21 as an object (number of physics, chemistry number, number of Biology);

    create or replace type sdef_t_nt_SCmarks21 is table of the sdef_ot_SCmarks21;

    create or replace type sdef_ot_allsubmarks21 as an object (eid, eng, math, sc sdef_t_nt_SCmarks21 number number);

    create or replace type sdef_t_nt_dep_m_info21 is table of the sdef_ot_allsubmarks21;

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    store table nested like NT_c_sdef_t_nt_dep_m_info21; c_sdef_t_nt_dep_m_info21  <-I know that the problem is here.

    TRACE OF THE ERROR:

    Error at startup on line: 13 in the command.

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    Nested table c_sdef_t_nt_dep_m_info21 (sdef_t_nt_SCmarks21) store as NT_c_sdef_t_nt_dep_m_info21

    Error report-

    SQL error: ORA-00904: invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    * Cause:

    * Action:

    PS: I'm just solve a problem given to me by some1, is not a practical implementation, I'm just trying to get through

    I'm sure that some1 could help me with this, I have searched a lot of this problem but could not find my answer, please help me.

    Concerning

    Rahul

    SQL > create table (nt_dep21)
    Did number 2,
    3 dname varchar2 (50).
    4 c_sdef_t_nt_empNames21 sdef_t_nt_empNames21,
    c_sdef_t_nt_dep_m_info21 5 sdef_t_nt_dep_m_info21
    6                       )
    store c_sdef_t_nt_empNames21 7 nested as NT_c_sdef_t_nt_empNames21 table
    store c_sdef_t_nt_dep_m_info21 8 table nested as NT_c_sdef_t_nt_dep_m_info21)
    9 table nested as NT_sc sc store
    10                                                                               )
    11.

    Table created.

    SQL >

    SY.

  • Problem creating hierarchy based on 2 physical dimension tables

    I'm having a problem create 1 dimension logic with a hierarchy of exploration, based on two separate physical dimension tables. The errors I get when navigating in the exploring hierarchy is:
    "Cannot find coverage source logical table to the columns of the logical" &
    "Missing join between the logical tables.

    I use OBIEE 10.1.3.4
    Here are the details of what I have set up as:

    Physical layer:
    Table DIM_ORG with the dimension columns:
    -dimension_key
    -org_total_code
    -org_total_description
    -org_detail_code
    -org_detail_description

    Dimension table DIM_DEPT with columns:
    -dimension_key
    -dept_total_code
    -dept_total_description
    -dept_detail_code
    -dept_detail_description

    FACT_SALES table with columns of facts:
    -fk_org
    -fk_dept
    -sum_sales

    Physical joins:
    FACT_SALES.fk_org = DIM_ORG_dimension_key
    FACT_SALES.fl_dept = DIM_DEPT.dimension_key

    Business model and the mapping of layer:
    I created a logical dimension ORG_DEPT. It contains two sources of logic table (DIM_ORG & DIM_DEPT) and the following logical columns:
    -All departments (mapped to dept_total_code)
    -Organization (mapped to org_detail_description)
    -Organisation number (mapped to org_detail_code)
    -Department (mapped to dept_detail_description)
    -Department Code (mapped to dept_detail_code)
    The logical key of the company is based on the combination of number of organization & Department Code

    The hierarchy, I need is: all departments-> organization-> Department so I created the following hierarchy for ORG_DEPT:
    -Total level containing: all departments
    -Organization level containing: company (defined as logical level key) number & Organisation (als defined the key level drill)
    / Department detail level containing: Department (defined as logical level key) Code and the Department (defined as key level drill).

    In the LTS of the ORG_DEPT dimension, I've set levels of content for sources:
    DIM_ORG: Level of organization
    DIM_DEPT: Level of detail Department
    The LTS non - joins inner - came against the associated physical tables.

    I created a logical fact table (based on the physical fact table) SALES and joined him on the ORG_DEPT logical dimension table.
    In the LTS, level of content for ORG_DEPT is part of the level of retail service. Non - joins inner were aded against related physical tables.

    When I create a report in response to test the hierarchy and select only "all departments' I get the value of the returned correct size. When I try to break through to the next level, I get the following ODBC error:
    "Could not find coverage source logical table for logical columns: [all of them]." "Please check more detailed level keys are correctly mapped.

    When I create a report in responses and select "Every department" and "Sales", I get the correct result. When I try to break through to the next level, I get a different ODBC error:
    "Lack of join between the logical tables DIM_DEPT and DIM_DEPT: there must be at least a physical link to join between the underlying physical tables.

    All suggestions are welcome!

    Thank you!

    You have no relationship defined between the Department and org.

    You can either:
    a. create a table of physical dimension with a composite key of org_id & dept_id if there is a relationship defined somewhere, then to obiee model as you have already done, but in the physical layer on the composite key join
    b. model your exisitng as two-dimensional and two hierarchies tables and set up a path of forest favorite between them according to your needs.

    Kind regards

    Robert

  • Problem with create table as select (DEC)

    Hello

    We try to data cleaning of huge tables. And a customer of guise is reanme main table to the backup table. Then create a master table in select * backup table with some test.

    Now the problem with create table select, is that it creates the table without indexes and constraints. Is it possible to use the ETG (create the select table) with the same structure that he was the (all index, constriaints).

    Or any other solution to solve this problem?

    Thanks in advance

    Sweety wrote:
    Hello

    We try to data cleaning of huge tables. And a customer of guise is reanme main table to the backup table. Then create a master table in select * backup table with some test.

    Now the problem with create table select, is that it creates the table without indexes and constraints. Is it possible to use the ETG (create the select table) with the same structure that he was the (all index, constriaints).

    Or any other solution to solve this problem?

    Thanks in advance

    No, this is not possible. You need to get the manuscript of dependent object and create it manually.

  • Problem with Create Table from target in CKM Oracle

    In CKM following Oracle are:
    create table < % = snpRef.getTable ("L", "CHECK_NAME", "W") % >
    (
    Catalog_name < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    Schema_name < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    RESOURCE_NAME < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    FULL_RES_NAME < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    ERR_TYPE < %=snpRef.getDataType ("DEST_VARCHAR", "1", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    ERR_MESS < %=snpRef.getDataType ("DEST_VARCHAR", "250", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    CHECK_DATE < %=snpRef.getDataType ("DEST_DATE", "", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    ORIGINAL < %=snpRef.getDataType ("DEST_VARCHAR", "100", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    CONS_NAME < %=snpRef.getDataType ("DEST_VARCHAR", "35", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    CONS_TYPE < %=snpRef.getDataType ("DEST_VARCHAR", "2", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >.
    ERR_COUNT < %=snpRef.getDataType ("DEST_NUMERIC", "10", "") % > < % = snpRef.getInfo ("DEST_DDL_NULL") % >
    )

    What is product is...
    create the table ETL_STAGING. SNP_CHECK_TAB
    (
    CATALOG_NAME VARCHAR2 (100 CHAR) NULL,
    SCHEMA_NAME VARCHAR2 (100 CHAR) NULL,
    RESOURCE_NAME VARCHAR2 (100 CHAR) NULL,
    FULL_RES_NAME VARCHAR2 (100 CHAR) NULL,
    ERR_TYPE VARCHAR2 (1 CAR) NULL,
    ERR_MESS VARCHAR2 (250 CHAR) NULL,
    CHECK_DATE DATE NULL,.
    ORIGINAL VARCHAR2 (100 CHAR) NULL,
    CONS_NAME VARCHAR2 (35 CHAR) NULL,
    CONS_TYPE VARCHAR2 (2 CHAR) NULL,
    ERR_COUNT NUMBER (10) NULL
    )

    Why it adds the word TANK in parenthesis? Anyone?

    Tom Cusick

    Hello

    Follow these steps:

    (1) go to the topology

    (2) physical architecture

    (3) modify the Oracle (directory) technology

    4) go to the tab "other".

    (5) change the "String Mask" (4º-text box) to: VARCHAR2 (%)

    That will solve the problem.

    Cezar Santos

  • Create table problem

    Hi all

    I want to know when we write "create table table_name as select...". "can that also migrate us the old table to the new table table constraints.

    I want to know when we write "create table table_name as select...". "can that also migrate us the old table to the new table table constraints.

    Not automatically, but manually.

  • Problem with creating tables DB DWH

    Hello
    During the generation of tables of data warehouse (dry 4.10.1 how to create the Data Warehouse Tables), I got to the top with an error indicating that "Datawarehouse Creating tables failed '.
    But when I checked in the log "generate_ctl.log" file, it has the message below:

    + "Schema will be created in the following containers: +"
    Oracle 11.5.10
    Oracle R12
    Universal



    Conflict between containers:


    ---------------------------------------------
    Table name: W_BOM_ITEM_FS
    Column name: INTEGRATION_ID.
    + Column properties that are different: [keyTypeCode] +.
    ---------------------------------------------

    Success! "

    When I checked in the database of DWH, I find tables DWH, but do not know if all tables have been created?
    Can someone tell me if my DWH tables are all created? Tables of how much would be created for EBS containers above?
    Also, should I have to drop a container of EBS to create tables DWH successfully?

    The Installation guide States when creating tables DWH fails then "createtables.log" will not be created. But in my case, this log file is created.

    Published by: userOO7 on November 19, 2008 14:41

    Even if you do the install with DBA role, it will fail is that sse_role is not present. Please, create it and try again. You must also create a user of separate database to the data warehouse that is separate from the repository of DAC. Then you can remove and re-create the account of data warehouse without losing the DAC repository.

    4.3.4.1 create databases
    http://download.Oracle.com/docs/CD/E12127_01/doc/BIA.795/e12083/windows_ic.htm#i1081422

  • 'Create table' is not possible with Jet.OLEDB.4.0

    I use LabVIEW Toolkit DB to access databases.

    I opened an access database of microsoft with the connection string "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\test3.accdb".

    When I exeucted

    create table leq_octave_5min (recorded_time DATETIME CONSTRAINT PRIMARY KEY pk1,
    Leq5 LEQ5 FLOAT NOT NULL CONSTRAINT,
    Min MIN FLOAT NOT NULL CONSTRAINT,
    Max MAX FLOAT NOT NULL CONSTRAINT,
    L05 FLOAT L05 CONSTRAINT NOT NULL,.
    L10 FLOAT L10 CONSTRAINT NOT NULL,.
    L50 FLOAT L50 CONSTRAINT NOT NULL,.
    L.90 L.90 FLOAT CONSTRAINT NOT NULL,
    L95 FLOAT L95 CONSTRAINT NOT NULL,.
    Us01 us01 FLOAT NOT NULL CONSTRAINT,
    EN02 EN02 FLOAT NOT NULL CONSTRAINT,
    Fr03 FR03 FLOAT NOT NULL CONSTRAINT,
    Fr04 fr04 FLOAT NOT NULL CONSTRAINT,
    Fr05 fr05 FLOAT NOT NULL CONSTRAINT,
    Fr06 fr06 FLOAT NOT NULL CONSTRAINT,
    Fr07 fr07 FLOAT NOT NULL CONSTRAINT,
    Fr08 FR08 FLOAT NOT NULL CONSTRAINT,
    Fr09 FR09 FLOAT NOT NULL CONSTRAINT,
    Fr10 fr10 FLOAT NOT NULL CONSTRAINT,
    Fr11 FR11 FLOAT NOT NULL CONSTRAINT,
    Fr12 FR12 FLOAT NOT NULL CONSTRAINT,
    Fr13 FR13 FLOAT NOT NULL CONSTRAINT,
    Fr14 FR14 FLOAT NOT NULL CONSTRAINT,
    Fr15 FR15 FLOAT NOT NULL CONSTRAINT,
    Fr16 FR16 FLOAT NOT NULL CONSTRAINT,
    Fr17 FR17 FLOAT NOT NULL CONSTRAINT,
    Fr18 FR18 FLOAT NOT NULL CONSTRAINT,
    Fr19 FR19 FLOAT NOT NULL CONSTRAINT,
    Fr20 FR20 FLOAT NOT NULL CONSTRAINT,
    Fr21 FR21 FLOAT NOT NULL CONSTRAINT,
    Fr22 FR22 FLOAT NOT NULL CONSTRAINT,
    E23, e23 FLOAT NOT NULL CONSTRAINT,
    Fr24 FR24 FLOAT NOT NULL CONSTRAINT,
    Fr25 fr25 FLOAT NOT NULL CONSTRAINT,
    Fr26 FR26 FLOAT NOT NULL CONSTRAINT,
    Fr27 fr27 FLOAT NOT NULL CONSTRAINT,
    Fr28 FR28 FLOAT NOT NULL CONSTRAINT,
    Fr29 FR29 FLOAT NOT NULL CONSTRAINT,
    Fr30 FR30 FLOAT NOT NULL CONSTRAINT,
    status TEXT (2) st NOT NULL CONSTRAINT)

    I got an error saying "error ADO: 0x80040E14.

    I have not had any problems with an ODBC driver.

    Why make such a mistake with Jet OLE DB?

    A web page was told that MIN and MAX are reserved words of Jet 4.0.

    So I defined with [and].

    Then, after it works.

  • How to force the data type in create table field?

    Hi all

    I need to force my table to create as follows

    Create table XYZ

    (Test varchar2 (10 CHAR)

    ...

    );

    When I run my Interface the script is

    Create table XYZ

    (Test varchar2 (10))

    ...

    );

    and the DBMS translated into

    Create table XYZ

    (Test varchar2 (10 BYTE),

    ...

    );

    I have the same problem with I$, C$, and so on.

    Best regards

    Marco

    Hi all

    I fix my problem:

    In Phisical Tecnology, under ORACLE Tecnology, data TYPE, I modified the definition of VARCHAR2 in VARCHAR2(%L CHAR).

    (Before it was VARCHAR2 (%)).

    Thank you all.

    Marco

  • Create table based on the timestamp prtition generate ORA-14752

    Hello

    I have following question - why create table 1 generate ORA-14752 script? Script 2 works without any problem. Feel it is on interval - day/month. How to create the script table 1?

    Database:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    1.

    create table

    (pData

    start_date TIMESTAMP,

    store_id NUMBER,

    inventory_id NUMBER (6)

    )

    PARTITION OF RANGE (start_date)

    INTERVAL (NUMTOYMINTERVAL (1, 'DAY'))

    (

    PARTITION pdata_p2 VALUES LESS THAN (TO_DATE (' 07/01/2007 ',' DD-MM-YYYY ""));

    PARTITION pdata_p3 VALUES LESS THAN (TO_DATE (' 08/01/2007 ',' DD-MM-YYYY ""))

    );

    2.

    create table

    (pData

    start_date TIMESTAMP,

    store_id NUMBER,

    inventory_id NUMBER (6)

    )

    PARTITION OF RANGE (start_date)

    INTERVAL (NUMTOYMINTERVAL (1, 'MONTH'))

    (

    PARTITION pdata_p2 VALUES LESS THAN (TO_DATE (' 07/01/2007 ',' DD-MM-YYYY ""));

    PARTITION pdata_p3 VALUES LESS THAN (TO_DATE (' 08/01/2007 ',' DD-MM-YYYY ""))

    );

    YM in NUMTOYMINTERVAL stands for the year and the month. With NUMTODSINTERVAL it should work.

    create table

    (pData

    start_date TIMESTAMP,

    store_id NUMBER,

    inventory_id NUMBER (6)

    )

    PARTITION OF RANGE (start_date)

    INTERVAL (NUMTODSINTERVAL (1, 'DAY'))

    (

    PARTITION pdata_p2 VALUES LESS THAN (TO_DATE (' 07/01/2007 ',' DD-MM-YYYY ""));

    PARTITION pdata_p3 VALUES LESS THAN (TO_DATE (' 08/01/2007 ',' DD-MM-YYYY ""))

    );

  • Newly created table not appearing is not in ESXi

    Newly created table not appearing is not in ESXi

    HP DL380 G5

    ESXi 5.5.0

    Smart Array P400

    I created the table using HP via SSH command line utility with the command on 2 x 300 GB drives

    hpssacli slot = 1 ctrl create type = ld = 1I:1:7, 1I:1:8 size drives = raid 300 = 1

    Grand - LEDs are lit and all is good - do a quick check of the State (note the new table is table C)

    Array has

    then 1I:1:5 (port 1I:box 1:bay 5, SAS, 72 GB, OK)

    then 1I:1:6 (port 1I:box 1:bay 6, SAS, 72 GB, OK)

    then 2I:1:3 (port 2I:box 1:bay 3, SAS, 72 GB, OK)

    then 2I:1:4 (port 2I:box 1:bay 4, SAS, 72 GB, OK)

    Table B

    then 2I:1:1 (port 2I:box 1:bay 1, SAS, 36 GB, OK)

    then 2I:1:2 (port 2I:box 1:bay 2, SAS, 36 GB, OK)

    Table C

    then 1I:1:7 (port 1I:box 1:bay 7, SAS, 300 GB, OK)

    then 1I:1:8 (port 1I:box 1:bay 8, SAS, 300 GB, OK)

    Problem, I have now, is that it does not appear in storage, even when I re-fresh it or try to add additional storage. Is there anything else I need to do for the newly created table? On a quick google, I see nothing. I wonder if it is because I created the mirror with the actual size of the readers, however if this was going to be a problem, I don't know that it would be bombed when I created it.

    The problem is probably that the partitions exist at all. Unless you need these NTFS partitions, take a look at http://kb.vmware.com/kb/1008886 ("information partitioning compensation in ESXi using the DD utility" section) to see if that solves the problem.

    André

  • Create table with overlapping parallel dates in individual columns

    I try to combine data from two different tables into a single table.

    The data in table 1 contains locations of patients in a hospital where each record represents a single location. Patients can be transferred several times between the different beds resulting from multiple records for a single visit.

    The data in table 2 contains the operative activity of the patient to the Hospital where each record represents either the GOLD of the suspension of the recovery room. A patient may have multiple operations in a single visit.

    I would like to join/merge/mashup data in a single table that contains the data parallel to each other. In other words, dates of the appliance on one side of the table and the activity of GOLD on the other. The difficulty is that the two sets of overlapping of dates of arrival and departure. I wish that the final table to divide the originals in new records when the overlaps do not coincide.

    Example:

    Original in both events (one per table)

    > Unit event has - from 14:00 to 18:00

    > OR event B - from 16:00 to 17:00

    Results in 3 documents (in the final)

    > Event 1 - unit from 14:00 to 16:00, null dates GOLD

    > Event 2 - unit from 16:00 to 17:00 OR 16:00 to 17:00

    > Event 3 - unit from 17:00 to 18:00, null dates GOLD

    Of course overlap can be more complex than the example above and adding code to indicate the 'ghosts' transfers to as well.

    In the code below, the first visit of the GOLD occurs during the first mention of the unit.

    Jason

    Oracle 10g

    [code]

    create the table delme_Unit_dates

    (id varchar2 (20))

    , unit_rcd_id varchar2 (20)

    , Unit_desc varchar2 (20)

    Unit_in_code char (1)

    Date of Unit_in_dttm

    Date of Unit_out_dttm

    Unit_out_code char(1));

    create the table delme_or_dates

    (id varchar2 (20))

    , OR_rcd_id varchar2 (20)

    , OR_desc varchar2 (20)

    OR_in_code char (1)

    Date of OR_in_dttm

    Date of OR_out_dttm

    OR_out_code char(1));

    create the table delme_all_dates

    (id varchar2 (20))

    , Unit_OR_id varchar2 (40)

    , Unit_rcd_id varchar2 (20)

    , Unit_desc varchar2 (20)

    Unit_in_code char (1)

    Date of Unit_in_dttm

    Date of Unit_out_dttm

    Unit_out_code char (1)

    , OR_rcd_id varchar2 (20)

    , OR_Desc varchar2 (20)

    OR_in_code char (1)

    Date of OR_in_dttm

    Date of OR_out_dttm

    OR_out_code char (1));

    insert into delme_unit_dates values ('123456', 'U1111', 'Unit A', 'A', to_date('2013-04-29 5:02:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 1:06:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456', 'U1112', 'Unit A', 'B', to_date('2013-05-09 1:06:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 4:53:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456', 'U1113', 'Unit A', 'B', to_date('2013-05-09 4:53:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-10 10:52:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 't');

    insert into delme_unit_dates values ('123456', 'U1114', ' unity, 't', to_date('2013-05-10 10:52:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-11 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'), 'B' ");

    insert into delme_unit_dates values ('123456', 'U1115', ' unity, ' B', to_date('2013-05-11 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-12 4:00:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456', 'U1116', ' unity, ' B ', to_date('2013-05-12 4:00:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-16 2:14:00 PM', 'yyyy-mm-dd hh:mi:ss am'),' t ');

    insert into delme_unit_dates values ('123456', 'U1117', 'Unit Z', ', to_date('2013-05-16 2:14:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-17 2:26:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456 ', 'U1118', 'Unit Z', 'B', to_date('2013-05-17 2:26:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-20 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'),');

    insert into delme_or_dates values ('123456', 'OR2221', 'or 1', 'O', to_date('2013-05-09 7:35:00 AM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 10:56:00 AM', 'yyyy-mm-dd hh:mi:ss am'), 'R');

    insert into delme_or_dates values ('123456', 'OR2222', ' 5', 'R', to_date('2013-05-09 10:56:00 AM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 3:20:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'U');

    insert into delme_or_dates values ('123456', 'OR3331', 'or 2', 'O', to_date('2013-05-16 7:59:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-16 10:43:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'R');

    insert into delme_or_dates values ('123456', 'OR3332', ' 8', 'R', to_date('2013-05-16 10:43:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-17 11:20:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'U');

    commit;

    -Is far from what we

    Select

    U.*

    , o.*

    Of

    delme_Unit_dates U

    delme_OR_dates O

    where

    U.ID = o.id

    and U.UNIT_IN_DTTM < = O.OR_IN_DTTM

    and U.UNIT_OUT_DTTM > = O.OR_IN_DTTM

    order of U.UNIT_IN_DTTM, O.OR_IN_DTTM

    ;

    [/ code]

    Post edited by: Jason_S (changed a single date ' 2013 - 05 - 16 15:20 ' to ' 2013 - 05 - 09 15:20 ')

    Hi, Jason.

    Jason_S wrote:

    I edited one of the dates in the original post.

    Also although the inpatient unit and OR events are contiguous for a given patient (no overlap and without gaps - after that data are cleaned).

    ...

    The sample data you posted a of gaps in the data of the GOLD.  It is correct that the solution below works or not there are gaps in the two tables.

    WITH got_dttm AS

    (

    SELECT unit_in_dttm AS DTMC

    OF delme_unit_dates

    UNION

    SELECT unit_out_dttm AS DTMC

    OF delme_unit_dates

    UNION

    SELECT or_in_dttm AS DTMC

    OF delme_or_dates

    UNION

    SELECT or_out_dttm AS DTMC

    OF delme_or_dates

    )

    all_periods AS

    (

    SELECT DTMC AS in_dttm

    , (DTMC) ahead OF (ORDER BY DTMC) AS out_dttm

    OF got_dttm

    )

    SELECT NVL (u.id, o.id) as id

    u.unit_rcd_id

    u.unit_desc

    u.unit_in_code

    p.in_dttm

    p.out_dttm

    o.or_rcd_id

    o.or_desc

    Of all_periods p

    LEFT OUTER JOIN delme_unit_dates u WE u.unit_in_dttm<=>

    AND u.unit_out_dttm > = p.out_dttm

    LEFT OUTER JOIN delme_or_dates o WE o.or_in_dttm<=>

    AND o.or_out_dttm > = p.out_dttm

    WHERE p.out_dttm IS NOT NULL

    ORDER BY p.in_dttm

    ;

    You can use the query above to CREATE or a CREATE TABLE... AS command.

    If you have as much data as you say, a table or materialized view would be maybe faster to use.

    You will notice that I do understand not all columns; I would like to know if you have a problem, including them.

    I don't know what id role plays in this problem.  It is difficult to say when all rows have the same value.

  • Equivalent of CREATE TABLE syntax for functions?

    Hello
    I am trying to update my functions with a copy of another data base. Y at - it an equivalent syntax in CREATE TABLE as for functions? Basically, I want to drop my old feature in my dev environment and re-create it with the version on prod. I need to use it in a loop for all functions in prod, if just by using the statement plsql itself will not solve my problem.

    Thank you
    John

    Hi, John,.

    Discover the package supplied by Oracle dbms_metadata.

    In addition, the source code for procedures, functions and packages is available in user_source, which you can query like this:

    SELECT       text
    FROM       user_source
    WHERE       name     = 'PROC_X'
    AND       type     = 'PROCEDURE'
    ORDER BY  line
    ;
    
  • Nested table and tables nested inside (CREATE TABLE)

    Hi all

    I have a problem of creation of a table with some types defined by the user at several levels (and therefore the nested tables).

    All first of all objects:
    type top_object is object (
        text_top varchar2(100),
        table_a a_object_tbl,
        table_b b_object_tbl
    );
    
    type a_object_tbl is table of a_object;
    type a_object is object (
      text_a varchar2(100)
    );
    
    type b_object_tbl is table of b_object;
    type b_object is object (
      text_b varchar2(100),
      table_c c_object_tbl,
      table_d d_object_tbl
    );
    
    type c_object_tbl is table of c_object;
    type c_object is object (
      text_c varchar2(100)
    );
    
    type d_object_tbl is table of d_object;
    type d_object is object (
      text_d varchar2(100)
    );
    Shortly: the SUPERIOR object contains tables A and B. B includes tables C and D.


    Well, now I want to create a table that contains the TOP level object.
    My attempt:
    create table multilevel_table (
      some_value varchar2(100),
      data top_object
    )
    NESTED TABLE top_object.table_a STORE AS data1,
    NESTED TABLE top_object.table_b STORE AS data2
    (NESTED TABLE table_c STORE AS data3,
    NESTED TABLE table_c STORE AS data4);
    Of course, this does not (otherwise I would not have asked you ;)). If I jump the 'second level', so just deleting table_b top_object and, therefore, the "inner nested table' it works.
    But on this scenario more complex I don't know the right way or the syntax.

    I would be grateful if I get any help or suggestion on your part!

    + 1 for recommendation of Hoek of simply not using TABLEs IMBRIQUEES for persistent structures.

    But:

    create table multilevel_table (
      some_value varchar2(100),
      data top_object
    )
    NESTED TABLE data.table_a STORE AS data1,
    NESTED TABLE data.table_b STORE AS data2
    (NESTED TABLE table_c STORE AS data3,
     NESTED TABLE table_d STORE AS data4) ;
    
  • Creating table in the schema has with the user B and granting permissions to the user C

    Hello, I have a problem fun - we have a large table which requires a batch to make millions of updates, and he needs to finish more quickly. It takes several hours as an update, but a select create table did the same thing in about a minute. Yay! Then we just delete the old table and rename the new table to the former, rebuild all the index and grant select/insert/update/delete permissions to another user who needs access... and there is the problem, Oracle said insufficient privs.

    We have A figure, which is the owner of the table, userid B who done all the stuff of application batch and userid C which performs inserts for a process of middleware. None of them are actual users, of course. We want that user B to do the ETG, rename, rebuild and re-grant of the authorisation of the index. But user B apparently cannot grant permissions on objects in the schema A to user C, even if B has created the table and has the role DBA (not ideal, I know)!

    What's really crazy is that there is no sense unique user b can grant permissions to user C, which is to:

    grant select any table USER c;
    grant insert any table USER c;
    grant update any table USER c;
    Grant delete any table USER c;

    It seems really perverse can create tables in diagram A and even grant C privs "whole table" that user B, but may not grant privs specifically on this object in the schema A, even with DBA privs. I must be missing something... right?

    Yes. By default, the stored procedures are stored procedures from DEFINER rights. If A is the owner of a stored procedure, this stored procedure can do whatever A enjoys the privileges to directly. If A grants B privileges RUN this stored procedure, when B calls the stored procedure, the procedure runs with the privileges.

    I agree point stew, however, re-creating objects in Oracle is generally a bad idea and a TRUNCATE with one insert direct-path, possibly combined with the deactivation and the rebuilding of the index would be more appropriate than a DEC. If you're going to stick with this Assignment, however, that really do in a stored procedure owned by A while B has no need to CREATE ANY TABLE.

    Justin

Maybe you are looking for