When creating a table why should we give promary key

when creating a table why should we give promary key

Hi Rambabu,
Primary key is needed so as to avoid duplicate entries and ensure that there are unique entries in the table.
For some applications, it is useful to uniquely identify the rows in a table by one or more columns so that you can process them in a specified sequence, for example. You can do this by assigning a “primary key.” The column names that are to create the table key are represented by the keywords PRIMARY KEY. The input values of the key columns defined in this way must not be a NULL value.
You can use the primary key to insert rows in a table in the same way as you insert rows in a base table when no primary key is defined. However, the system outputs an error message if you attempt to insert an existing value into the primary key column a second time, since the uniqueness of the column is ensured by defining the primary key.
A primary key can consist of multiple columns. However, it is unusual for a key to be constructed from more than five columns, since this makes it difficult for users to enter unique values. The arrangement of the columns behind the keywords PRIMARY KEY defines the key sequence.
Regards,
Sekhar

Similar Messages

  • When creating a tablespace why should we enable LOGGING when a database is already on ARCHIVE LOG mode

    Question :
    When creating a tablespace why should we enable LOGGING when a database is already on ARCHIVE LOG mode ?
    Example:
    Create Tablespace
    CREATE SMALLFILE TABLESPACE "TEST_DATA"
    LOGGING
    DATAFILE '+DG_TEST_DATA_01(DATAFILE)' SIZE 10G
    AUTOEXTEND ON NEXT  500K MAXSIZE 31000M
    EXTENT MANAGEMENT LOCAL
    SEGMENT SPACE MANAGEMENT AUTO;
    LOGGING: Generate redo logs for creation of tables, indexes and  partitions, and for subsequent inserts. Recoverable
    Are they not logged and not recoverable if we do not enable LOGGING? What is that ARCHIVELOG mode does?

    What is that ARCHIVELOG Mode Does?
    Whenever your database is in archive log mode , Oracle will backup the redo log files in the form of Archives so that we can recover the database to the consistent state in case of any failure.
    Archive logging is essential for production databases where the loss of a transaction might be fatal.
    Why Logging?
    Logging is safest method to ensure that all the changes made at the tablespace will be captured and available for recovery in the redo logs.
    It is just the level at which we defines:
    Force Logging at DB level
    Logging at Tablespace Level
    Logging at schema Level
    Before the existence of FORCE LOGGING, Oracle provided logging and nologging options. These two options have higher precedence at the schema object level than the tablespace level; therefore, it was possible to override the logging settings at the tablespace level with nologging setting at schema object level.

  • Why should we select all key fields when using for all entries

    Hi,
    Why should we select all key fields in our select query when using for all entries statement?
    I read about for all entries but this point was not clear in any post.
    Please explain me
    Regards,
    Subhashini

    Dear Subhasini,
    It is because FOR ALL ENTRIES deletes the duplicate entries before populating the target internal table.
    Please do an F1 on FOR ALL ENTRIES & read the SAP documentation.
    I mean how duplicate entries will not get deleted when we use this?
    Quite simple, if you select  all key fields then each entry will be unique & there will not be any duplicate entries to delete !!
    BR,
    Suhas
    Edited by: Suhas Saha on Oct 16, 2009 9:41 AM

  • How to indent second line in a very long heading when creating a table of contents?

    I need to make a table of contents.
    Some of the chapter headings are very long and fill more than a single line.
    When I create my table of contents, I want the second lines to be 'pushed in' in the table.
    Like this
    1 chaper one xxxxxxxxxxx
    2 Chapter two xxxxxxxxxxxxxxxxxx
    3 Chapter three x xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
         xxxxxxxxxxxxx xxxxxxxxxxx
    4 Charpter four xxxxx xxxxx
    5 Chapter five xxxxxxxxxx xxx xxxxx xx xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxx
         xxxxxxxxx xxxx xxxxx
    I thought I had solved it by having the actual chapter headings indented like this, but the table of contents overlooks this/overrules this.

    See also my reply to the duplicate thread:
    http://social.technet.microsoft.com/Forums/office/en-US/8f88b64c-1a15-4761-aed9-f662f17b94ca/how-to-indent-second-line-in-a-very-long-heading-when-creating-a-table-of-contents?forum=word
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • When creating a new DPS should I use sizes offered by InDesign or the display size of the device?

    Hello all,
    When creating a new DPS, should I use the sizes offered by InDesign or the display size of the device?  I ran into this question when I was looking up the sizes of different devices and found that iPhone 5s, iPhone5c, and iPhone4s sizes differ than the defauly dimensions offered by InDesign. 
    Also, should I worry about the ppi resolution?  With iPhone, they all seem to be 326ppi but when dealing with other devices is this something that I should take into consideration?  Ideally, I could be creating DPS apps for all devices offered in the Digital Publishing drop down in InDesign (iPhone, iPad, Kindle Fire/Nook, and Android).
    Thank you for any help you can provide.
    By the way, if it helps I am using InDesign CC.

    Using 1024x768 and creating PDF articles will get you OK with both iPad resolutions, and, as Bob L. says, quite decent "one size fits all" result for all other devices.

  • Why should we give credit card details to open account even before any purchase

    Why should we give credit card details to open account even before any purchase

    Setup iTune account without credit card
    http://support.apple.com/kb/ht2534

  • Fields in Field Catalog not available when creating condition table

    I  see that field HIEBO01 to HIEBO12 are available in Field Catalog, but I don't see these fields when creating condition table
    Please let me know what I am missing here.
    Any insight on this would be really helpful.  Thanks guys!

    you need to get them added to the pricing structure KOMKAZ or KOMPAZ based on whether you need @ header level or @ item level respectively.
    and then add the logic in the sales order user exit for these added field in the pricing_prepare_TKOMK or pricing_prepare_TKOMP...again based on header level or item level.....
    Then go back to the field catalog and select from the respective structure and add them, Then you can see them when creating cond tables.
    Hope this helps. Hope i havent misunderstood your query.,
    Regards
    Sai

  • Error when creating pivot table in BI publisher template

    When I try to create a chart or pivot in BI publisher it keeps throwing error
    'Please load Datasource first'
    It allows me to create table so I am not sure why is complaing when creating a pivot.

    Hi
    This error you are getting while creating RTF template right?
    yes, before proceeding to use the columns you need to load the XML data of your data model into your template
    1. Open Microsoft Word.
    2. From the Oracle BI Publisher menu, select Log On.
    3. Enter your BI Publisher credentials and the URL for the BI Publisher server. (Contact your system administrator if you do not know the URL.)
    4. The Open Template dialog presents the same folder structure as your BI Publisher Reports home page. Select the report for which you want to build a template.
    5. Select Open Report to load the data to the Template Builder; or double-click <New> in the Layout Templates pane.
    Note that any existing templates will be listed in the Layout Templates pane.
    select <New> in Layout template section than select Open layout tempate to get automatically load your data into template..
    ELSE
    do manually,
    in publisher,
    after saving your report go to view the report
    select data template and import that to your local drive.
    now in your MS-Word.. in bi publisher toolbar
    you find Data option, then select the load xml and give that path...
    after this you can carry on creating charts or tables..
    Hope this is what you want..
    Thanks & Regards
    Kishore Guggilla

  • Errors when Creating Aggregate Tables in OBIEE 11.1.1.6 within SQL server

    Hi All,
    I was trying to create an aggregate table in OBIEE 11.1.1.6 within SQL Server. The sql was generated successfully as below. But an error occurred when I use NQCMD to execute the sql and the following error showed:
    1. SQL for creating Aggregate Table:
    create aggregates
    "ag_Measure"
    for "ASOBI_DTT_Demo"."Measure"("ValidVIPCnt")
    at levels ("ASOBI_DTT_Demo"."日期"."月", "ASOBI_DTT_Demo"."門市品牌"."門市品牌", "ASOBI_DTT_Demo"."門市類別"."門市類別", "ASOBI_DTT_Demo"."內創門市"."內創門市", "ASOBI_DTT_Demo"."門市/倉庫"."門市/倉庫", "ASOBI_DTT_Demo"."門市群組"."門市群組", "ASOBI_DTT_Demo"."門市行政區課"."行政區", "ASOBI_DTT_Demo"."門市地區"."城市")
    using connection pool "ASOBI_DTT_Demo"."ASOBI_System10"
    in "ASOBI_DTT_Demo"."ASOBI"."dbo";
    2. Error Message:
    "ag_Measure"
    for "ASOBI_DTT_Demo"."Measure"("ValidVIPCnt")
    at levels ("ASOBI_DTT_Demo"."日期"."月", "ASOBI_DTT_Demo"."門市品牌"."門市品牌"
    , "ASOBI_DTT_Demo"."門市類別"."門市類別", "ASOBI_DTT_Demo"."內創門市"."內創門市"
    , "ASOBI_DTT_Demo"."門市/倉庫"."門市/倉庫", "ASOBI_DTT_Demo"."門市群組"."門市群
    組", "ASOBI_DTT_Demo"."門市行政區課"."行政區", "ASOBI_DTT_Demo"."門市地區"."城市
    using connection pool "ASOBI_DTT_Demo"."ASOBI_System10"
    in "ASOBI_DTT_Demo"."ASOBI"."dbo"
    [343][State: 37000] [Microsoft][SQL Server Native Client 10.0][SQL Server]CREATE
    、DROP or ALTER 陳述式中使用未知的物件類型 'aggregates'。
    Statement execute failed
    Which means "Using unknown object type 'aggregates' in CREATE. DROP or ALTER statements" in English.
    Can anyone give me a suggestion for this error?? Many thanks!!!

    Hi Martin,
    I guess, I was not clear enough. Let me try again
    How Aggregate Persistence works in OBIEE?
    Once you are done choosing options in the Aggregate Persistence wizard, it generates an intelligent Query.
    What query is it?
    If you happen to understand the query, it is not like any ANSI standard SQL (I would say DDL) query. As you might have noticed there are no SQL Server datatypes, lengths, keys, constraints etc. This query can only be understood by the BI Server.
    How do I issue this query?
    Since the logical query could only be understood by BI Server, it has to be issued only to BI Server Engine using some tool viz NQCMD in this case.
    What does issuing this query using NQCMD do?
    The execution steps are as follows, the moment the query is issue via NQCMD
    Aggregate Persistent Wiz Generate Query ----- Issued to ---> NQCMD ----- Passes the logical query to ---> BI Server ----- Parses the query ---> Builds the corresponding physical DDL statements Issued --->To the Database --- If successful ---> .RPD is automatically updated with the aggregated sources etc.
    How do I pass the query to BI Server using NQCMD?
    The format of issuing this logical query to BI Server using NQCMD is
    nqcmd -d <Data Source Name> -u <Analytics UserId> -p <Password> -s <command> > output.log
    where
    <Data Source Name> : Is the DSN name which OBIPS uses to talk to Oracle BI Server. Yes, it's the very same DSN that can be found in InstanceConfig.xml
    <Analytics UserID> : Any user in obiee with admin privileges.
    <Password> : Password of the obiee UserId
    <Command> : Logical SQL Command which you already have handy.
    Hope I was good this time..
    Dhar

  • Error Message: "Excel cannot complete this task with available resources" when creating pivot table with Excel 2013

    Hi, 
    One of our users encountered this problem with Excel 2013 while creating pivot tables, particularly with large files. We tried to modify Virtual Memory
    of the pc but error still persist. Why does this happen and how can we resolve this? Thanks.
    Another error message encountered by the user, this time when opening large files. The files she tried to open are working fine in 2010. But when opened in 2013, it prompted : "There
    isn't enough memory to complete this action. Try using less data or closing other applications."

    Hi,
    In regarding of the issue, please provide us more information to assist you better.
    Did your user using the Excel 2013 and Excel 2010 with same PC? If not, please let me know the both of the 2 PCs' hardware list/Windows operation system info.
    Did you using Excel 2013 32bit version and Excel 2010 64bit version?
    General speaking, this issue usually occurs with Office 2013 32 bit version. It has a limitation of 2Gb of memory that can be used by its process. And the 64-bit Excel can handle larger workbooks.
    Thus, if your user using 32bit Excel, I recommend try 64bit Excel instead.
    Here is a similar issue, we also could try it:
    http://answers.microsoft.com/en-us/office/forum/office_2007-excel/excel-cannot-complete-the-task-with-available/d31b1822-ebde-4c9b-8d11-e54bb652847d
    If you have any update, please feel free let us know.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • ORA-01031: insufficient privileges when creating a table in other schema

    Dear all,
    I appreciate your help please in this issue :
    when i try to issue the below statement to create a table in an another schema than the user i am connected in
    CREATE TABLE SCHEMA_NAME_B.HST_ARCH nologging AS
    SELECT *
    FROM HST
    WHERE 1 = 0;
    I always get ORA-01031: insufficient privileges error, even if i have granted the create table privilege to the user i am connected in.
    What other privileges should i grant also,
    Please if you have any idea.

    user562674 wrote:
    Dear all,
    I appreciate your help please in this issue :
    when i try to issue the below statement to create a table in an another schema than the user i am connected in
    CREATE TABLE SCHEMA_NAME_B.HST_ARCH nologging AS
    SELECT *
    FROM HST
    WHERE 1 = 0;
    I always get ORA-01031: insufficient privileges error, even if i have granted the create table privilege to the user i am connected in.
    What other privileges should i grant also,
    Can you show us a cut/paste from the sql*plus of session of yours which should show that you have given the privilege directly to this user and after that the command fails?
    Aman....

  • Error when creating DataWarehouse Tables

    I am getting an error when trying to create Datawarehouse tables from DAC ETL Management. See log below.
    =====================================
    STD OUTPUT
    =====================================
    CREATING SIEBEL DATABASE OBJECTS
    D:\orahome\10gR3_1\bifoundation\dac\UTILITIES\BIN\DDLIMP /I N /s N /u ******* /p ******* /c "OBIEE DW ETL" /G "SSE_ROLE" /f D:\orahome\10gR3_1\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl /b "" /K "" /X "" /Z N
    Creating table W_A_MNTH_H ...
    Error while importing Siebel database schema.
    =====================================
    ERROR OUTPUT
    =====================================
    D:\orahome\10gR3_1\bifoundation\dac\UTILITIES\BIN\DDLIMP /I N /s N /u SVCOBIEEDW /p ***** /c "OBIEE DW ETL" /G SSE_ROLE /f D:\orahome\10gR3_1\bifoundation\dac/conf/sqlgen/ctl-file/oracle_bi_dw.ctl /b /K /X /Z N
    Connecting to the database...
    Connected.
    Reading tables and indexes from DDL file...
    Read 1070 tables and 0 indexes from DDL file...
    Reading existing schema...
    Read 0 tablespaces, 0 tables and 0 indexes from existing schema...
    Running SQL statements against the database...
    S0001: [Microsoft][ODBC SQL Server Driver][SQL Server]There is already an object named 'W_A_MNTH_H' in the database.
    create table W_A_MNTH_H (
    ROW_WID numeric(10, 0) not null default 0,
    BASE_MNTH_WID numeric(10, 0) null,
    PRE_MNTH_WID numeric(10, 0) null,
    YAGO_BASE_WID numeric(10, 0) null,
    YAGO_PRE_WID numeric(10, 0) null,
    PER_NAME_HALF varchar(50) null,
    PER_NAME_MONTH varchar(50) null,
    PER_NAME_QTR varchar(50) null,
    PER_NAME_TER varchar(50) null,
    PER_NAME_YEAR varchar(50) null)
    writeExecDDL error (UTLOdbcExecDirectDDL pDDLSql).
    writeExecDDL error (pOperCallback UTLDbDdlOperTblCreate).
    Error in MainFunction (UTLDbDdlDbMerge).
    Error in Main function...
    Any help would be greatly appreciated!
    Thanks,
    Brent

    I am having same issue... did you get around with it????
    Thanks in advance

  • (500) Internal Server Error when create storage table use development account

    Yesterday, our team suddenly cannot use storage emulator all, it always said 'can not create database' when start the emulator. Finally, we found a issue may affect this, we delete the WAStorageEmulatorDb30.mdf file in C:\Users\[User], and create manully
    in localdb, and so we can start the storage emulator later.
    But we still can not use it, since it always throw exception when creating Tables/Blobs/Queues, the exception like this:
    Microsoft.WindowsAzure.Storage.StorageException was caught
    HResult=-2146233088
    Message=The remote server returned an error: (500) Internal Server Error.
    Source=Microsoft.WindowsAzure.Storage
    StackTrace:
    at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
    at Microsoft.WindowsAzure.Storage.Table.TableOperation.Execute(CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext)
    at Microsoft.WindowsAzure.Storage.Table.CloudTable.Exists(Boolean primaryOnly, TableRequestOptions requestOptions, OperationContext operationContext)
    at Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext)
    at WorkerRole1.TableService..ctor() in c:\Users\<user>\Documents\Visual Studio 2013\Projects\WindowsAzure8\WorkerRole1\TableService.cs:line 21
    InnerException: System.Net.WebException
    HResult=-2146233079
    Message=The remote server returned an error: (500) Internal Server Error.
    Source=System
    StackTrace:
    at System.Net.HttpWebRequest.GetResponse()
    at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
    InnerException:
    And if we visit this url: http://127.0.0.1:10002/devstoreaccount1, it said Internal Error:
    <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <code>InternalError</code>
    <message xml:lang="en-US">
    Server encountered an internal error. Please try again after some time. RequestId:e9637e04-76ad-4237-8df0-31a511e4c116 Time:2014-04-25T00:56:16.9990136Z
    </message>
    </error>
    Any ideas of this? We still don't know what caused this whole trouble from yesterday, is it possible affect the storage emulator just by code? We were coding, not configuring anything. Strange.

    I have tried it before, but not works.
    Finally, I solved this issue by delete LocalDB instance, uninstall storage emulator and install LocalDB instance / storage emulator again, it works now. Quite strange.

  • Getting error when creating internal table

    hi i m creating internal table giving erro like 'VBELN' must be flat structure.
    DATA: BEGIN OF INT_VBAK,
            VBELN  LIKE VBELN-VBAK,
            AUDAT  LIKE AUDAT-VBAK,
            KWMENGE LIKE KWMENGE-VBAP,
            ARKTX LIKE ARKTX-VBAP,
            WERKS LIKE WERKS-VBAP,
            LFIMG LIKE LFIMG-VBAP.
          END OF INT_VBAK.
    thanks .

    Hii Laxman..
    DATA: BEGIN OF INT_VBAK,
    VBELN LIKE VBELN-VBAK,
    AUDAT LIKE AUDAT-VBAK,
    KWMENGE LIKE KWMENGE-VBAP,
    ARKTX LIKE ARKTX-VBAP,
    WERKS LIKE WERKS-VBAP,
    LFIMG LIKE LFIMG-VBAP.
    END OF INT_VBAK.
    This is Not itab declaration.. it will only Create a work area.
    So Declare like this
    DATA: BEGIN OF INT_VBAK <b>occurs 100,</b>
    VBELN LIKE VBELN-VBAK,
    AUDAT LIKE AUDAT-VBAK,
    KWMENGE LIKE KWMENGE-VBAP,
    ARKTX LIKE ARKTX-VBAP,
    WERKS LIKE WERKS-VBAP,
    LFIMG LIKE LFIMG-VBAP.
    END OF INT_VBAK.
    or
    DATA: BEGIN OF ST_VBAK ,
    VBELN LIKE VBELN-VBAK,
    AUDAT LIKE AUDAT-VBAK,
    KWMENGE LIKE KWMENGE-VBAP,
    ARKTX LIKE ARKTX-VBAP,
    WERKS LIKE WERKS-VBAP,
    LFIMG LIKE LFIMG-VBAP.
    END OF ST_VBAK.
    DATA : INT_VBAK LIKE TABLE OF ST_VBAK.
    Then it works.
    <b>Reward if Helpful</b>

  • Error when creating decision table

    Hi,
    I am on a Netweaver 7.0 EHP2 SP 6.
    Using the BRF+ Workbench I created two applications and some other objects, but when trying to create a decision table in one of the applications I am getting a shortdump after confirming the popup where you can enter the name of the decision table. It works fine in the other appliation though.
    The error message is
    Runtime Error: CREATE_DATA_UNKNOWN_TYPE
    The specified type FDT_EXPR_0247a is no valid data type.
    Termination occured in the ABAP program "CL_FDT_PERSISTENCE=================CP" - in "IF_FDT_PERSISTENCE~WRITE"
    And of course more. I just wanted to ask if this is a known error, since I only used the Workbench, and didnt change anything standard.
    Regards,
    Peter Büermann

    Table should be there. I do not understand why this is not the case in your system. Have there been any problems in the upgrade?
    Two options.
    1. Create a message for SAP to look at this.
    2. Maybe implement SP7. You may be lucky and the table is in it.

Maybe you are looking for

  • Some one help me please for my curve 8320.

    hello, i bought this used blackberry recently and i have beed trying to setup an email, but i couldnot, when i m in the setup wizard, then in the email setup, it doesnot ask me if i can put my personal email like hotmail, rather it tells me if i have

  • Table that gives the relation between plant and company code

    Hi gurus, I actually have plant number and using this plant value i need to get the company code. Is there any table that gives the relation between plant and company code. So,that i can get the company code details. Thanks in advance.

  • Negative values in Service Entry Sheet

    Hi, I am in need of creating service entry sheet lines with negative values (for a certain account assignment). Bare with me, this will be long (-; In my business scenario, (PS module, Construction Business) I use PO`s for external services with limi

  • Got my stolen Iphone back but it's registered under the criminals Apple ID

    I'm a kindergarten teacher and our custodian stole my phone. One week after my phone was stolen our Principle saw this individual with my phone/distinct case and asked to see it. Well it was the same phone and he was let go and we got our iPhone back

  • What  are the System Requirement for LC Rights Management

    I went to the Adobe public and partner site, the only System Requirements I found for RM are on the public site. This link http://www.adobe.com/products/livecycle/rightsmanagement/ has the hight level system info like the OS systems supported etc. Bu