Column values of Date on Insert

HII,

For a long time we return reported a column data type Date the 10 G version. But now my client want to insert Date with Micro seconds or milliseconds level.

Y at - it opportunities to do this. This Table contains huge data. If we are not interested to change the column to TimeStamp Data Type.


Please clarify me on this.


Thank you
MohanA Krishna K

You will need to add another column to your ORDER BY clause to get the right order. If this column already exists in your table, I'm not sure.

Tags: Database

Similar Questions

  • text of the file of digital data in columns (spaces between the columns) to the chart with an average every 500 columns values.please help.

    I have a text file with numeric data in three columns, (I need to spend the few lines of text in the file above the three columns of values of data first) then I need to convert numeric values above-"999" to zero, then take the average of each value of 500 in the first column (second and third colum requires the same operation separately) , so found average values should be stored in a text file and finally plotted in a graph separately. Help, please. Its part of my project work.

    Another version, simply drag and drop:

  • How to perform an addition of column values in an insert query that would insert in the 3rd column, and the values how to insert into another table.

    I have two tables (2) RESULT TAB (1)

    CREATE TABLE TAB

    (

    NUMBER OF SNO

    A NUMBER,

    B THE NUMBER.

    NUMBER OF THE SUM

    );

    CREATE AN ARRAY OF RESULT

    (

    NUMBER OF SNO

    NUMBER OF THE SUM

    )

    my doubt is:

    (1) I want to insert a table TAB, my question is how to insert a column to the SUM using the column A AND B... Here im adding two values of the column and store result in the AMOUNT column.

    SNO   A  SUM           

    1 100 150 250

    2 300 100 400

    I want to like this, it is possible with single insert query?


    (2) at the time of the insertion TAB of values that SNO, and the values of table TAB $ insert in the table of RESULTS... is it possible these two inserts at the same time?

    in fact, im using another this table.fro TAB and easy to understand I write like that, please solve this problem

    First, you post in the wrong forum as this one is only for Oracle's SQL developer tool. So you might ask your question in the general forum of SQL.

    Second, you might solve your problems with bind variable:

    Insert tab

    (sno, a, b, sum)

    values

    (: SNO,: A: B: A + B :))

    You should not use sum as column name because it is a reserved word.

    More you cannot insert into two different tables with a single SQL, but you can use PL/SQL to do this:

    Start

    insert into tab values (: SNO,: A: B: A + B :);)

    insert into result values (: SNO,: A + B :);)

    end;

    If you meet sno from a sequence, you could do something like this:

    Start

    insert into values tab (seq_sno.nextval,:,: B,: A +: B) return sno in: SNO.

    insert into result values (: SNO,: A + B :);)

    end;

    Hope that helps,

    dhalek

  • Edit/view (data or Table column) value - cannot change the data, but it can be updated

    Hello

    According to the help of Oracle SQL Developer Center, the dialog ' Change/see value (data or Table column)' should "change the value of data" if we "are allowed to change the data." We strive to use this dialog box to modify/update data without having to write an Update statement, but is not to leave us. Us are not allowed to update the data, we can update via update statements. Even as the owner of the schema.table, it don't will change us the value in the dialog box "Edit/see value (data or Table column).

    Any ideas?

    We are on SQL Developer Version 3.0.0.4 build HAND - 04.34 and Oracle 11 GR 1 material (11.1.0.7) database.

    Thank you

    Alex Larzabal.

    You can still vote on the existing demand for this developer SQL to add Exchange of weight for implementation as soon as possible:
    https://Apex.Oracle.com/pls/Apex/f?p=43135:7:3974986722753169:no:RP, 7:P7_ID:4902

    Kind regards
    K.

  • the value of the xml column type tag data BLOB

    Hello

    I'm on Oracle 10 g.
    I have a table that has a column as BLOB data type and contains XML data. I need to select specific table records according to a unique tag value of the xml data in the BLOB column. For example:
    The table say Test has two columns: id (integer) and MESG (BLOB)
    The xml in the MESG column message is assumed:
    < message >
    < > 123456 contactphone < / contactphone >
    < contactname > ABCD < / contactname >
    < amount > 9999 < / amount >
    < / message >

    I need to extract only the records where the amount is = 9999

    Help, please. Thanks in advance.

    user12850338 wrote:
    Hi BluShadow,
    Thanks for your reply.
    I confess that if we would have used type xml in the first place, things would have been easier.
    For example, I mentioned three tags in the xml file, but my real data contains some hundreds of tags... :( So it will always be a good idea with this approach.

    Yes, it's a good approach. Oracle has provided built-in XML functionality to manage XML, then of course it's the best thing to use. :)

    For example, you can easily deal with namespaces and repeating nested groups and flatten the data in a table structure. for example

    SQL> ed
    Wrote file afiedt.buf
    
      1  WITH t as (select XMLTYPE('
      2  
      3    
      4      1
      5      1800
      6      
      7        1
      8        28
      9        6
     10        12
     11      
     12      
     13        5
     14        19
     15        1
     16        90
     17      
     18    
     19    
     20      2
     21      2400
     22      
     23        3
     24        14
     25        7
     26        5
     27      
     28    
     29  ') as xml from dual)
     30  -- END OF TEST DATA
     31  select x.country, x.point, y.user_id, y.target, y.state, y.task
     32  from t
     33      ,XMLTABLE(XMLNAMESPACES('http://www.w3.org' as "aa"),
     34                '/RECSET/aa:REC'
     35                PASSING t.xml
     36                COLUMNS country NUMBER PATH '/aa:REC/aa:COUNTRY'
     37                       ,point   NUMBER PATH '/aa:REC/aa:POINT'
     38                       ,user_info XMLTYPE PATH '/aa:REC/*'
     39               ) x
     40      ,XMLTABLE(XMLNAMESPACES('http://www.w3.org' as "aa"),
     41                '/aa:USER_INFO'
     42                PASSING x.user_info
     43                COLUMNS user_id NUMBER PATH '/aa:USER_INFO/aa:USER_ID'
     44                       ,target  NUMBER PATH '/aa:USER_INFO/aa:TARGET'
     45                       ,state   NUMBER PATH '/aa:USER_INFO/aa:STATE'
     46                       ,task    NUMBER PATH '/aa:USER_INFO/aa:TASK'
     47*              ) y
    SQL> /
    
       COUNTRY      POINT    USER_ID     TARGET      STATE       TASK
    ---------- ---------- ---------- ---------- ---------- ----------
             1       1800          1         28          6         12
             1       1800          5         19          1         90
             2       2400          3         14          7          5
    
    SQL>
    
  • How to avoid unnecessary data to insert one to another table?

    Hi all

    I have data in the target table let say called xxc_target and insert data into the target table Temp table.

    In the target table column values like that

    create table xxc_target

    (

    Description varchar2 (100);

    );

    create table xxc_temp

    (

    Item1 varchar2 (10),

    VARCHAR2 (10) to Item2.

    Item3 varchar2 (10),

    Item4 varchar2 (10),

    );

    Insert into xxc_values targets ("A100". ' ABC'. 'BB'. ' SS');

    Insert into xxc_target values (' A101'. ' ") ABC1'. 'BB1'. ' SS1') ;

    Insert into xxc_target values ('A1002'.') ABC2'. 'BB2'. ' SS2') ;

    Insert into xxc_target values ('Oracleabc12345beconmendos');  -> these types of values

    Insert into xxc_target values ('Oracle1234', null, null, 'American1234BR'); -> these types of values

    I don't want these types of values into the temporary table and I want to use simple insertion of...

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


    Thank you

    Hi Renon,

    I have only one command old substr-instr:

    insert into xxc_temp
    select substr(description, 1,                               instr(description,'.', 1, 1) -1),
           substr(description, instr(description,'.', 1, 1 )+1, instr(description,'.', 1, 2) -instr(description,'.', 1, 1 ) -1),
           substr(description, instr(description,'.', 1, 2 )+1, instr(description,'.', 1, 3) -instr(description,'.', 1, 2 ) -1),
           substr(description, instr(description,'.', 1, 3 )+1, length(description) )
      from xxc_target
     where description like '%.%.%.%';
    
    select * from  xxc_temp;
    
    ITEM1      ITEM2      ITEM3      ITEM4
    ---------- ---------- ---------- ----------
    A100       ABC        BB         SS
    A1001      ABC1       BB1        SS1
    A1002      ABC2       BB2        SS2
    A1003      ABC3       BB3        SS3
    

    Maybe someone knows an exp simple reg.

    concerning
    Kay
    BTW, I know

    select 'I have to learn more about regular expression!' from all_objects;
    

    ;-/

  • Display a time column value

    Hey,.
    I'm trying to display a column value only once for a folder, not a static value. Changes in value and it can be a lot of values. I don't think that grouping will work since the Date value is dynamic. I use Oracle for Toad 10.5. There are 4 files with data from this trial.
    select Date, Person, Language, Country
    from TableA
    TableA
    Date            Person  Language   Country
    01/25/2013       James   English
    12/20/2012       James   English
                                         US
                                         AF
    Want to display only
    Date            Person  Language   Country
    01/25/2013       James   English
    12/20/2012  
                                         US
                                         AF
    Thanks for reading this thread!

    Published by: Nikki on January 7, 2013 13:08

    Hello

    You can use the ROW_NUMBER analytic function to see if a given line is the 1st row in a group and display only the columns of the person and the language when it is:

    WITH     got_r_num     AS
    (
         SELECT       dt          -- DATE is not a good column name
         ,       person, language, country
         ,       ROW_NUMBER () OVER ( PARTITION BY  person
                                      ,          language
                               ORDER BY          dt
                             )  AS r_num
         FROM      table_x
    )
    SELECT       dt
    ,       CASE WHEN r_num = 1 THEN person   END)     AS person
    ,       CASE WHEN r_num = 1 THEN language END)     AS language
    ,       country
    FROM       got_r_num
    ORDER BY  person, language, dt     -- If wanted
    ;
    

    Your front end, perhaps as a way of hiding these values when you want to. PAUSE function in SQL * more to it; I don't know if toad has nothing comparable.

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) where the query above generates erroneous results, and also after the good results you want from this data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • Uppercase column values

    Hi all

    Database: 11g

    Is it possible to store the value of a particular column to uppercase? If users commands insert with tiny problems, is possible to store default uppercase?

    I searched if there is any default column is available while creating the table itself, but could not find any useful results.

    It's impossible to predict if problems users insert statement with lowercase or uppercase column value.
    I didn't have any application to combat it.


    Kind regards

    SK

    Hello

    SK says:
    Is trigger only the way to control? In my case, there may be large number of insert statements must be executed. It is collected from different users. As I said I have no any application to fight against it. For each insert if the trigger is activated, process could get slow. It would be good if there is no alternative if anyone knows.

    Sorry, if users write their own statements INSERT (or UPDATE or MERGE), then a trigger is the only way to guarantee that the column still gets capitalized. You can do the trigger fire only when the relevant column is changed.

    If you have a CHECK constraint in the table (which is a good idea, even if you have a trigger), then the DML statements that try to put lowercase letters in this column will fail. This puts the burden on users to call TOP in their own code.

    You could store the data to uppercase-lowercase, but display using TOP in a view (or, from Oracle 11, add a virtual coumn to the table). If you want to search on the string in uppercase, you can use a function-based index. (Columns virtual oracle 11 can be indexed).
    Using TOP in a view will queiries slower, but it is not slower DML.

  • calculate the difference of unique column values

    I tried the info and the website to learn how to perform a "calculation difference" function on a single column (channel) of data.  For example if my data channel is a period of time to say the following: 100, 101, 99, 102, 100, 99...  I would like to calculate 100-101 101 - 99 then then 99-102 and so on for all the values.  How can I do this?

    Hi ranger,

    Looks like you're looking for the standard function "Calculate the disparity" ANALYSIS > basic math.

    Hope this helps,
    Ralf

  • Check the data before inserting

    Hi all

    Appreciate your help. I have 3 tables, see below

    Examples of data

    CREATE TABLE PARENT_1

    (PARENT1_PK_COL NUMBER 4

    ) ;

    ALTER TABLE PARENT_1 ADD PRIMARY KEY

    (

    PARENT1_PK_COL

    )

    ;

    /

    CREATE TABLE PARENT_2

    (PARENT2_PK_COL NUMBER 4, NUMBER 4 PARENT2_FK_COL

    ) ;

    /

    ALTER TABLE PARENT_2 ADD PRIMARY KEY

    (

    PARENT2_PK_COL

    )

    ;

    /

    ALTER TABLE PARENT_2 ADD CONSTRAINT FOREIGN KEY ABC

    (

    PARENT2_FK_COL

    )

    REFERENCES PARENT_1

    (

    PARENT1_PK_COL

    )

    ;

    /

    CREATE TABLE CHILD_1

    (CHILD_1_PK NUMBER 4

    ) ;

    ALTER TABLE CHILD_1 ADD PRIMARY KEY

    (

    CHILD_1_PK

    )

    ;

    /

    My question is that before the insertion of data in the child_1 table, oracle look in parent_1.PARENT1_PK_COL and parent_2.PARENT2_PK_COL and columns if the data exists in both table then it allows to insert the record in the child_1 table, how do I apply this logic? do I need to add another foreign key in the child_1 table that references the two table? Please guide. Thank you

    Concerning

    MIT


    I got the answer, please ignore this thread

  • Create a join between a column of type DATE and DATETIME RPD

    Hello

    In my DR. I have a fact table with a DATE column, which also contains a component "hour". The physical layer shows this as a DATETIME column that to this DAY, I've changed since I'm only interested in the part of the date.

    When I join it an alias of my Date dimension, the generated sql physics is similar to:

    DIM_DATE. DATE = FACT_A.FINISH_DATE

    What I really want is:

    DIM_DATE. DATE = TRUNC (FACT_A.FINISH_DATE)


    How can I achieve this at the level of the RPD? Yes, I can add a new column to the table of DW with truncated value, but I want to know why even though I chose the DATE as the type of data to the RPD, the created join does not have a trunk.


    Thank you


    Manish

    The physical layer shows this as a DATETIME column that to DATE, I have changed since I was only interested in the part of date.

    N ° bad idea. The physical layer of the RPD should show what the physical source. So if it isn't a DATE, don't pretend OBIEE is it. For the exact reason that you now - tap you are pregnant OBIEE to write some SQL magic to cast the data type, without even say things which is the original type. OBIEE will not interrogate the metadata in order to check the data types in the source, it will rely on what you tell it in the physical layer.

    How can I achieve this at the level of the RPD?

    You could use an inline view in the physical layer and make your trunc here I guess. Better, as you've already identified, is to store the date as a date if this is going to be a key column to reach.

    I want to know why even though I chose the DATE as the type of data to the RPD, the created join is not a trunk.

    See above. OBIEE does not know it is a DATETIME value, then why would he do a TRUNK?

  • Merge two column in single column value

    Team,

    I have a requirement where in I need to merge 2 column values in a single column.

    e.g. I Percent_complete column in my table. and my table has only one record.

    I need to ask questions that I need to store the values of percent_complete and (100-percent_complete) in a single column.

    ex

    Percentage complete is set to 30.

    I need to select the 30 and 70 (100-30) both in a single column.

    Thank you

    If you mean like this?

    SQL > ed
    A written file afiedt.buf

    1 with t (select 30 as double percent_complete)
    2  --
    3 end of test data
    4  --
    5. Select decode(rownum,1,percent_complete,100-percent_complete) as percent_complete
    6 t
    7 * connect by rownum<=>
    SQL > /.

    PERCENT_COMPLETE
    ----------------
    30
    70

  • How to use the script to display the number of columns contain no data

    I have a requirement. There is a source that is the excel, the excel file file, we need to load data into the staging table. There are 5 columns mandatory ones must not be null. We used "No. Data Check" for this. The logic is so mentioned previously mentioned 5 columns don't contain any record that the record will be moved to without data. So far, it is fine. Now the requirement is to show what column or columns contain no data. We used a script to do this like:

    RES =' '

    RES = input1 [0] + ": failed because values null in required columns;"

    INPUT1 [1] = res;

    Output 1 = res;

    But it shows message "down because of nulls in the required columns", which is a generic message. We must show what column or columns does not contain the value "failed because of null values in a column required columnA, columnB or columnC. Can someone help me in this regard. Any kind of help is appreciated.

    You can use the variable inputname1, which keeps an array of names of the entry for the script processor attribute. For example:

    var result = "";

    var first = true;

    for (i = 1; i< input1.length;="" i++)="">

    If (input1 [i] == null | input1 [i] == ' ') {}

    If {(first)

    Firstly = false;

    } else {}

    result += "";

    }

    lead inputname1 += [i];

    }

    }

    If (result.length > 0) {}

    result = "failed due to null values in the following mandatory columns:"+ result; "

    }

    Output 1 = result;

    Kind regards

    Nick

  • A combine with other values of the column, the column values


    Hi all

    I need your help on this. I have a req I need to combine values of a percentage to the values of column test column. Here are examples of data

    Select decode('test',null,'ABC') abc, b.percent, b.amount

    from tableA, tableB b

    where id = b.id

    Examples of data

    Amount of the percentage TEST

    ABC              0.3                10

    ABC              0.5                20

    ABC              0.2                30

    After him combine the values of percentage to the ABC percentage column values must be zero

    Desired output

    Amount of the percentage TEST

    ABC(30%)                              10

    ABC(50%)                              20

    ABC(20%)                              30

    Valuable suggestions are appreciated

    Alter the query from Etbin with a trifle for the exact release.

    with

    t as

    (select 'ABC' test, 0.3 percent, 10 amount of all the double union

    Select 'ABC', 0.5, 20 double Union all

    Select 'ABC', 0.2, 30 double

    )

    Select test | ' ('| to_char(100 * percent) |'%)' test, null as a percentage, the amount

    t

  • Select the column values in the collection

    Greetings,

    I want to select column values from the collection (plsql tables or table), as the following code, would it be possible
    Here tt is any collection



    Select emp_no, name, date of birth, sal tt (1), tt (2), tt (3), tt (4) emp; -single line query

    Select name, Department of justice, strength and dep_no in tt (5), tt (6), tt (7), tt (8) EMP; -single line query


    Version
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production

    Thanks in advance

    Not sure about your business needs. But technically you can do.

    declare
       type tbl is table of number;
       lemp tbl := tbl();
    begin
       lemp.extend;
       lemp.extend;
       lemp.extend;
    
       select empno
            , mgr
            , sal
         into lemp(1)
            , lemp(2)
            , lemp(3)
         from emp
        where empno = 7369;
    
       for i in 1..lemp.count
       loop
         dbms_output.put_line(to_char(lemp(i)));
      end loop;
    end;   
    

Maybe you are looking for