Is this trying to create a PK index twice?

When Application Express writes out a .sql file, it has the following:
CREATE TABLE "HTMLBITMAPS"
(     "BMNAME" CHAR(32) NOT NULL ENABLE,
     "BMDATA" BLOB NOT NULL ENABLE,
     "BMFORMAT" NUMBER(3,0) NOT NULL ENABLE,
     "REPORTID" NUMBER(38,0) NOT NULL ENABLE,
     CONSTRAINT "PK_HTMLBITMAPS" PRIMARY KEY ("BMNAME") ENABLE
CREATE UNIQUE INDEX "PK_HTMLBITMAPS" ON "HTMLBITMAPS" ("BMNAME")
But when I then run the script the create unique ... is an error as an index with that name already exists. Does the constraint... in the table declaration already create the index and this additional command is an error in the .sql Application Express generates?
thanks - dave

Does the constraint... in the table declaration already create the index Yes, it does.
http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96524/c22integ.htm#11102
Oracle enforces primary key constraints using indexes, and composite primary key constraints are limited to 32 columns, which is the same limitation imposed on composite indexes. The name of the index is the same as the name of the constraint. Also, you can specify the storage options for the index by including the ENABLE clause in the CREATE TABLE or ALTER TABLE statement used to create the constraint. If a usable index exists when a primary key constraint is created, then the primary key constraint uses that index rather than implicitly creating a new one.
http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_73a.htm#2062567
If you enable a unique or primary key constraint, and if no index exists on the key, Oracle creates a unique index. This index is dropped if the constraint is subsequently disabled, and Oracle rebuilds the index every time the constraint is enabled.
To avoid rebuilding the index and eliminate redundant indexes, create new primary key and unique constraints initially disabled. Then create (or use existing) nonunique indexes to enforce the constraint. Oracle does not drop a nonunique index when the constraint is disabled, so subsequent ENABLE operations are facilitated.
It could look like:
SQL> CREATE TABLE "HTMLBITMAPS"
  2  ( "BMNAME" CHAR(32) NOT NULL ENABLE,
  3  "BMDATA" BLOB NOT NULL ENABLE,
  4  "BMFORMAT" NUMBER(3,0) NOT NULL ENABLE,
  5  "REPORTID" NUMBER(38,0) NOT NULL ENABLE,
  6  CONSTRAINT "PK_HTMLBITMAPS" PRIMARY KEY ("BMNAME") DISABLE
  7  )
  8  /
Table created.
SQL> CREATE INDEX "PK_HTMLBITMAPS" ON "HTMLBITMAPS" ("BMNAME")
  2  /
Index created.
SQL> ALTER TABLE "HTMLBITMAPS" ENABLE PRIMARY KEY
  2  /
Table altered.Rgds.

Similar Messages

  • Error while creating the CTXXPATH Index

    Hi,
    I tried to create the CTXXPATH index on my table, which has XMLTYPE column. But while creating the index i m getting the below error,
    Error report:
    SQL Error: ORA-29958: fatal error occurred in the execution of ODCIINDEXCREATE routine
    ORA-29960: line 1,
    DRG-11304: function-based indexes are not supported by this indextype
    29958. 00000 - "fatal error occurred in the execution of ODCIINDEXCREATE routine"
    *Cause:    Failed to successfully execute the ODCIIndexCreate routine.
    *Action:   Check to see if the routine has been coded correctly.
    I m using oracle 11g version. Could anyone please help me in resolving it.

    Hi,
    you can have a look at document "How to Create a Context Index Using a Function [ID 1063279.1]" at Oracle Support. You tried to create a CONTEXT index using a function but a function-based index is not supported. Workaround given in the document is to use a Multi_Column_Datastore.
    CTXXPATH is deprecated in Oracle 11.1, better is to use XMLINDEX, see http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/whatsnew.htm.
    Herald ten Dam
    http://htendam.wordpress.com

  • How to create partitioned bitmap index in SQL Developer?

    I am running SQL Developer version 3.0.04.34 ; on Windows 7 (64 bit) against:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE     11.1.0.7.0     Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    I am trying to create a bitmap index on a partitioned fact table which is part of a data warehouse. The index is in support of a single-column foreign-key to a dimension table. Heretofore, we had been using partitioned B-Tree indexes. According to the Data Warehousing Guide, we should consider using bitmap indexes for this purpose. Accordingly, I was trying to create such an index in our development environment. I used SQL Developer to edit the table, and attempted to create a bitmap index using the advanced screen from the index edit screen. I changed the partition type to "Local" from "None" using the radio button. When I attempt to save this change, I get an error message "A bitmap index cannot have a global partition". This happens whether or not I have assigned storage for the partitions. The index partition names are the ones used successfully for the existing B-tree indexes. I can create the SQL for the index creation by hand, but it would be simpler and easier to maintain if I could use SQL Developer.
    Any help on this issue would be appreciated.
    Vin Steele

    There is a radio button for index type in the New Index... dialog and in the index section of the edit table dialog.
    Which version of SQL Developer are you using?

  • Error creating a text Index

    When i tried to create a text index on my system (Oracle 8.1.6, RedHat Linux 6.2) i always get the same error:
    create index pkk on teste(maisumteste)indextype is ctxsys.context
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: interMedia Text error:
    ORA-06520: PL/SQL: Error loading external library
    ORA-06522: ctxsys: cannot open shared object file: No such file or directory
    ORA-06512: at "CTXSYS.DRUE", line 126
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 54
    ORA-06512: at line 1
    i'm a beginner in intermedia, so right now i'm stalled in this one, please help me.
    Thanks, in advance.
    Tony Cruz

    Raj Kr Pandit wrote:
    where is the issue?The issue is your code is apples and oranges:
    SQL> CREATE TABLE tab_1(aa nvarchar2(50) PRIMARY KEY,bb clob)
      2  /
    Table created.
    SQL> CREATE INDEX xtab_1_bb ON tab_1 (bb) INDEXTYPE IS CTXSYS.CONTEXT
      2  /
    CREATE INDEX xtab_1_bb ON tab_1 (bb) INDEXTYPE IS CTXSYS.CONTEXT
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: Oracle Text error:
    DRG-10528: primary keys of type NVARCHAR2 are not allowed
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 364
    SQL> SY.

  • Creating Primary Key Index

    Hi,
    Iam trying to create a Primary Index on Large table and Iam using the Parallelism to make it fast. I have used the following script to create a Primary key Index.
    CREATE UNIQUE INDEX FLX_ARCH.FUND_SEC_RESULT_STAT_ARCH_PK
    ON FLX_ARCH.FUND_SEC_RESULT_STAT_ARCH
    (FUND_SEC_RESULT_MAP_INST,RATES_RULE_ID,BASE_LOCAL_FLAG,EFFECTIVE_DATE)
    TABLESPACE FLX_PERF_I
    parallel;
    Index created.
    Elapsed: 01:43:37.37
    Index got created in 1 hour 43 minutes. But when Iam adding constarint to those columns, it is taking almost 12hours with or without parallelism.
    ALTER TABLE FLX_ARCH.FUND_SEC_RESULT_STAT_ARCH
    ADD CONSTRAINT FUND_SEC_RESULT_STAT_ARCH_PK
    PRIMARY KEY
    (FUND_SEC_RESULT_MAP_INST,RATES_RULE_ID,BASE_LOCAL_FLAG,EFFECTIVE_DATE)
    parallel
    Would you please let me know what could be the problem and how can we add the Primary constraint fast.
    Your early response is much appreciated.
    Thanks and Regards
    Suresh. D

    Would you please let me know what could be the problem and You have presented no details that indicate any problem exists.
    how can we add the Primary constraint fast. Fast is relative.
    If I asked you to make my snail fast, could you do so?
    ALTER SESSION SET SQL_TRACE=TRUE;
    ALTER TABLE FLX_ARCH.FUND_SEC_RESULT_STAT_ARCH
    ADD CONSTRAINT FUND_SEC_RESULT_STAT_ARCH_PK
    PRIMARY KEY
    (FUND_SEC_RESULT_MAP_INST,RATES_RULE_ID,BASE_LOCAL_FLAG,EFFECTIVE_DATE)
    parallel
    ALTER SESSION SET SQL_TRACE=FALSE;
    now find the trace file within ./udump folder
    tkprof <trace_file.trc> trace_results.txt explain=<username>/<password>
    By inspecting the trace file you will be able to see where time is being spent.
    With this knowledge, you may or may not be able to determine the bottleneck & therefore improve it

  • Unable to create the Rule Index (SEM_APIS.CREATE_RULES_INDEX) getting error

    Hi,
    I am trying to create the Rule Index with the below script its giving the temp table space error.
    The number of records in that specific table is 17473708 (17+ M) and the available temp space is 120GB.
    Execute SEM_APIS.CREATE_RULEBASE('ecc_md_rb')
    --Insert to mdsys.semr_ecc_md_rb Values(.............)
    BEGIN
    SEM_APIS.CREATE_RULES_INDEX(
    'ecc_rule_indx',
    SEM_Models('FOUNDATION'),
    SEM_Rulebases('RDFS','ecc_dm_rb'));
    END;
    Create rule index statement is running more than 8hrs and i tried with the sem_apis.create_entailment its also giving the same Temp table space error.
    Please find the below error details
    BEGIN sem_apis.create_entailment('ecc_rule_inx', sem_models('FOUNDATION'), sem_rulebases('OWLPRIME','ecc_dm_rb'),SEM_APIS.REACH_CLOSURE,'RDFS2-, RDFS3-, RDFS4a-, RDFS4b-, RDFS5-, RDFS6-, RDFS7-, RDFS8-, RDFS9-, RDFS10-, RDFS11-, RDFS12-, RDFS13-','USER_RULES=T'); END;
    Error at line 1
    ORA-29532: Java call terminated by uncaught Java exception: oracle.jdbc.driver.OracleSQLException: ORA-01652: unable to extend temp segment by 64 in tablespace TEMP
    ORA-06512: at "MDSYS.SDO_SEM_INFERENCE";, line 4866
    ORA-06512: at "MDSYS.RDF_APIS";, line 16
    ORA-06512: at line 1
    Please Help me to create rule index.
    Note: I am using Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    Regards,
    Kavitha.

    Hi,
    Please use the create_entailment API.
    As far as temp tablespace goes, please create a bigfile temp tablespace. You can follow Slide #36 of the
    following document.
    http://download.oracle.com/otndocs/tech/semantic_web/pdf/2010_ora_semtech_wkshp.pdf
    Thanks,
    Zhe Wu

  • Trying to create index cards in pages

    Hello,
    I am trying to create a 3x5 flash card template to study, and can't find an easy way to set this up on Pages. I need to make about 150 double-sided cards with text on the front, and text wrapped around a small picture on the back. So I need to create an efficient system to plug in data as well as a picture for all of these items. I've tried several things so far:
    1) Create a blank document 8.5x11 landscape orientation, then pull the guides down to fit 4 cards on a page. I would then ideally enter the info, print double-sided, then cut with a paper cutter. This formatting works fine for the first page, but I can't seem to replicate this page or the guides onto subsequent pages (guides can't be made to master objects I guess). If I try to select all 4 text boxes, copy, then paste them into the next page they for some strange reason scale down in size, so I lose the dimensions and placement of the boxes.
    2) Create a brand new template with aforementioned guides and text boxes. And again, when I tried this I couldn't get the page and formatting to be replicated to subsequent pages. When I made the text boxes into master objects to try and achieve this, all text I enter into them gets replicated into every subsequent box, which is not what I need because I need unique text on each card.
    3) Create a 3x5 page size document, which works ok but I cannot get a placeholder image to be replicated to subsequent pages. That means I need to drag the pictures on and format them one by one, which is again time-consuming. This is also tricky because I need to find a printer that handle printing directly onto index cards, which is a little specialized compared to printing on standard letter paper.
    I've also searched the forums and google to try and find add-ons or shareware that can do this, but haven't come up with anything!
    This is weird because surely I am not the only student who wants to create index cards on the computer rather than by hand! Please help..my final is next week..
    Thank you.

    Try to "capture" your first page thru the menu Format > Advanced > Capture Pages"
    Then you will be able to insert a new page with the defined attributes from the menu entitled "Sections" in the toolbar.
    Yvan KOENIG (from FRANCE jeudi 23 juillet 2009 19:09:05)

  • IWork Numbers program. I am trying to create a 'Master Table'. The table will be used on numerous sheets, when cells altered on the 'Master' it will show on all sheets using the Master table. Is this a possibility??

    iWORK NUMBERS
    I am trying to create a 'Master Table'. This table will be used on numberous sheets, however not all. Items entered into the cells in the Master Table will then reflect in the used sheets that have the Master Table linked.
    On the individual pages however, they will be able to be altered purely for that page.
    Hope I have explained myself clearly,
    Would appreciate any help,
    Cheers,

    Hi Hilary,
    The formula in the Index column of the Main table is:
    E2: =IF(A,MAX($E$1:E1)+1,"")
    Fill down to the end of column E.
    The Breakout table contains a single formula:
    A2: =IF((ROW()-1)>MAX(Main :: $E),"",OFFSET(Main :: $A$1,MATCH(ROW()-1,Main :: $E,0)-1,COLUMN()))
    Fill down and right to fill the table.
    For multiple rooms (with different data transfered to each) you'll need a column of checkboxes and a corresponding index column for each room.
    The index columns can be hidden.
    Contents in individual cells in the breakout tabel(s) can be entered directly, replacing the formula. To retun to the calculated result, select a cell adjacent to the one where text was entered, and drag the Fill control handle (small circle, bottom right of the selection rectangle) to fill the formula back into that cell.
    Regards,
    Barry

  • ORA-01450 when trying to create index on xmltype column

    Hi,
    I have a table that contains an xmltype column. It is a schema-based column and uses object-relational structured storage. When I tried to create an index like:
    create index ssual_sipuser_idx on ssua_line (extractValue(ssual_configuration, '/ssuaLineApplication/sipUser'));
    I got the following:
    ORA-01450: maximum key length (3118) exceeded
    The sipUser tag is of string type. I have also tried creating the index on the extract function.
    create index ssual_sipuser_idx on ssua_line (ssual_configuration.extract('/ssuaLineApplication/sipUser/text()').getStringVal())
    Gave me the same error message. My database block size is 4k. This is Oracle 9.2.0.4 running on Solaris.
    Any help will be appreciated.
    Thanks,
    Gloria

    Thanks for the reply, Coby.
    My field is really small, probably around 10 bytes. Actually I've been testing on two servers, a 9201 and a 9204. I know that Oracle doesn't support XML DB on 9201 anymore but our company hasn't switched over yet. Anyways, here's really what I saw:
    9201
    - creating an index with extractValue() or extract() doesn't work
    9204
    - extractValue() works
    - extract() still doesn't work
    Now I'm using the substr() workaround. I should also mention that extractValue() with a numeric field works (using getNumberVal()).
    I wonder if specifying the field length in the XML Schema would make a difference. I may try that next.

  • Im trying to create this program but I'm a little stuck

    Hey guys I'm trying to create this program but I'm a little bit stuck. Thanks for the help. Im trying to create a program that prompts the user for a string, then it takes the string adds 2 to the unicode value, and returns that as the output so for example:
    hello there
    turns into
    jgnnq vjgtg
    Thanks for your help

    Hey guys I'm trying to create this program but I'm a
    little bit stuck. Thanks for the help. Im trying to
    create a program that prompts the user for a string,
    then it takes the string adds 2 to the unicode value,
    and returns that as the output so for example:
    hello there
    turns into
    jgnnq vjgtg
    Thanks for your helpYou didn't add 2 to the space character, so is that to be treated special?
    Anyway, you have a String. That String has a length() to tell you how long of a loop you have to do. That String also has a charAt(index) method to give you a character while you're looping thru it. And I assume you know how to add 2 to a character value, and append that character to a new String or StringBuilder or StringBuffer until you're done with the loop.

  • I am trying to create a button in flash that will display 4 separate images at the same time when clicked.  I can't get the images to stay on when I take the mouse of the button.  I need the actions script code to make this happen.

    I am trying to create a button in flash that will allow the user to click on the button and 4 separate images show up at the same time.  I can get the images to appear when I click the button but they will not stay on the screen.  I need to know what code I use to make the images stay once the button is clicked, then I need to know exactly where I place that code.  It does not appear to be possible to add the action code to the buttons layer since each time I add a new layer I just get another "up" "over" "down" and "hit" line.
    Thank you in advance
    AP

    It is not clear how you are trying to realize this from your description.  If you are trying to create this within a button symbol it will not work.  Explain your approach and if there is code involved, show what you have so far.

  • I am trying to create mp3 version of itune songs.  I have gone through the preference sequence to be mp3 encoder but this is not having any effect.  I have also tired from file tab to create a version but this is not available to action

    I am trying to create mp3 version of itune songs.  I have gone through the preference sequence to be mp3 encoder but this is not having any effect.  I have also tired from file tab to create a version but this is not available to action showing as lite grey.
    Any help would be appreciated

    I am trying to create mp3 version of itune songs.  I have gone through the preference sequence to be mp3 encoder but this is not having any effect.  I have also tired from file tab to create a version but this is not available to action showing as lite grey.
    Any help would be appreciated

  • My husband and I recently bought Iphones. We are trying to create our Apple IDs. We only have one e-mail address so have been unable to create the 2nd ID. Any help with this situation would be helpful

    My husband and I recently bought Ihones. We are trying to create Apple IDs so we can download apps. I was able to create a ID, however we only have one email address that we use so are unable to create an ID for him. Any assistance with this situation will be appreciated.

    Apple ID FAQs
    http://support.apple.com/kb/HE37
    Apple ID Manage Account
    http://www.apple.com/support/appleid/manage/
    Rescue Email
    http://support.apple.com/kb/HT5312

  • HT5625 I'm trying to create a new Apple ID but when I was putting on my information, there's a box asking for an ITunes gift code. What's this and how can I get one?

    I'm trying to create a new Apple ID but when I was putting on my information, there's a box asking for an ITunes gift code. What's this and how can I get one?

    You're not obligated to insert a gift code. But you can purchase gift codes on the Apple online store (gift cards or certificates) or Apple Retail store
    Gift codes are pre paid cards so you can use credit on the iTunes Store to purchase content
    To create apple ID without payment method:
    http://support.apple.com/kb/HT2534?viewlocale=pt_PT

  • I TRIED TO create an apple id, but i put another email very similar to mine, and now i dont know how to cancel my credit card from this new account, beacuse just when i finished i realised that i commited a mistake with the e-mail address.

    i tried to create a new apple account, but i put by mistake, another email, so when i finished i could do the last step, to verify the info.
    So now im worried about my credit card number because i already used on this account.
    could some one say me what to do?
    thanks to everyone.         

    If you are concerned, check with iTS to remove your CC from the account, or disable it.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

