Create virtual table.

Hi all

I have a table with the subtype, DATAID, ORIGNALDATAID, DATE column.

Select dataid, orignaldataid table where subtype = 1 and the Date = August 1, 2010.

I have the above query statement. I need the dataid for further processing, but before the treatment is done. I need to check if the orignaldataid = 0, if yes, dataid remains of another dataid = orginaldataid. Before the list was move to another sql. But I intend to use sql nested for futher treatment, so I need the database to crunch the data instead of using java to change the data.

I was thinking creaating another table of virtaual in DB where it will automatically do this for me instead of having the column dataid and orginaldatid, it will juice dataid column. Then I can just query the virtual table.
Select dataid from virtualTable where subtype = 1 and the Date = August 1, 2010. Is this possible?

I have a few questions to ask, because I'm not clear on what to do:

(1) of the virtual table, did you mean a temporary table or view Inline?

(2) is it an inevitable necessity for you to create another table just for fun a column?

(3) did you want a (kind-of-a-thing) wrapper around the original with the required columns table for java work on, in this case, a query online can be a good option similar to below:

create or replace view vw_table
is
select (case when orignaldataid = 0 then dataid
                  else orignaldataid
          end) dataid
from table
where subtype=1 and Date=01-Aug-2010

You can use the select query as-is as a subquery.

HTH.

Tags: Database

