Need Answer with Create Table

Hi OTN Peeps,
I would like to ask, what's the difference between this two syntax.
create table table_name as
select * from other_table;and
create table table_name as
(select * from other_table);Thanks and More Power!

Hi,
Cloud Nines Bliss wrote:
Hi OTN Peeps,
I would like to ask, what's the difference between this two syntax.
create table table_name as
select * from other_table;and
create table table_name as
(select * from other_table);
There's no difference. Oracle often allows parentheses when they're not needed. For example:
SELECT  SYSDATE - (1 / 24)    AS one_hour_ago
FROM    dual;The results would be the same if you lost the parentheses, but it's nice to have them in this case, to make it clear that the / operation is being doen before the -.

Similar Messages

  • Need help with creating table that automatically inserts rows depending on the amount of data

    Hi there,
    I'm trying to create a table for supervisors to enter in their subordinates information and will automatically insert rows for supervisors with multiple subordinates.  This form will not be connected to a data source, the supervisors will simply fill in the form and print out.  I want it to kind of look like this:
    Name
    Position #
    Classification
    Hours
    I really appreciate any help.  Thanks!

    Hi Niall,
    You figured it out!  I didn't have javascript turned on.  Now it is working perfectly.  I think this will help me tremendously.  Thanks so much for your help!!!!!
    Laura

  • I need help with Creating Key Pairs

    Hello,
    I need help with Creating Key Pairs, I generate key pais with aba provider, but the keys generated are not base 64.
    the class is :
    import java.io.*;
    import java.math.BigInteger;
    import java.security.*;
    import java.security.spec.*;
    import java.security.interfaces.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import au.net.aba.crypto.provider.ABAProvider;
    class CreateKeyPairs {
    private static KeyPair keyPair;
    private static KeyPairGenerator pairGenerator;
    private static PrivateKey privateKey;
    private static PublicKey publicKey;
    public static void main(String[] args) throws Exception {
    if (args.length != 2) {
    System.out.println("Usage: java CreateKeyParis public_key_file_name privete_key_file_name");
    return;
    createKeys();
    saveKey(args[0],publicKey);
    saveKey(args[1],privateKey);
    private static void createKeys() throws Exception {
    Security.addProvider(new ABAProvider());
    pairGenerator = KeyPairGenerator.getInstance("RSA","ABA");
    pairGenerator.initialize(1024, new SecureRandom());
    keyPair = pairGenerator.generateKeyPair();
    privateKey = keyPair.getPrivate();
    publicKey = keyPair.getPublic();
    private synchronized static void saveKey(String filename,PrivateKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream(new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    private synchronized static void saveKey(String filename,PublicKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream( new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    the public key is:
    �� sr com.sun.rsajca.JSA_RSAPublicKeyrC��� xr com.sun.rsajca.JS_PublicKey~5< ~��% L thePublicKeyt Lcom/sun/rsasign/p;xpsr com.sun.rsasign.anm����9�[ [ at [B[ bq ~ xr com.sun.rsasign.p��(!g�� L at Ljava/lang/String;[ bt [Ljava/lang/String;xr com.sun.rsasign.c�"dyU�|  xpt Javaur [Ljava.lang.String;��V��{G  xp   q ~ ur [B���T�  xp   ��ccR}o���[!#I����lo������
    ����^"`8�|���Z>������&
    d ����"B��
    ^5���a����jw9�����D���D�)�*3/h��7�|��I�d�$�4f�8_�|���yuq ~
    How i can generated the key pairs in base 64 or binary????
    Thanxs for help me
    Luis Navarro Nu�ez
    Santiago.
    Chile.
    South America.

    I don't use ABA but BouncyCastle
    this could help you :
    try
    java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    java.security.KeyPairGenerator kg = java.security.KeyPairGenerator.getInstance("RSA","BC");
    java.security.KeyPair kp = kg.generateKeyPair();
    java.security.Key pub = kp.getPublic();
    java.security.Key pri = kp.getPrivate();
    System.out.println("pub: " + pub);
    System.out.println("pri: " + pri);
    byte[] pub_e = pub.getEncoded();
    byte[] pri_e = pri.getEncoded();
    java.io.PrintWriter o;
    java.io.DataInputStream i;
    java.io.File f;
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pub64"));
    o.println(new sun.misc.BASE64Encoder().encode(pub_e));
    o.close();
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pri64"));
    o.println(new sun.misc.BASE64Encoder().encode(pri_e));
    o.close();
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader("d:/pub64"));
    StringBuffer keyBase64 = new StringBuffer();
    String line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] pubBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    br = new java.io.BufferedReader(new java.io.FileReader("d:/pri64"));
    keyBase64 = new StringBuffer();
    line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] priBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    java.security.KeyFactory kf = java.security.KeyFactory.getInstance("RSA","BC");
    java.security.Key pubKey = kf.generatePublic(new java.security.spec.X509EncodedKeySpec(pubBytes));
    System.out.println("pub: " + pubKey);
    java.security.Key priKey = kf.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(priBytes));
    System.out.println("pri: " + priKey);
    catch(Exception e)
    e.printStackTrace ();
    }

  • I need help with creating PDF with Preview...

    Hello
    I need help with creating PDF documetns with Preview. Just a few days ago, I was able to create PDF files composed of scanned images (notes) and everything worked perfectly fine. However, today I was having trouble with it. I scanned my notebook and saved 8 images/pages in jpeg format. I did the usual routine with Preview (select all files>print>PDF>save as PDF>then save). Well this worked a few days ago, but when I tried it today, I was able to save it, but the after opening the PDF file that I have saved, only the first page was there. The other pages weren't included. I really don't see anything wrong with what I'm doing. I really need help. Any help would be greatly appreciated.

    I can't find it.  I went into advanced and then document processing but no batch sequence is there and everything is grayed out.
    EDIT: I realized that you cant do batch sequences in standard.  Any other ideas?

  • [SOLVED :)] Need help with adf table row selection

    Hi,
    In my application I am displaying results in a table. The DisplayRow property of table is set to Selected
    There are Next and Back buttons which help user to view details associated to the next/previous rows.
    I am using ADF 11g
    When user clicks Next or Previous button, then the selection of the row should also gets updated
    To achieve this i wrote below piece of code:
    this.tblS.getSelectedRowKeys().clear();+
    this.tblS.setRowIndex(count);+
    RowKeySet rks =  tblS.getSelectedRowKeys();+
    rks.add(tblS.getRowKey());+
    rks =  tblS.getSelectedRowKeys();+
    ISSUE:_
    When i run application and click Next/Previous Button, all functionalities do take place properly, but a null pointer exception is also thrown._+
    If i remove DisplayRow property of table from Selected to Default, every thing works good and no Exception is thrown_+       
    But as records in my table are going to be around 50-60 everytime, i need to set DisplayRow property of table to Selected.
    Is there any way to achieve this? Solve this problem?
    Some more details:_
    I am using a POJO class to create DataController. This DataController is having a view Object which is used to create results table.
    I have defined Primary key for my POJO Data Controller.
    Here is code of xml file:*
    +<?xml version="1.0" encoding="UTF-8" ?>+
    +<JavaBean xmlns="http://xmlns.oracle.com/adfm/beanmodel" version="11.1.1.52.5"+
    id="ProductListBean" Package="xxadf.mm.resources"
    BeanClass="xxadf.mm.resources.ProductListBean"
    isJavaBased="true">
    +<Attribute Name="Product" Type="java.lang.String" PrimaryKey="true"/>+
    +<Attribute Name="Stock" Type="java.lang.String"/>+
    +<Attribute Name="Rate" Type="java.lang.String"/>+
    +<Attribute Name="Accuracy" Type="java.lang.String"/>+
    +<Attribute Name="Details" Type="java.lang.String"/>+
    +<ConstructorMethod IsCollection="true"+
    Type="xxadf.mm.resources.ProductListBean"
    BeanClass="xxadf.mm.resources.ProductListBean"
    id="ProductListBean"/>
    +</JavaBean>+
    Error Log:*
    SEVERE: Server Exception during PPR, #1
    java.lang.NullPointerException
    at oracle.adfinternal.view.faces.model.binding.RowDataManager.getRowIndex(RowDataManager.java:200)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.getRowIndex(FacesCtrlHierBinding.java:506)
    at org.apache.myfaces.trinidad.component.UIXIterator._fixupFirst(UIXIterator.java:414)
    at org.apache.myfaces.trinidad.component.UIXIterator.__encodeBegin(UIXIterator.java:392)
    at org.apache.myfaces.trinidad.component.UIXTable.__encodeBegin(UIXTable.java:168)
    at org.apache.myfaces.trinidad.component.UIXCollection.encodeBegin(UIXCollection.java:517)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:399)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeHorizontalChild(PanelGroupLayoutRenderer.java:458)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$100(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:618)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:560)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:317)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:392)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$300(PanelGroupLayoutRenderer.java:30)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:641)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:560)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:317)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.access$100(ShowDetailItemRenderer.java:31)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:491)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer$ChildEncoderCallback.processComponent(ShowDetailItemRenderer.java:464)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer._encodeChildren(ShowDetailItemRenderer.java:406)
    at oracle.adfinternal.view.faces.renderkit.rich.ShowDetailItemRenderer.encodeAll(ShowDetailItemRenderer.java:114)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:1523)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer.access$500(PanelTabbedRenderer.java:38)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer$BodyEncoderCallback.processComponent(PanelTabbedRenderer.java:969)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer$BodyEncoderCallback.processComponent(PanelTabbedRenderer.java:920)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:125)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:201)
    at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:167)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer._renderTabBody(PanelTabbedRenderer.java:519)
    at oracle.adfinternal.view.faces.renderkit.rich.PanelTabbedRenderer.encodeAll(PanelTabbedRenderer.java:233)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:221)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:820)
    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1187)
    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1494)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:771)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
    at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
    at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:685)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:261)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:193)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
    at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Please Help I have been struggling with this issue for long.
    Thanks and Regards
    Manav Ratra
    Edited by: user11255144 on Feb 8, 2010 5:33 AM

    Hi Arun,
    Thanks for replying.
    Actually in my application there is one result table and a section that is displaying complete details of the product selectd in result table.
    The next/previous buttons are not binded with result table.
    What I am doing is, I am puuliing data from VO and displaying it on form, whenever any of these buttons is clicked.
    As soon as these buttons are clicked data is coming up, but selection state of table is not getting updated.
    So to update selection state i wrote piece of code described in my previous post.
    Everything works fine if displayRow property of table is not set to selected.
    If i set display row property of table to selected, then i get a null pointer exception with message log defined in previous post.
    Although NPE is thrown, yet all data is properly fetched and table selection is also updated. But am not able to get how this NPE is coming and hpw to fix it .
    (I need to keep displayRow = selected, for all other cases NPE is not thrown)
    Please help..
    Thanks and Regards
    Manav Ratra

  • Need Help with Unusual Table Behavior

    I've been asked to create a table with unusual behaviors, and I'm a little stuck on how to implement it. The table has cells with dates and blanks in it. The following rules need to work:
    1. If the cell has a date in it, then:
    a. If the user single-clicks on the cell, the cell should be selected. At most, the date could be highlighted and copied, but not changed
    b. If the user double-clicks on the cell, a popup window should appear that allows entry of detailed data about the date. This overrides the default behaviors of entering edit mode on double-click.
    c. If the user presses F2, the cell should enter edit mode and allow the user to edit or remove the date. This prevents the user from accidently changing an existing date, which is supposed to be a rare occurance anyway.
    2. If the cell has no date, then:
    a. If the user single-clicks a cell, double-clicks a cell, or uses the keyboard to navigate to a cell and then begins typing, the cell should enter edit mode and allow the user to enter a date. Once a valid date has been entered, the rules for #1 apply.
    Optional:
    The user can remove a date by clearing the date, but it would be nice if they could select multiple dates for deletion.
    Any ideas would be appreciated. Right now, I'm stuck on how to make the cell editable with a single click depending on whether there is a date already in it.

    Torgil wrote:
    PatrickRThomas wrote:
    Fair enough, but in all the topics I've seen on this site, I almost never see someone respond once they've been given an answer to their question. Why call me out on it and not everyone else?It's not just you. It's becoming more and more common actually. Here's an example from only yesterday (reply 3):
    [http://forums.sun.com/thread.jspa?threadID=5340766]
    Now, you may not like this, but the fact remains that this is how this particular forum works, and if you want help from the regulars here it's in your best interest to stick to the forum rules. Arguing about it almost never helps your case. (Personally I don't care much either way, but that's just me and as you can see from my posting history I'm not here very often so my opinion doesn't matter much.)
    Finally, if you want help on JTables in particular, camickr is your man, so you might want to stay on his good side :-)In that thread you cited, it's fair to point out that the person never responded, but calling him a louse, etc. was uncalled for and unprofessional. If someone had politely said that I should reply to my other threads, I would have apologized and moved on. However, that's not what happened. I was called out in a way intended to humiliate me for 2 instances, not for my failure to reply, but for failing to reply quickly enough. That's what I found to be so ridiculous, and hence, my sarcasm. In the third instance, perhaps I should have responded with a "thank you" to the second response that I received. I'll take my lumps for that one. I also took offense to the suggestion that I only replied to my previous thread because I wanted help on this one. That was just a baseless accusation.
    And for the record, the reason that I'm responding to this topic so quickly is that my email notifications are working this time. I do check my watchlist when I have a question that needs answering, but if I get pulled off onto another task, I may not check it for a while. I can't help that.

  • Creating an auto incrementing field with CREATE TABLE from Java

    I'm using the "sun.jdbc.odbc.JdbcOdbcDriver" to get a connection towards an ODBC data source that's linked to a Access (.mdb) database.
    I've tried various combinations in my CREATE TABLE statement execution in order to create a table with an auto incrementing integer but neither of them work, not even the most obvious one:
    stmt.executeUpdate("CREATE TABLE mytable(uid integer AUTO_INCREMENT PRIMARY KEY);");
    I always get this runtime exception: *java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition*; and AUTO_INCREMENT is the problem. I've tried all variations like AUTO, INCREMENT, AUTOINCREMENT and such, but nothing works.
    I've looked everywhere but couldn't find an answer to this. Thanks for the help.

    You used MySQL syntax. I think you agree with me that Access isn't a MySQL database. Either use MySQL with a real JDBC driver (recommended) or use Access syntax.
    That said, creating databases and tables using Java is a bad idea. The database and table must be already there. With Java you just do the usual table operations like select, insert, update and delete. Nothing more is needed.

  • Need help with creating custom form

    hi all,
    i'm working on creating a new form. it has 2 blocks for 2 tables. headers and lines tables. the headers table mostly have columns that are id's from other tables. i.e. customer_id, location_id etc.. in my screen, obviously i would not show the id's. i'll display the descriptions / names of the id's instead like customer_name for customer_id... but in order to do this i created a table that joins more than 2 tables. so in the block query data source name, i enter the name of this view.. then i add a ON-INSERT, ON-UPDATE, ON-DELETE triggers at block level and i call the corresponding package which does the insert, update and delete. i'm able to insert but update and delete causes a problem. "ORA-01445: cannot select ROWID from, or sample, a join.. ".. i'm thinking the reason is that when the form does an update or delete, it locks the record which causes the error.. also the reason i need the view is because i need to be able to query the customer_name in the screen instead of the customer_id... what i can't figure out is how i can make this work... or a work-around may be...
    can anyone help.
    thanks

    Matt Rasmussen wrote:
    You're right that the form is locking the record so you just need to control how it locks the record with an on-lock trigger. From the Oracle Applications Developer's Guide:
    page 3-9:
    When basing a block on a view, you must code ON–INSERT, ON–UPDATE, ON–DELETE, and ON–LOCK triggers to insert, update, delete, and lock the root table instead of the view.
    Most of the on-lock triggers I have written follow this template:
    <pre>     SELECT     field1, field2, field3
         INTO     :block.field3, :block.field2, :block.field3
         FROM     view
         WHERE     rowid = :block.row_id
         FOR UPDATE OF field1, field2, field3;</pre>
    I think once you've added this trigger, your form will work the way you want it.hi,
    i tried your suggestion but still get the same error.. anyways, here are the details of what i have so far.
    here's my table.
    CREATE TABLE XXPN_VR_VOL_HEADERS_ALL
      VOL_HEADER_ID     NUMBER,
      CUSTOMER_ID       NUMBER,
      LEASE_ID          NUMBER,
      LOCATION_ID       NUMBER,
      VAR_RENT_ID       NUMBER,
      PERIOD_SET_NAME   VARCHAR2(15 BYTE),
      PERIOD_NAME       VARCHAR2(15 BYTE),
      IMPORT_FLAG       VARCHAR2(1 BYTE),
      IMPORT_DATE       DATE,
      CALC_TYPE         VARCHAR2(30 BYTE),
      PASSTHROUGH_FLAG  VARCHAR2(1 BYTE),
      COMMENTS          VARCHAR2(2000 BYTE),
      CREATED_BY        NUMBER,
      CREATION_DATE     DATE,
      LAST_UPDATED_BY   NUMBER,
      LAST_UPDATE_DATE  DATE
    );here's my view.
    create or replace view xxpn_vr_vol_headers_v ( row_id
                                                  ,vol_header_id
                                                  ,customer_id
                                                  ,customer_name
                                                  ,lease_id
                                                  ,lease_name
                                                  ,lease_number
                                                  ,location_id
                                                  ,location_code
                                                  ,var_rent_id
                                                  ,var_rent_number
                                                  ,period_set_name
                                                  ,period_name
                                                  ,import_flag
                                                  ,import_date
                                                  ,calc_type
                                                  ,passthrough_flag
                                                  ,created_by
                                                  ,creation_date
                                                  ,comments
                                                  ,last_updated_by
                                                  ,last_update_date )
    as
      select xvvha.rowid
            ,xvvha.vol_header_id
            ,xvvha.customer_id
            ,hp.party_name
            ,xvvha.lease_id
            ,pl.name
            ,pl.lease_num
            ,xvvha.location_id
            ,loc.location_code
            ,xvvha.var_rent_id
            ,pvr.rent_num
            ,xvvha.period_set_name
            ,xvvha.period_name
            ,xvvha.import_flag
            ,xvvha.import_date
            ,xvvha.calc_type
            ,xvvha.passthrough_flag
            ,xvvha.created_by
            ,xvvha.creation_date
            ,xvvha.comments
            ,xvvha.last_updated_by
            ,xvvha.last_update_date
        from xxpn_vr_vol_headers_all xvvha
            ,hz_parties hp
            ,pn_leases_all pl
            ,pn_locations_all loc
            ,pn_var_rents_v pvr
       where -1 = -1
         and xvvha.customer_id = hp.party_id (+)
         and xvvha.lease_id = pl.lease_id (+)
         and xvvha.location_id = loc.location_id (+)
         and xvvha.var_rent_id = pvr.var_rent_id (+);here's my ON-UPDATE trigger block level
    begin
      xxpn_vr_vol_data_pkg.update_vr_vol_hdr_data ( p_vol_header_id     => :XXPNVRVOLHDRS.vol_header_id
                                                   ,p_customer_id       => :XXPNVRVOLHDRS.customer_id
                                                   ,p_lease_id          => :XXPNVRVOLHDRS.lease_id
                                                   ,p_location_id       => :XXPNVRVOLHDRS.location_id
                                                   ,p_var_rent_id       => :XXPNVRVOLHDRS.var_rent_id
                                                   ,p_period_set_name   => :XXPNVRVOLHDRS.period_set_name
                                                   ,p_period_name       => :XXPNVRVOLHDRS.period_name
                                                   ,p_import_flag       => :XXPNVRVOLHDRS.import_flag
                                                   ,p_passthrough_flag  => :XXPNVRVOLHDRS.passthrough_flag
                                                   ,p_comments          => :XXPNVRVOLHDRS.comments
                                                   ,x_last_updated_by   => :XXPNVRVOLHDRS.last_updated_by
                                                   ,x_last_update_date  => :XXPNVRVOLHDRS.last_update_date );
    end;here's my code in ON-LOCK trigger block level
    begin
      select lease_id
            ,lease_name
            ,lease_number
            ,location_id
            ,location_code
            ,customer_id
            ,customer_name
            ,var_rent_id
            ,var_rent_number
            ,period_name
            ,comments
            ,period_set_name
            ,import_flag
            ,passthrough_flag
            ,created_by
            ,creation_date
            ,last_updated_by
            ,last_update_date
        into :XXPNVRVOLHDRS.lease_id
            ,:XXPNVRVOLHDRS.lease_name
            ,:XXPNVRVOLHDRS.lease_number
            ,:XXPNVRVOLHDRS.location_id
            ,:XXPNVRVOLHDRS.location_code
            ,:XXPNVRVOLHDRS.customer_id
            ,:XXPNVRVOLHDRS.customer_name
            ,:XXPNVRVOLHDRS.var_rent_id
            ,:XXPNVRVOLHDRS.var_rent_number
            ,:XXPNVRVOLHDRS.period_name
            ,:XXPNVRVOLHDRS.comments
            ,:XXPNVRVOLHDRS.period_set_name
            ,:XXPNVRVOLHDRS.import_flag
            ,:XXPNVRVOLHDRS.passthrough_flag
            ,:XXPNVRVOLHDRS.created_by
            ,:XXPNVRVOLHDRS.creation_date
            ,:XXPNVRVOLHDRS.last_updated_by
            ,:XXPNVRVOLHDRS.last_update_date
        from xxpn_vr_vol_headers_v
       where rowid = :XXPNVRVOLHDRS.ROW_ID
         for update of lease_id
                      ,lease_name
                      ,lease_number
                      ,location_id
                      ,location_code
                      ,customer_id
                      ,customer_name
                      ,var_rent_id
                      ,var_rent_number
                      ,period_name
                      ,comments
                      ,period_set_name
                      ,import_flag
                      ,passthrough_flag
                      ,created_by
                      ,creation_date
                      ,last_updated_by
                      ,last_update_date;
    end;properties for the block
    Query Data Source Type: Table
    Query Data Source Name: XXPN_VR_VOL_HEADERS_V
    DML Target Type: Table
    DML Target Name: XXPN_VR_VOL_HEADERS_V
    i'd appreciate any help.
    thanks

  • Sql ddl replication strange behavior with create table

    Hello, I create the following table on my oracle DB server:
    CREATE TABLE test (a NUMBER(*,0) DEFAULT 0 NOT NULL,
    b DATE DEFAULT SYSDATE NOT NULL));
    ALTER TABLE test
    ADD CONSTRAINT pk_test PRIMARY KEY (a);
    when I deploy and sync, on the mobile I have the table well created, but the not null and default sysdate on the b column on are not set. It's null with no default values.
    Have anyone an idea ?
    Thank's for reply.

    We do not replicate not null or default values on Oracle Lite 5.0.2.x. This functionality will be available in the 10g release of Oracle Lite.
    - Junius

  • Using EXECUTE IMMEDIATE with Create Table SQL Statement not working

    Hi ,
    I am all the privileges given from the SYSTEM user , but still i am not able to create a table under procedure . Please see these and advice.
    create or replace procedure sp_dummy as
    begin
    Execute Immediate 'Create table Dummy99_99 (Dummy_Field number)';
    end;
    even i tried this way also
    create or replace PROCEDURE clearing_Practise(p_file_id in varchar2, p_country in VARCHAR2,p_mapId in VARCHAR2)
    AUTHID CURRENT_USER AS
    strStatusCode VARCHAR2(6);
    BEGIN
    EXECUTE IMMEDIATE 'create table bonus(name varchar2(50))';
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('ERROR Creating Table');
    END ;

    William Robertson wrote:
    Since the syntax is correct, my guess is you do not have CREATE TABLE system privilege granted directly to your account. A common scenario is that you have this privilege granted indirectly via a role, allowing you to create tables on the command line, but stored PL/SQL is stricter and requires a direct grant and therefore the procedure fails with 'insufficient privileges'.A bit like he's already been told on his first thread...
    Using of Execute Immediate in Oracle PLSQL
    Generally you would not create tables from stored PL/SQL. Also as you have found out, it's best not to hide exceptions with 'WHEN OTHERS THEN [some message which gives less detail than the one generated by Oracle]'.Again like he was told on the other thread.
    There's just no telling some people eh! :)

  • Need help with creating a brush

    Hi guys,
    I wanted to ask for help with creating a brush (even a link to a tutorial will be goon enough ).
    I got this sample:
    I've created a brush from it, and i'm trying to get this kind of result:
    but it's only duplicates it and gives me this result:
    Can someone help me please understand what i need to define in order to make the brush behave like a continues brush instead of duplicate it?
    Thank you very much
    shlomit

    what you need to do is make a brush that looks like the tip of a brush. photoshop has several already but you can make your own that will be better.
    get a paintbrush and paint a spot kind of like what you did but dont paint a stroke. make it look kindof grungy. then make your brush from that, making sure to desaturate it and everything.
    EDIT:
    oh, and if you bring the fill down to like 10-20% your stroke will look better

  • Need help with nested table

    Hi,
    I am using the following code which is failing with no data found error.
    While if i hardcode the same value the code works.
    create table test(input varchar2(10),result varchar2(10));
    insert into test values('4093163','SUCCESS')
    declare
    TYPE acctid_tab IS table  OF varchar2(40);
        acctid       acctid_tab := acctid_tab ();
    V_RESULT varchar2(20);
    v_input varchar2(40);
    i pls_integer;
    begin
    acctid := acctid_tab('4080402 4093163 64472');
    i := acctid.FIRST;
    WHILE i IS NOT NULL
    LOOP
    v_input :=   trim(substr(acctid(i),instr(acctid(i),' ',1),instr(acctid(i),' ',-1,2)));
    SElect result into v_result from test
    where input = v_input;
          i := acctid.NEXT (i);
       END LOOP;
    END;
    ORA-01403: no data found
    ORA-06512: at line 14
    declare
    TYPE acctid_tab IS table  OF  varchar2(40);
        acctid       acctid_tab := acctid_tab ();
    V_RESULT varchar2(20);
    v_input varchar2(40);
    i pls_integer;
    begin
    acctid := acctid_tab('4080402 4093163 64472');
    i := acctid.FIRST;
    WHILE i IS NOT NULL
    LOOP
    v_input :=   trim(substr(acctid(i),instr(acctid(i),' ',1),instr(acctid(i),' ',-1,2)));
    SElect result into v_result from test
    where input = '4093163';
          i := acctid.NEXT (i);
       END LOOP;
    END;
    PL/SQL procedure successfully completed.Please advise.
    Thanks in advance.

    I guess you can just do
    declare
       v_input varchar2(1000);
    begin
       v_input := '4080402 4093163 64472';
       for i in (select input, result
                   from test
                  where input in (select regexp_substr(v_input, '[^ ]*', 1, level)
                                    from dual
                                  connect by level <= length(v_input) - length(replace(v_input, ' ')) + 1))
       loop
          dbms_output.put_line(i.input || ' ' || i.result);
       end loop;
    end;
    /Or even better
    declare
       v_input varchar2(1000);
    begin
       v_input := '4080402 4093163 64472';
       for i in (select input, result
                   from test
                  where ' ' || v_input || ' ' like '% ' || input || ' %')
       loop
          dbms_output.put_line(i.input || ' ' || i.result);
       end loop;
    end;

  • I need help with creating some formulas

    I'm not sure if anyone around here can help me, but I'm trying to create a Numbers document and need some help with creating a formula/function.
    I have a column of amounts and I would like to create a formula which deducts a percentage (11.9%) and puts the result in another column.
    If anyone can help me, it would be greatly appreciated.

    Here is an example that shows one way to do this:
    The original data is in column A.  In column B we will store formulas to adjust the amounts:
    1) select the cell where you want to formula (in this case cell B2)
    2) Type the "=" (equal sign):
    3) click cell A2:
    4) now type the rest of the formula which is: "*(100-11.9)/100"  that is asterisk, then open parenthesis, 100 minus eleven point nine close parenthesis forward slash  one hundred
    The Asterisk is the multiply operator  (times) and the forward slash is the division operator (divide)
    now hit return.  select cell B2 and hover the cursor over the bottom edge of the cell:
    drag the little yellow dot down to "fill" the formula down as needed.

  • Need help with creating B*Tree XMLIndex on a structured object-relational xmltype column

    The following is my schema:
    CREATE TABLE TST_AUDIT_TBL
       NOTE                  VARCHAR2(25 CHAR)     null,
       CHANGE_HISTORY        XMLTYPE               not null,
       CHANGE_HISTORY_EXT    XMLTYPE               null
    XMLTYPE COLUMN CHANGE_HISTORY STORE AS OBJECT RELATIONAL XMLSCHEMA "http://www.oracle.com/a.xsd" element "A"
    XMLTYPE COLUMN CHANGE_HISTORY_EXT STORE AS CLOB XMLSCHEMA "http://www.oracle.com/a.xsd" element "AX"
    XML Schema for the above is defined as follows:
    <schema targetNamespace="http://www.oracle.com/a.xsd"
            xmlns:a="http://www.oracle.com/a.xsd"
            xmlns="http://www.w3.org/2001/XMLSchema"  elementFormDefault="qualified">
        <complexType name="AuditExtType">
          <sequence>
            <element name="C" maxOccurs="unbounded" minOccurs="0">
              <complexType>
                <sequence>
                  <element type="string" name="CN"/>
                  <element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
                  <element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
                </sequence>
              </complexType>
            </element>
          </sequence>
        </complexType>
        <complexType name="AuditType">
          <sequence>
            <element type="string" name="M" maxOccurs="1" minOccurs="0"/>
            <element type="string" name="O"/>
            <element name="B" maxOccurs="1" minOccurs="0">
              <complexType>
                <sequence>
                  <element name="BC" minOccurs="1" maxOccurs="unbounded">
                    <complexType>
                      <sequence>
                        <element type="string" name="BN"/>
                        <element name="F" maxOccurs="unbounded" minOccurs="0">
                          <complexType>
                            <sequence>
                              <element type="string" name="FN"/>
                              <element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
                              <element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
                            </sequence>
                          </complexType>
                        </element>
                      </sequence>
                    </complexType> 
                  </element>
                </sequence>
              </complexType>
            </element>
            <element name="T" maxOccurs="1" minOccurs="0">
              <complexType>
                <sequence>
                  <element name="TL" minOccurs="1" maxOccurs="unbounded">
                    <complexType>
                      <sequence>
                        <element type="string" name="TN"/>
                        <element name="C" maxOccurs="unbounded" minOccurs="0">
                          <complexType>
                            <sequence>
                              <element type="string" name="CN"/>
                              <element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
                              <element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
                            </sequence>
                          </complexType>
                        </element>
                      </sequence>
                    </complexType>
                  </element>
                </sequence>
              </complexType>
            </element>
            <element name="I" maxOccurs="1" minOccurs="0">
              <complexType>
                <sequence>
                  <element name="K" maxOccurs="unbounded" minOccurs="0">
                    <complexType>
                      <sequence>
                        <element type="string" name="N"/>
                        <element type="string" name="V"/>
                      </sequence>
                    </complexType>
                  </element>
                </sequence>
              </complexType>
            </element>
          </sequence>
        </complexType>
        <element name="A" type="a:AuditType"/>
        <element name="AX" type="a:AuditExtType"/>
    </schema>
    I want to create a B*Tree XML Index on the above table for the following:
    1. CN
    2. TN
    in the above schema.
    Following the doc, this is what I am issuing:
    SQL> CREATE INDEX audt_audit_idx1 ON TST_AUDIT_TBL(CHANGE_HISTORY) INDEXTYPE IS XDB.XMLINDEX PARAMETERS ('XMLTABLE IXTAB
      2  XMLNAMESPACES(DEFAULT ''http://www.oracle.com/a.xsd''), ''/A'' COLUMNS COLUMN_NAME VARCHAR2(128) PATH ''A/T/TL/C/CN'' ');
    CREATE INDEX audt_audit_idx1 ON TST_AUDIT_TBL(CHANGE_HISTORY) INDEXTYPE IS XDB.XMLINDEX PARAMETERS ('XMLTABLE IXTAB
    ERROR at line 1:
    ORA-29958: fatal error occurred in the execution of ODCIINDEXCREATE routine
    ORA-19276: XPST0005 - XPath step specifies an invalid element/attribute name:
    (A)
    Not sure what is going wrong (and what would be a working xmlindex will look like?)

    Here goes...
    1) Schema registration
    begin
    dbms_xmlschema.registerSchema(
      schemaURL => 'http://www.oracle.com/a.xsd'
    , local     => true
    , genTypes  => true
    , genTables => false
    , enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE
    , schemaDoc =>
    '<schema targetNamespace="http://www.oracle.com/a.xsd"
            xmlns:a="http://www.oracle.com/a.xsd"
            xmlns="http://www.w3.org/2001/XMLSchema"  elementFormDefault="qualified">
        <complexType name="AuditExtType">
          <sequence>
            <element name="C" maxOccurs="unbounded" minOccurs="0">
              <complexType>
                <sequence>
                  <element type="string" name="CN"/>
                  <element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
                  <element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
                </sequence>
              </complexType>
            </element>
          </sequence>
        </complexType>
        <complexType name="AuditType">
          <sequence>
            <element type="string" name="M" maxOccurs="1" minOccurs="0"/>
            <element type="string" name="O"/>
            <element name="B" maxOccurs="1" minOccurs="0">
              <complexType>
                <sequence>
                  <element name="BC" minOccurs="1" maxOccurs="unbounded">
                    <complexType>
                      <sequence>
                        <element type="string" name="BN"/>
                        <element name="F" maxOccurs="unbounded" minOccurs="0">
                          <complexType>
                            <sequence>
                              <element type="string" name="FN"/>
                              <element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
                              <element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
                            </sequence>
                          </complexType>
                        </element>
                      </sequence>
                    </complexType>
                  </element>
                </sequence>
              </complexType>
            </element>
            <element name="T" maxOccurs="1" minOccurs="0">
              <complexType>
                <sequence>
                  <element name="TL" minOccurs="1" maxOccurs="unbounded">
                    <complexType>
                      <sequence>
                        <element type="string" name="TN"/>
                        <element name="C" maxOccurs="unbounded" minOccurs="0">
                          <complexType>
                            <sequence>
                              <element type="string" name="CN"/>
                              <element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
                              <element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
                            </sequence>
                          </complexType>
                        </element>
                      </sequence>
                    </complexType>
                  </element>
                </sequence>
              </complexType>
            </element>
            <element name="I" maxOccurs="1" minOccurs="0">
              <complexType>
                <sequence>
                  <element name="K" maxOccurs="unbounded" minOccurs="0">
                    <complexType>
                      <sequence>
                        <element type="string" name="N"/>
                        <element type="string" name="V"/>
                      </sequence>
                    </complexType>
                  </element>
                </sequence>
              </complexType>
            </element>
          </sequence>
        </complexType>
        <element name="A" type="a:AuditType"/>
        <element name="AX" type="a:AuditExtType"/>
    </schema>'
    end;
    2) Table creation
    CREATE TABLE TST_AUDIT_TBL
       NOTE                  VARCHAR2(25 CHAR)     null,
       CHANGE_HISTORY        XMLTYPE               not null,
       CHANGE_HISTORY_EXT    XMLTYPE               null
    XMLTYPE COLUMN CHANGE_HISTORY STORE AS OBJECT RELATIONAL XMLSCHEMA "http://www.oracle.com/a.xsd" element "A"
    XMLTYPE COLUMN CHANGE_HISTORY_EXT STORE AS CLOB XMLSCHEMA "http://www.oracle.com/a.xsd" element "AX"
    3) Retrieving the nested table and column related to the target element :
    SQL> select dbms_xmlstorage_manage.xpath2TabColMapping(
      2           owner_name => 'DEV'
      3         , table_name => 'TST_AUDIT_TBL'
      4         , column_name => 'CHANGE_HISTORY'
      5         , xpath => '/A/T/TL/C/CN'
      6         , namespaces =>'default ''http://www.oracle.com/a.xsd'''
      7         )
      8  from dual;
    DBMS_XMLSTORAGE_MANAGE.XPATH2T
    <Result>
      <Mapping TableName="SYS_NTr0U7dPWyRu6OVvDN2f5HEg==" ColumnName="CN"/>
    </Result>
    4) Creating the index :
    SQL> create index CHANGE_HISTORY_IX1 on "SYS_NTr0U7dPWyRu6OVvDN2f5HEg==" ("CN");
    Index created
    If you're going to create multiple indexes like this, you could really benefit from renaming all the nested tables to meaningful names. That can be done via DBMS_XMLSTORAGE_MANAGE as well.

  • Primary Key Issue With Creating Tables

    Hi,
    I have the following scripts to create my two tables in oracle 10g, i was wondering wether or not i had correctly set up my primary key or if there is a better way of doing it than the way i have.
    Here are my two scripts for my tables:
    CREATE TABLE CUSTOMER (
    fname varchar2(15) NOT NULL,
    lname varchar2(20) NOT NULL,
    age varchar2(3) NOT NULL,
    custAreaCode number(5) NOT NULL,
    custNumber number(6) NOT NULL,
    constraint cust_pk PRIMARY KEY (custAreaCode),
    constraint cust_pk2 PRIMARY KEY (custNumber),
    constraint age_chk CHECK (age >=18 AND age <150)
    CREATE TABLE PHONECALL (
    startDateTime smalldatetime NOT NULL,
    custAreaCode number(5) NOT NULL, ---Reference PK From Customer Table
    custNumber number(6) NOT NULL, ---Reference PK From Customer Table
    dialledAreaCode number(5) NOT NULL,
    dialledNumber number(6) NOT NULL,
    crgPerMinute number number (3,1) NOT NULL,
    endDateTime smalldatetime NOT NULL));
    I am not sure if i have referenced the primary keys correctly in the PHONECALL table.
    Thanks in advance :)

    Hi,
    You want like this below ? I think that smalltime data type is not a valid type. Other thing, this is not a rule, but I advice you to put the primary key columns as the first columns of your table. One question: There is no PK on the phonecall table ?
    SGMS@ORACLE10> create table customer (
      2  custareacode number(5) not null,
      3  custnumber number(6) not null,
      4  fname varchar2(15) not null,
      5  lname varchar2(20) not null,
      6  age varchar2(3) not null,
      7  constraint cust_pk primary key (custareacode),
      8  constraint cust_uk unique (custnumber),
      9  constraint age_chk check (age >=18 and age <150)
    10  );
    Table created.
    SGMS@ORACLE10> create table phonecall (
      2  custareacode number(5) not null constraint fk_phone_cusarecode_customer references customer,
      3  custnumber number(6) not null constraint fk_phone_custnumber_customer references customer,
      4  startdatetime date not null,
      5  dialledareacode number(5) not null,
      6  diallednumber number(6) not null,
      7  crgperminute number (3,1) not null,
      8  enddatetime date not null);
    Table created.
    SGMS@ORACLE10> select table_name,constraint_name,constraint_type from user_constraints
    2 where table_name in ('CUSTOMER','PHONECALL') and constraint_type in ('P','U','R');
    TABLE_NAME                     CONSTRAINT_NAME                C
    CUSTOMER                       CUST_PK                        P
    CUSTOMER                       CUST_UK                        U
    PHONECALL                      FK_PHONE_CUSARECODE_CUSTOMER   R
    PHONECALL                      FK_PHONE_CUSTNUMBER_CUSTOMER   RCheers

Maybe you are looking for