Maybe you are looking for

  • Step by step procedure for uploading photos from iPhone to a PC

    I have over 4000 pictures taken with iPhone, but still not yet be able to upload them to a PC. 1) When connected to my IBM Thinkpad X40 with Windows XP, it says "device not on" when iPhone is off, and says "device is in use" when iPhone is on. 2) Whe

  • SAP implementation for the first time

    Hi, I'm still new to SAP and need to know a few things... Could someone help me with the answers of the following questions? 1) What happens when a company goes through an SAP implementation for the first time. 2) how the company goes into project mo

  • SAP XI or BI?

    Hi All,     I have 4+ years of ABAP experience and now I am looking for extending my skillset. But I dont know which one is good. I am a technical more than functional. And have no Java knowledge. Can you please suggest me which will be good for me b

  • Configuration set-up doesn't find my airport station

    Mac OS.10.4.2. tiger sais: airport connection is not available.. the light on my airport express is lightned green. The configuration tells me there is no airport statiom on the area.. but there is! The airport express card (the old one that is used

  • Akamai Client Install Issues.

    I am attempting to download the trial for a couple of Adobe products ( After affects and Photoshop CS5 ) but with both products I get the Akamai Client Installer and when I attempt to use it I'm asked to download it from the internet, so I hit "Open"