Similar Questions

  • Problem creating virtual disk MD3600i

    I add a MD3600i (with extension MD1200) to a Cluster of servers Windows 2012 new file.  I have connected and configured to the point table to create virtual disks.  When I try to create a disc, the 'Work' spinner appears, then disappears almost instantly.  The wizard never loads.

    -J' tried MDSM from versions of resource disc, 4, 5 and 6 - no change.

    -J' removed and added the table several times.

    -J' updated the firmware newest controller.

    -J' tried both In-Band and Out-of-Band management connections.

    -J' tried with two pools and groups.

    -Out-of-band management stations have been Windows 7 and 8.1

    When running create it a Wizard of the pool, I can create virtual disks even size at the end of the process, but I can't create the readers in the free space remaining (more than enough available for a player)...  I need to be able to create readers as needed, please help!

    I spoke with Dell Support, and the solution was to delete and re-create the host in MDSM.

  • ORA-54002 on creating virtual column

    I wonder on what follows.

    I'm in the middle of a migration project.

    I load the data received from the source database into the staging tables.

    The data in these tables must remain absolutely intact to be able to check where things have gone wrong if something is not the way we expected after migration.

    Obviously, the data includes dates. Those who are in the DATE data type columns.

    However, the values represent the date and time UTC.

    The values are NOT timestamps with time zone, but simply date that contains the date time and something that has passed, but expressed in the date and time utc.

    Now, the database target also expects that DATEs, so I seem to be home free.

    However, the target database expect the passage of time to express the time zones (Europe/Amsterdam).

    No problem I know how to do this.

    And because I want to do a million times in the transformation before insertion in the target code (and almost certainly forget a few times) I thought: I'll add virtual columns for the staging tables that allow to calculate the local time of the date and time utc.

    This way the data is intact, but the transformation code can simply use the column (virtual) replacement and does not bother with the calculations of time.

    Great, I thought.

    Until I tried to create the table.

    CREATE TABLE utc_test

    (createddate_utc DATE

    createddate GENERATED DATE ALWAYS

    AS (CAST (FROM_TZ (CAST (createddate_utc AS TIMESTAMP)

    , "UTC".

    )

    At the time of the ZONE "Europe/Amsterdam".

    AS DATE

    )

    )

    VIRTUAL

    );

    And Oracle says:

    At the time of the ZONE "Europe/Amsterdam".

    *

    ERROR on line 7:

    ORA-54002: only pure functions can be specified in a virtual column expression

    Excuse me?

    Not deterministic?

    Oracle is probably right, and even if it isn't yet I have to live with that.

    But no matter how hard I try I can't understand why this code would not deterministic.

    IMHO any form of date I put in createddate_utc, if I put the same date in here a million times I'll get the same answer a million times.

    I know, FROM_TZ to the ZONE SCHEDULE will give different answers for different time zones.

    But not for a same time zone.

    And is this not the essence of deterministic: always the same result, given the same input?

    Anyone who can teach me Oracle ;-)

    My question (I may not was clear on that) was: why Oracle claims that the function is not deterministic?

    Because this is not the case.

    Zone information (and therefore the conversion between TZs) are governed by the zone files, see: Datetime and time zones Support Data Types.

    Since these data may vary, it is not deterministic.

    To solve this 'problem', you can always create a standalone function transformation of packaging and declare it deterministic, even if it is not in the strict sense.

  • End of question creating a table and change the format of date on the creation

    Hi all

    I'm Googling the hell out of this but either it cannot be done or im just not finiding it.

    I know how to interview and select to_char allows you to change the date format.

    My question is when you create a table as follows:

    CREATE TABLE myTable2
    2 (NAME VARCHAR2 (15),)
    3 CHAR (2) STATE,
    4 SALARY NUMBER (5.2).
    5 YEARSEMP NUMBER (2),
    6 DATE STARTDATE);

    How can I set the DATE format will be a four-digit year? It is even possible to make when you create or you do it only when inserting?

    Thank you!

    Hello

    791443 wrote:
    Okay, so I guess that you can't change the default value for more than one session? So that whenever I have connect the date MM/DD/YYYY came? I know how ALTER, I was wondering if I can schedule the date WHEN I'll get the value by default whenever I connect JJ/MM/AAAA

    Exactly.

    The DBA can change the default format, which will then apply to all the columns DATE for all users.
    If you are the ADMINISTRATOR of you own private database, which is an option.

    If you are using SQL * Plus, you can put the ALTER SESSION SET NLS_DATE_FORMAT command in a file, login.sql, so it will run automatically every time that you start a session.
    Other frontends probably have similar functionality.

    You can also create a view, which had a column VARCHAR2 with formatted data. If you do this, the view also have the actual DATE column — VARCHAR2 column won't be good for sorting or making comparisons of inequality.
    From Oracle 11, you can have a virtual column in the table itself.

  • I need to create a table of contents in iPages but I want only one word for the title, not the line of holes. Or, how can I change the contents of the table? Thank you!

    I need to create a table of contents in iPages but I want only one word for the title, not the line of holes. Or, how can I change the contents of the table? Thank you!

    Yes, you can have a one word title, by assigning a paragraph style title to this one word. No, you cannot change the text in a Table of contents, but you can change paragraph style font attributes (line) and add for example, a head of points between the types of OCD paragraph and page numbers. No part of the table of contents will not provide hyperlinks in exported PDF documents.

    When you look up in the menu bar, you can see the word iPages, or simply Pages. There is no product of iPages.

  • 5.6.1 pages: How to create a table with more than 999 lines?

    5.6.1 pages: How to create a table with more than 999 lines?

    The table on Pages v5.6.1 line selector is limited 3-digit, as it is in Pages ' 09 v4.3. Either use LibreOffice Writer, who does not have any constraint line on processing tables 3-digit, or any application spreadsheet for top 3-digit row needs.

  • Using numbers to create a table where the value of the line increases automatically

    Hello

    I created a table (pictured below) to help calculate my self-employed income:

    INDEX

    DATE

    HAVING RETURNED TO THE SELF-EMPLOYED

    £

    A1

    I want to create an index / of reference for each line so that I can connect to receipts.

    I like the index / reference to automatically increase i.e. A2, A3 etc when I create a new line by using the shortcut 'alt - cursor down' but to note has managed to find out what formula to use.

    Any help would be great!

    Thank you very much

    Stophen.

    You can try something like this:

    = 'A' & rangee()

    SG

  • Creating a table of automatic indexing of loop for

    Hello and greetings from a newbie to LabView,

    In my program, I want to write several orders via VISA and read them in order. I created a table of command and auto-indexé to a loop for.

    I want to receive a table of responses, in the order they were read of course. However, I'm not sure what is the best way to do it.

    I'm sure that the solution is simple but have been unable to find one. I have attached the vi for reference. (VISA vi reading is part of the LabView unit driver), which works, but looks like a unmodular approach and inelegant.

    Thank you!

    Simple, you can auto-index the output!

  • create the table colors a jpeg image

    Hi guys,.

    I would like to create a table of the colors of the bmp file.

    Can someone help me please?

    Altenbach says:

    In particular, your image contains exactly 256 pixels horizontally while the lines are redundant, so everything you need is read on the 256 colors from left to right and store them in a table that contains 256 RGB color. Should be trivial to do! Unflatten image and index on a line.

    Here's what I had in mind. Works very well.

    (Note that the indicator is an array of boxes, without the classic palette color.

    (Of course if you do not know the image format, you should detect the type and act accordingly. This is just a draft)

  • Create a table array

    Hello

    How can I create a table array please?

    Kind regards

    Peter

    Table of table hack

    Table shredded feature request

  • DAQmx create virtual channel (VI) error-229771 reports

    Hello

    When in a project that I am working to get error-229771 code whenever I try to run 'DAQmx create Virtual Channel (VI)' this does not happen when I create a vi not in a project.  The problem is that this project is very large and it if poster impossible to recreate. It's several hundred vi. Y at - it something that I missed in the forums and support that could explain this. I created the VI below in the project and outside the project. In the project, the error occurs outside the project, it runs without any problems.

    Message:

    229771 error occurred at .vi:1780003 DAQmx create channel (I-voltage-Basic)

    Possible reasons:

    Internal software error has occurred in the MIG software. Please contact the support of National Instruments.

    Task name: _unnamedTask

    Any help would be appreciated.  Thank you, Matt.

    LabVIEW version: 15.052(32bit)

    OR Max Version: 15.0.f0

    NEITHER DAQmx Verson: 15

    OS: windows 7 service pack 1

    PC: Intel Core i7-2600, 8 GB of ram

    Data Aquistion: NEITHER DAQ USB-6289 calibrated June 2015

    This code snippet returns the name of the first channel of analog input on the device first, and then tries to create a task for her. The bed of the canal, then close the task.

    Error message

    Hi Matthew,

    Thank you for following up after you fix your problem.  I'm glad to hear that you do not encounter this problem more.

    Here is an article that lists the reasons for this error (although unfortunately, I cannot pin down which is the exact cause in this case).

    http://digital.NI.com/public.nsf/allkb/03123D0E8A36C48E862577A4005B6BAA

    NOTE: This article specifies that the error occurs at startup task VI DAQmx.  You do not use the start task VI, so the task starts automatically in the DAQmx Read function.  The error will occur instead in the DAQmx virtual channel create, that you encounter in your error.

    I hope this gives you an idea about what could have gone wrong, and I'm sorry he is no more details.

    Good programming!

  • How to create a table in if/else or structure without 0-case?

    Hello

    I tried to do for a while now.

    I only managed to think about this in three ways:

    1. (what I'm doing right now create the table through a loop for, fills the table in automatic indexing.) Filled it with many of if true and with a '0' if the value false. The idea was to remove the 0 later in the code. However, this seems very inefficient.

    2 make use of a registry change, which automatically adds the correct number of a table. The problem is that the table will keep growing and growing and at the very least would enormously slow down my program. At worst, it would break.

    So my question is: how to create a table that if a comparison is true, it puts the item in and if not, it does nothing?

    I have attached a PNG of my code snippet.

    Kind regards

    David.

    If you want to only affect exactly as much memory as you need for the table, you can count the number of true elements in the table of Boolean everything first and then assign one of exactly this size. In this way, you are more memory and time-efficient whether overuse (such as allocation of an array of I32 as big as the whole table boolean) or underallocating (from zero element and let it grow automatically whenever you add on).

    Count the true values, allocate an array only the great and then replace each value in this new table with indexes / "I ' value where the real exists." An excerpt from VI:

  • creating the table in the custom user interface

    Hello

    I am trying to create a table of revenue as part of my custom in VBAI user interface. I have attached a code example of the with few variables. I wonder if there is a way to do the same thing without VBAI throw an exception that it cannot have dependencies. Please throw your entries.

    Thank you.

    I have attached a few changes 2 Untitled. VI (updated the connector pane) and custom UI VI and a simple inspection (be sure to check the status of cleanup to see how ref VI is closed). I hope this helps.

  • Creating a table with a while loop

    I want to create a table using a while loop but I don't know how to do it.  Basically, I want to do the same thing as in the image of the example VI in LabVIEW VIs, called 'Graph XY Data Types.vi' example, but with a while loop instead of a for loop.  The reason why I want to do with a while loop is because LabVIEW will not faint error or VISA data thanks to a for loop.

    LabVIEW certainly enable you to pass out a mistake or VISA through a loop for. The default value is autoindex output and thus creating a table but is a simple right-click on the tunnel exit to change that. For recent versions, it changes the Tunnel mode to "last value". You can also use a shift register.

  • creating a table/average question

    I'm new to labview and I have problems to understand how to create a table.

    I use an Arduino Uno as my DAQ and when I take an anolog measure I've seen a lot of fuctuation to my measure. I know with arduino, you can perform with an average simple by using the function "Get a finished sample of Analog", but I know that I not be using an Arduino in the long term and trying to figure out the right way to do it.

    When I have on average with the Arduino IDE I usually code that looks like this:

    float analogsum = 0;

    for (int i = 0; i)< 10;="">

    analogSum += analogRead (analogPin); where analogRead converts the analog value to a value\ digital 10-bit

    }

    average = analogSum/10;

    I am trying to create this same feature in LabView. The only way I can imagine the analog value of each iteration, in summary would be to store each value in a table, then add them together and divide by the number of iterations in my loop for.

    How would I do this in Labview?

    Hi awwende,

    show all 3 suggestions above:

    You really should go LabVIEW101 the ni.com site to learn the fundamentals of LabVIEW!

Maybe you are looking for