Need to create a table

hi
i need to create a table emp( eno, ename, salary, address, doj, dob(dd-mm-yyyy), phone, city)
which datatype suits for the dob column. as we need to enter in the format as 'dd-mm-yyyy'.
please help.

Hi,
1009262 wrote:
hi
i need to create a table emp( eno, ename, salary, address, doj, dob(dd-mm-yyyy), phone, city)
which datatype suits for the dob column. as we need to enter in the format as 'dd-mm-yyyy'.The DATE datatype is best for anything that indicates a point in time. Which format you want has nothing to do with the data type; DATEs can be entered or displayed in virtually any format you wish. I've said it, and the 2 earlier replies said it, but this is important enough to repeat: Always use the DATE datatype for information about dates.
The only exception is when fractions of a second are significant, or when you need to capture time zone information along with the date. In that case, use the TIMESTAMP data type, but DATEs are a lot easier to use, and there are many more useful built-in functions for manipulating DATEs, so use DATEs whenever possible. For date-of-birth, you probably don't want to record hours, minutes or seconds, let alone fractions of a second, so there's no reason to use a TIMESTAMP, and there is never any reason to use any other datatype, such as VARCHAR2 or NUMBER.

Similar Messages

  • Need To Create a table in Sql Server and do some culculation into the table from Oracle and Sql

    Hello All,
    I'm moving a data from Oracle to Sql Server with ETL (80 tables with data) and i want to track the number of records that i moving on the daily basis , so i need to create a table in SQL Server, wilth 4 columns , Table name, OracleRowsCount, SqlRowCount,
    and Diff(OracleRowsCount - SqlRowCount) that will tell me the each table how many rows i have in Oracle, how many rows i have in SQL after ETL load, and different between them, something like that:
    Table Name  OracleRowsCount   SqlRowCount  Diff
    Customer                150                 150            
    0
    Sales                      2000                1998          
    2
    Devisions                 5                       5             
    0
    (I can add alot of SQL Tasks and variables per each table but it not seems logicly to do that, i tryid to find a way to deal with that in vb but i didn't find)
    What the simplest way to do it ?
    Thank you
    Best Regards
    Daniel

    Hi Daniel,
    According to your description, what you want is an indicator to show whether all the rows are inserted to the destination table. To achieve your goal, you can add a Row Count Transformation following the OLE DB Destination, and redirect bad rows to the Row
    Count Transformation. This way, we can get the count of the bad rows without redirecting these rows. Since the row count value is stored in a variable, we can create another string type variable to retrieve the row count value from the variable used by the
    Row Count Transformation, and then use a Send Mail Task to send the row count value in an email message body. You can also insert the row count value to the SQL Server table through Execute SQL Task. Then, you can check whether bad rows were generated in the
    package by querying this table.  
    Regards,
    Mike Yin
    TechNet Community Support

  • Urgent Need for creating 100 tables in Oracle.

    Hello All,
    I need to create 100 tables in oracle using a loop.
    Please suggest . Advance thanks for your efforts.
    ANto

    I am getting the foll error at run time when executing the procedure ..
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "ORAUSER.CREATE_100_TABLE", line 9
    ORA-06512: at line 1
    The script goes here ...
    create or replace procedure create_100_table
    is
    v_sql_string varchar2(200);
    begin
    for i in 1..100
    loop
    v_sql_string := 'create table ajames' || i || ' as select * from emp';
    execute immediate v_sql_string;
    end loop;
    end;
    ------------------------

  • DB proc - do you need to create a table to pass a ref cursor record type?

    I want to pass a limited selection of columns from a large table through a DB procedure using a REF CURSOR, returning a table rowtype:
    CREATE OR REPLACE package XXVDF_XPOS_DS021_ITEMS AS
         TYPE XXVDF_XPOS_DS021_ITEM_ARRAY
         IS REF CURSOR
         return XXVDF_XPOS_DS021_ITEM_TABLE%ROWTYPE;
    Do I need to create this dummy table?
    I can't get a TYPE to work, where the type is an OBJECT with the desired columns in it.
    So a dummy empty table will sit in the database...
    Is there another way?
    thanks!

    You can use RECORD type declaration:
    SQL> declare
      2   type rec_type is record (
      3    ename emp.ename%type,
      4    sal emp.sal%type
      5   );
      6   type rc is ref cursor return rec_type;
      7   rc1 rc;
      8   rec1 rec_type;
      9  begin
    10   open rc1 for select ename, sal from emp;
    11   loop
    12    fetch rc1 into rec1;
    13    exit when rc1%notfound;
    14    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    15   end loop;
    16   close rc1;
    17  end;
    18  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300or use, for example, VIEW to declare rowtype:
    SQL> create view dummy_view as select ename, sal from emp;
    View created.
    SQL> declare
      2   type rc is ref cursor return dummy_view%rowtype;
      3   rc1 rc;
      4   rec1 dummy_view%rowtype;
      5  begin
      6   open rc1 for select ename, sal from emp;
      7   loop
      8    fetch rc1 into rec1;
      9    exit when rc1%notfound;
    10    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    11   end loop;
    12   close rc1;
    13  end;
    14  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300 Rgds.

  • Help Please:  Need To Create Temporary Table

    Hi Guys,
    I am a new Oracle user. I need to create this report that uses
    temporary table. I can't use "create" statment in the sql
    query. Now wihtout that I don't know how to create the
    temporary table. Please let me know if anyone has any
    suggestions.
    Thanks a billion
    Sam

    Hi Sam,
    yes, you can't apply neither Data Definition Language (DDL) nor
    Data Manipulation Language (DML), except SELECT statement, at
    the query builder inside your report. You may create a stored
    procedure containing the DDL or the DML, then run this stored
    procedure at the "Before Report" trigger. You can find this
    trigger under Report Triggers of your Object Navigator.
    hope this help you.
    have a nice day...
    daniel

  • Help needed in creating a table that updates itself at runtime.

    I am working on creating a sniffer in java and need a GUI that will show the incoming packets as they are sniffed. How can I use tables such that they automatically update as and when the packets arrive.
    Any help on this matter would be appreciated thanks
    hasrar

    Hello, I am working in a Sniffer in java too, but I have not information about this.
    I want to tell you if you can send me some information or examples.

  • Need help creating Vector table for specific class

    I am trying to create a Vector table of class Node and I think I understand the concept but in practice I am not
    sure why the compiler complains about non-static reference on statement mv.table.add(new Node(names[n]). Please help. I can not get this thing to work.
    import java.util.*;
    class MyVector {
    Vtable table;
    public static void main(String[] args){
    MyVector mv = new MyVector();
    String names[] = {"one","two","three","four","five"};
    for (int n;n<names.length;n++)
    mv.table.add(new Node(names[n])); //<-ERROR
    table.list();
    if (table.del("de")) System.out.println("deleted");
    table.list();
    public MyVector(){
    System.out.println("MyVector_C");
    table = new Vtable();
    public class Node {
    private String name;
    public Node(){name=new String("Null");}
    public Node(String s){name=s;}
    public void setName(String s){name=s;}
    public String getName(){return name;}
    public String toString(){return "[Node:"+name+"]";}
    public class Vtable extends Vector {
    private Vector v;
    public Vtable(){v=new Vector();}
    public void add(Node n){v.add(n);}
    public Node getNode(String s){
    Iterator i=v.iterator();
    while(i.hasNext()){
    Node n;
    n = (Node)i.next();
    if (s.equals((String)n.name))
    return(n);
    return null;
    public void list(){
    Iterator i=v.iterator();
    while (i.hasNext()){System.out.println((Node)i.next());}
    public Boolean del(String s) {
    Iterator i=v.iterator();
    while(i.hasNext()){
    Node n = (Node)i.next();
    if (s.equals((String)n.name)) {
    v.remove(n);
    return(true);
    return(false);
    }

    public class Vtable extends Vector {
    private Vector v;
    public Vtable(){v=new Vector();}
    public void add(Node n){v.add(n);}
    public Node getNode(String s){
    Iterator i=v.iterator();
    while(i.hasNext()){
    Node n;
    n = (Node)i.next();
    if (s.equals((String)n.name))
    return(n);
    return null;
    I get ur problem...
    When VTable extends Vector all u have to do is...
    VTable table=new VTable();
    table.add(new node(..));
    There is no need to get the Vector obj in picture as VTable extends Vector...
    I guess, this helps u.

  • Need Guide to create a table in SQL Server and Process data for JDBC

    Dear All,
    Scenario:JDBC to JDBC
    I need to practice JDBC to JDBC scenario and for that i need to create a table in SQL server for sender ,receiver and update  i have installed SQL Server and no idea about creation of table and Connection string for PI.
    I want you to explain each and every step for the Table Creation ,Driver and connection string.
    Thanks in Advance.

    Try searchin in the forum and then google. This forum is not for teaching the basics.
    VJ

  • How to Create a Table Component Dynamically based on the Need

    Hello all,
    I have a problem i need to create dynamically tables based on the no of records in the database. How can i create the table object using java code.
    Please help.

    Winston's blog will probably be helpful:
    How to create a table component dynamically:
    http://blogs.sun.com/roller/page/winston?entry=creating_dynamic_table
    Adding components to a dynamically created table
    http://blogs.sun.com/roller/page/winston?entry=dynamic_button_table
    Lark
    Creator Team

  • Do i need to create table manually for disconnected analytics?

    Hi, i wanna ask, when i create a disconnected analytics client, do i need to create the table manually for SQL Anywhere? Or it has another means?
    Thanks.

    Thanks John
    I just find the answer
    Yes, it's recomeded to add new group , for instnace If I have 10 group from 1 to 10 then the standby shoudl be from 11 to 20
    Thanks I found the answer.

  • When do i need to create table spaces ?

    hi all,
    i know that any database has one table space and one data file at first creation , but
    when do i need to create another table space or data file ? do i need that when oracle tells me that there is no space anymore or what ?
    thanks

    newbi_egy wrote:
    hi all,
    i know that any database has one table space and one data file at first creation , but
    when do i need to create another table space or data file ? do i need that when oracle tells me that there is no space anymore or what ? In oracle database, the concept of storage segregation is done by two ways, using the schema and using the tablespace. So assume that you have two applications . One is used for HR related work and another is used for Finance and both kind of data is stored in one single database only. So how would you maintain such requirement? There are two ways to do it. One, you make two different schemas for each of the application and call them, for example HR schema and Fin schema. Now, you can create objects related to each of the application in it's own schema and store it in may be a single tablespace, Users. But this is going to be a little problematic like what would happen if you have lost the data file of that tablespace? You would be losing the data related to both the applications. So the better option would be to use two different tablespaces and store the data related to each application in both of them.
    Understand that tablespace is a logical structure only. The only thing that's physical is going to be those data files which are stored under the tablespace. So if you are just running out of space in a data file of a tablespace, you do not need to create another tablespace. Take it like this that if you are running out of space for your family in the house, you can either make a new house for them or you can even build a new floor for them. Which one would be easier to manage, the new floor since a lot of ground work is already done for you. And that's what is the case if you have run out of the space in the data file. For this,you can simply create a new datafile(building a new floor) or even extend the existing one(construct a new room in the same floor, if you have space) . But creating a new tablespace won't be something that you should be doing for the reason of space being exhausted IMO.
    Aman....

  • How to create transaction table in R/3

    Hi Gurus,
                  I have created master data table in R/3 with zempid as a primary key. I need to create transaction table for employee and visitor. how can i relate 2 transaction table with employee master table while creating tables in R/3 SE11.
    Notes: both employee and visitor transaction table has zempid.
    please let me know how to create table with relations.
    Thanks & Regards,
    Bharath

    Hi,
    In a normal database (say Oracle), this referential integrity is taken care of by PK-FK (primary key - foreign key) relationships. As far as OLTP - SAP R/3 is concerned, these are exisitng for the tables defined by SAP.
    Speaking about BW:
    1. You will bring master data from R/3--> BW first (its always a good practice), which should mean that empid 1000 - 1007 will flow to BW. Also your OLTP system ensures that there can be no transaction data (due to PK-FK relationships), for any emp. id other than 1000-1007.
    2. There could be another case that when the master data has been transferred to BW, due to time lag, in between master data and transaction data are created in R/3... meaning thereby that R/3 now has both master data about say emp.Id 1008 and transaction data as well.
    3. Now the transaction data is extracted from R/3, which will bring the transaction data for 1008, eventhough the master data for 1008 (loaded in step 1) has not come down to BW.
    4. Such situation can be controlled in BW, there are options wherein you can control this. the options are:
      - Load data even if there is no master data (this will create master data record with key values and nulls in other attributes) - record for 1008 will get loaded in such cases.
    - Do not Load data when there is no master data - The record with 1008 emp. id will not be loaded in such a case.
    Hope this helps.
    Cheers,
    Sumit

  • How to create a table in smart form.

    Hi Folks,
    I need to create a table in  smart form with the following fields:-
    vbrp-arktx,vbrp-fkimg,komv-kbetr,komv-kwert.
    Please let me know how to create a table and how to name the columns,size,and the select query for the same.
    All answers will be duly rewarded.
    K.Kiran.

    Hi,
    Following Links gives Details of Smartforms and how to create tables -
    smartforms - very useful link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    FAQ
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Siddhi

  • How to Create a table with numeric trigger for INSERT

    Let me start off by saying that I am very new to DBMS.
    I need to create a Table with INSERT Trigger. I am not exactly sure if I need to have a BEFORE ot AFTER insert trigger but leanning towards AFTER.
    I have a Java code that will need insert a row each time that piece of code is executed. I would also like an oracle trigger to insert a unique numeric value (REC_ID) for that that record.
    I am totally lost and I am not sure how to go about it. Can you point me to the right direction?
    Basically my table will have the following 3 columns
    REC_ID NUMBER NOT NULL (uniquie value inserted by the trigger)
    PROPERTY_NAME VARCHAR2(100 BYTE)
    PROPERTY_VAL VARCHAR2(100 BYTE)
    Thank you in advance
    Eric

    Take a look at the following: Also please do a search in this forum.
    http://infolab.stanford.edu/~ullman/fcdb/oracle/or-jdbc.html

  • How to create a table with a variable

    Hi everyone!
    I have a procedure which receives a table name as a parameter and need to create a table using that name
    For example:
    PROCEDURE REFRESH_REPORTS (table_name varchar2) IS
    BEGIN
    table_name_REPORT := table_name;
    execute immediate 'create table table_name_REPORT .....
    But I don't get this working. I am just adding this procedure as a part of a package which is used for web/online reports.
    Could someone guide me on how I could create this table?
    I was getting errors like invalid table name and I even tried to use a variable which stores the entire sql statement and concatenated with the table name's variable but still that was not working.
    Thank You so much in advance.
    Nithya
    Edited by: user645399 on Jan 20, 2010 9:42 PM

    user645399 wrote:
    Thank You so much for the valuable feedback.
    My agency requires some reports to be generated at a certain interval, after a certain type of batch load. A few different types of reports will be generated and usually we have scripts which we run to generate the necessary tables and extract the reports from there. We retain the tables for verification purpose as it stores some valuable status of some customers and so on, which we will not be able to generate again easily. The table will have around 50,000 - 100,000 records averagely. Sometimes more.
    I am automating the process now as per client's request.
    So, I thought of using the same script to automate it in the web. For table name we usually changed them manually.
    Now, when the user runs, he or she have to give them table name/ report name.
    I thought of concatinating the sysdate and report name but what if there is a problem and the user runs it for a second time?
    Unless I have a separate part of the coding to take care of this issue.
    Please advice if there is an alternative.
    Thank You Very Much.
    Cheers!
    NithyaSo why is it necessary to create a table just to create a report?
    You really, really need to rethink this entire process from the beginning, not just try to shoehorn in something from a current, astoundingly bad, design.

Maybe you are looking for