Can we create table

Hi All,
can we create a table having two columns in which first column values always be greater then column second.
i want to impose this condition during table creation.
For example:
I have table Test as
Create table Test
(EmpSale int ,
ManagerSale int )
now once we insert values like:
insert into Test values
(10000,18000)
then i will allow
and once i insert values like:
insert into Test values
(20000,10000)
then it will never allow to insert.
i don't want to restrict this through any trigger.
i want to impose this condition in table definition,while table creation
Help Me Please!!!!!

Hi,
Did you refered check constraints?
Something like this.
alter table test
  add constraint ck_test check (ManagerSale > empsale);Regards
Anurag

Similar Messages

  • I can't create table from another table?

    Hi everyone!
    I have a problem that I don't known the reason why?
    I'm using Oracle version 8i and I want to create a table from another table, such as:
         CREATE TABLE a_backup as SELECT * FROM a => It's OK, table a_backup is created.
    But there is only a table that I can't created like that, such as:
         CREATE TABLE b_backup AS SELECT * FROM b;
    When I run over command, SQL Plus is not responding... and clients are can't access to DB or Executing forever
    This is the first time I met this problem.
    Can Anyone help me to resolved it?
    Thanks in advance!

    xi`tin wrote:
    Hi everyone!
    I have a problem that I don't known the reason why?
    I'm using Oracle version 8i and I want to create a table from another table, such as:You realize, of course, that 8i is completely out of support .... Is your OS and hardware just as old as your rdbms software, or is it only the rdbms that your company refuses to upgrade?
         CREATE TABLE a_backup as SELECT * FROM a => It's OK, table a_backup is created.
    But there is only a table that I can't created like that, such as:
         CREATE TABLE b_backup AS SELECT * FROM b;
    When I run over command, SQL Plus is not responding... and clients are can't access to DB or Executing forever
    This is the first time I met this problem.
    Can Anyone help me to resolved it?
    Thanks in advance!

  • How can i create table which in use

    Dear all,
    How can i create a index on table which have much dml any time?

    In 10g :
    The CREATE ONLINE waits for existing transactions to commit before it can proceed. Once it starts, it uses a log table (MV Log) to track subsequent changes (i.e. it allows concurrent DML once it has started). At the end of the operation, it encounters another wait if there are existing transactions as it has to sync changes from the MV Log to the index.
    Here's an explanation by Jonathan Lewis : Re: Alter Index Rebuild Online
    In 11g :
    There's an improvement in that only the transactions that were active at the instant when the CREATE .. ONLINE was issued are the ones it waits for. It does not have to wait on subsequent transactions.
    Here's an explanation by Richard Foote : http://richardfoote.wordpress.com/2008/02/11/index-create-and-rebuild-locking-improvements-in-11g-ch-ch-ch-changes/
    Hemant K Chitale

  • How can i create tables ?

    how can i create a table from two string arrays (of equal length)?
    I haven't found much in the documentation.
    thanks
    null

    Hi,
    Thank you for your post.
    Please have a check on the below links  and check if it helps you
    https://msdn.microsoft.com/en-us/library/dn305849.aspx
    http://azure.microsoft.com/en-in/documentation/articles/sql-database-get-started/
    This link describes how to migrate a relational database to Microsoft Azure SQL Database 
    https://msdn.microsoft.com/library/azure/ee730904.aspx
    Regards,
    Mekh.
        

  • How can i create table between different servers schema

    Hi,
    Can any advice me how I can create table on remote oracle schema.
    Thanks in advance
    Faheem Latif

    I am telling you what I know about remote table creation - it is impossible in Oracle, if you trust the documentation of course.
    ORA-02021: DDL operations are not allowed on a remote database
    Cause:     An attempt was made to use a DDL operation on a remote database. For example, "CREATE TABLE tablename@remotedbname ...".
    Action:     To alter the remote database structure, you must connect to the remote database with the appropriate privileges.

  • Can we create table maintence generator with out key field

    Hi,
    I have created a ztable in that client is the primary key as I don't want any other field as primary key.
    For this  i have created table maintenace generator but when i open it in sm30 blnak screen is coming.
    Here my question is can we create a table maintenace generator with out key field other than MANDT.
    If it's possible please let me know.
    Regards
    hari

    >
    Mathews Joseph wrote:
    > I agree to the above points , but you can try one thing.
    >
    > When you create the table maintenance screen , from SE11 you assign a function group.
    >
    > Double click on the function group and you can go to the main program and open that in SE80, take screen generated and try manually adjusting the screen and putting the non key field details...
    >
    > Not sure this will work , but may be you can give it a try.
    >
    > Mathews
    But the table could hold at most a single record (per client). The design is lacking.
    Rob

  • Without data element can we create table

    without data element is it possible to create table
    if it is possible how ?
      could u plz expain steps.

    Hi,
    Yes u can create table without data element.
    In that case in place of Data element u need to specify the Predefined type.
    Enter the name of field and the press on Built-In type button. This will disable the data element entry fields and enable the Built-in type field where in u can put the predefined type like CHAR, INT1 etc.
    Regards,
    Himanshu

  • Can i create table in a database procedure?

    Hello
    Can i create a table in a database procedure?
    create or replace procedure create_table is
    tt number;
    begin
    create table temp (
    a number,
    b varchar2(100));
    end;
    it return an error....
    regards,
    deemy

    Hello
    Can i create a table in a database procedure?
    create or replace procedure create_table is
    tt number;
    egin
    create table temp (
    a number,
    b varchar2(100));
    end;
    it return an error....
    regards,
    deemy
    create or replace procedure create_table is
    tt number;
    begin
       execute immediate 'create table temp (a number,b varchar2(100))';
    end;
    /Cheers
    Sarma.

  • Can not create table with the CLOB type VARRAY, ORA-02348: cannot create VA

    CREATE OR REPLACE TYPE Project AS OBJECT (
    project_no NUMBER(2),
    title VARCHAR2(35),
    cost CLOB );
    CREATE OR REPLACE TYPE ProjectList AS VARRAY(50) OF Project;
    CREATE TABLE department (
    dept_id NUMBER(2),
    name VARCHAR2(15),
    budget NUMBER(11,2),
    projects ProjectList );
    The table creatation always with the error :
    ORA-02348: cannot create VARRAY column with embedded LOB
    Can anybody help ???

    Hi Peng,
    It seems you have hit a limitation of the Oracle version, which you don't post.
    Limitations are sometimes also called a 'feature'.
    You would need to find out whether this restriction has been lifted in a subsequent release or redesign your application.
    Sybrand Bakker
    Senior Oracle DBA

  • Can I create tables that are subsets of my master table?

    I would like to create tables (or sheets) that are subsets of the master table so that I can view different subsets of data in smaller chunks. I would like to continue to enter data in the master - and have it reflected in the subsets. Possible?
    Thank you

    Would this do what you want?
    Create a table for your subset of info. In its first cell, enter "=" & then click on the cell in the master table that you want displayed in that cell of the new table. You will get a formula of the type:
    =Table 1 :: B2
    where "B2" will be whatever cell you clicked on in Table 1.
    You can extend this formula downward or rightward with the circular blue fill handle to easily display adjacent row or column cells from the master table. You can also repeat the process starting with a new cell in the new table to display as many or as few cells of the master as you want. (You could even display different row or column values from the master in the same row or column of the new table, but I'm not sure that would be of any use.)
    Once you get the subset table set up as you want, lock it so that you cannot accidentally change its cell contents to something else.
    The result is a table slaved to the master which will automatically show any changes to the master but otherwise cannot be altered. This table can also be copied to other sheets & the formulas will be updated with the sheet reference automatically.
    The only drawbacks to this approach that I know of are that you can't enter data into the subset table (which may be a good or bad thing) & that empty cells in the master will be represented by zeros in the subset table. An 'IF(ISBLANK())" formula addition would take care of that but may not be needed.

  • Can't create table - using JDeveloper 11g (11.1.1.3.0)

    I am running a DDL to create a table:
    CREATE TABLE HORSE
    HORSE_NAME VARCHAR2(30) NOT NULL
    , PLACE VARCHAR2(20)
    , RACE_NAME VARCHAR2(30)
    , RACE_DATE DATE
    , CONSTRAINT HORSE_PK PRIMARY KEY
    HORSE_NAME
    ENABLE
    The message I get is:
    Error at Command Line:48 Column:13
    Error report:
    SQL Error: ORA-02264: name already used by an existing constraint
    02264. 00000 - "name already used by an existing constraint"
    *Cause:    The specified constraint name has to be unique.
    *Action:   Specify a unique constraint name for the constraint.
    This suggests to me that I should change the name to something else, like HORSE_ID. Whilst I don't agree that HORSE_NAME is used in another constraint I have changed the name but it doesn't make a scrap of difference.
    There is another parallel table called HORSES (plural) but but other examples ( eg PUNTER/PUNTERS) have been happily created.
    I would be grateful for any suggestions.
    Thanks,
    Jim

    The message is not specifically about the HORSE_NAME - it is more likely about the table name.
    You probably already have another database object called Horse (maybe not a table but it could be a view or a procedure).
    Try a different name for the table.

  • Can't Create Table on HBase

    Hi,
    When trying to create table on existing HBase cluster I get an error.
    I try to create table using the following command: 
    create 'sampletable', 'cf1'
    The error I get is:
    hbase(main):005:0> create 'sampletable', 'cf1'
    ERROR: java.io.IOException: Table Namespace Manager not ready yet, try again lat
    er
    at org.apache.hadoop.hbase.master.HMaster.getNamespaceDescriptor(HMaster
    .java:3205)
    at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:1730)
    at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:1860)
    at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService
    $2.callBlockingMethod(MasterProtos.java:38221)
    at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2008)
    at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:92)
    at org.apache.hadoop.hbase.ipc.FifoRpcScheduler$1.run(FifoRpcScheduler.j
    ava:73)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
    1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
    .java:615)
    at java.lang.Thread.run(Thread.java:745)
    Thanks

    The amazing guys at MS helped us with that one.
    For the future,
    HBase clusters shouldn't share the same storage account, to be specific, they shouldn't share the same storage container.
    The solution was to delete the clusters and recreate them with proper settings.

  • Can i create tables in a specified datafile?

    I am curious that
    How to create tables in a specified datafile? (specified tablespace is ok for us)
    for example:
    I have tablespace users, there are 5 datafiles in it, let say df1..df5.
    how to create table test in "df5"?
    thanks

    only if you are alone in the database
    take all other datafiles offline temporary
    create the table
    and take datafiles online again
    then optionally check dba_segments if the segment is in the correct datafile

  • Can't create table that grows using the button object

    Im a beginner, and this seems like a simple issue. Appreciate your help in advance.  When I try to do this, the button fails to add a row.
    So, I printed out the Help section entitled, "create a table that grows using the button object" and started from scratch with a simple table as the only object on the form- and followed the instructions to the letter.
    When I go to preview and click the button, a row is not added.
    Can you suggest something?

    Try this:
    Select body row of table from hierarchy palette that you want to repeat then on he object tab of the properties tab select binding tab. You need to click on "Repeat Row for Each Data Item"
    I hope this helps
    Murat
    www.muratkuru.com.tr

  • How can I create tables (data dictionary) on SAP Environment in BATCH mode?

    I need a Help on Table Creation on SAP in Batch Mode. I don't want to use SE11 and manually enter all 2000 table definition in the Front END. Is there any way where I can create a tables on SAP in Batch MODE. I want to create around 2000 tables, where schema is generated from external source.  As we know table created from Native SQL will not be available in SAP Application Layer.

    Hi Kenneth,
    Which version are you in? I'm on 4.7 and i have the class on my system.
    You may even try using the Function module that i had mentioned in my earlier post. That might solve your problem.
    Please write back if you problems decides to have a date with you.
    Thanks, Debasish

Maybe you are looking for

  • Please help -- Encore CS3 crashes often on a new PC

    Read below the typical problem report from Vista problem history -- it's French to me. The whole report would not fit here. Have had numerous crashes in Encore, and few times in Bridge, Premiere and After Effects. The programs just "stopped working"

  • Vendor Line Item Upolad Without TDS Portion  -- very urgent

    Hi Peers I want to upload the vendor Line Items. If my Vendor is a TDS Vendor then , the system is calculating TDS even for Initial Upload. Is there anyway by which i can bypass this. Plz help. Its very urgent. Regards Rajaram

  • How to receive oracle by mail

    hi there, How can I receive Oracle 9i by mail to my work address? Is download from web server the only possibility? Br, Miikka

  • Error calling ColdFusion RemoteObject  - BadVersion !!!

    I use Flex Builder 2.0.1 (OSX) and ColdFusion MX 7.02 (OSX) in my local machine and everything runs perfect!! i modified my FLEX app to call a ColdFusion MX 7.02 (Windows / J2EE multiserver CF edition) over the internet. as soon when it invokes the R

  • To group the data by checking the year

    I need to design a report with details based on year.i have employee details with their date of join.I want to display the fields by grouping the year alone.For eg employees joined in the year 2000,2001,2002 etc.Like this i have to display.How to che