Primary key problem - Urgent! PLEASE, HELP!

Hi all,
I'm new here, and I have a stupid problem, I think. If someone could help me, I'll be grateful.
I have to build a very simple JSP application using a few database tables, providing the base functionality: insert, update, delete, search.
I'm using Oracle 8.1.7, and JDeveloper 9.0.3
One table looks like that:
CREATE TABLE TEST (
     sPrimaryKey varchar2(30) not null,
     sField varchar2(100)
ALTER TABLE TEST
ADD ( CONSTRAINT test_id_pk
          PRIMARY KEY (sPrimaryKey)
I'm using a sequence for generating primary key...
CREATE SEQUENCE test_seq
START WITH 100
INCREMENT BY 1
NOCACHE
NOCYCLE;
... and a trigger before insert for seting the new value of the primary key.
CREATE OR REPLACE TRIGGER BI_TEST
BEFORE INSERT ON TEST
FOR EACH ROW
DECLARE
     new_id integer;
BEGIN
     select test_seq.nextval into new_id from dual;
     :new.sPrimaryKey := 'AAA' || new_id;
END;
I have created a BC4J. How can I insert a new row into that table without providing the primary key, by hand, and let the trigger and sequence do that?
Thank you!
Razvan

In the attribute settings editor for the Attribute TestIdPk in Entity Test:
select Updateable Never
deselect Mandatory
select Refresh After Update & Refresh After Insert
HTH.
Thanks, George

Similar Messages

  • Deleting Primary Key --- High Priority -- Please help us

    There is a custom defined table which had two primary keys and then moved the same to production. Since we got some requiremnent we added two more primary keys in the table in development server. We also activated the same in Development server. Now we need to delete the recently added two primary keys. It is a most important custom table. It is not allowing us to delete.
    It gives us error message about lot of dependencies and foreign key used in other tables.
    Please help us resolve this issue. FULL POINTS WILL BE AWARDED FOR THE SOLUTION. please help us resolve the same. Bottle neck situation.
    Regards,
    Siddhartha

    Hi Siddhartha,
    http://www.ncsu.edu/it/mirror/mysql/doc/maxdb/en/3c/384c4005a99523e10000000a1550b0/content.htm
    If you are not sorting by the primary key ( E.g. using the ORDER BY PRIMARY key ... Instead use ABAP SORT + DELETE ADJACENT DUPLICATES on an internal table, ...
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
    This links will help you to solve your  problem
    Thanks
    sunil

  • Installation problem - urgent, PLEASE help!!

    I'm trying to install Java3D and somehow it doesn't seem to be working. I'm not sure whether I should be installing the opengl or the
    directx version, but I've tried both with no luck. I'm running Windows
    M.E.
    I downloaded the JSDK beta 1.4 version (I have previously tried also
    with the 1.3 version, this didn't work either), and now have the
    jdk1.3.1 as a folder on my C drive ( C:\jdk1.3.1) . Then I downloaded
    Java3D from the website, onto C, as an executable file. When I clicked
    it, it went through the installation process (not giving me any
    options for where to install it, i was just clicking on 'next') and
    seemed to complete ok, but I'm trying to test it by running the
    helloUniverse demo, and the file isn't even there. There's a Java3D
    folder which has been created in Windows, but this just contains a
    folder called uninstall_info.
    On my Java plug-in control Panel, it is currently set to 'use java
    plug-in default'. The other options are to use JRE or JDK, in folders
    Program Files\JavaSoft or JDK1.3.1 respectively. I don't know which
    one I should be choosing! I think I tried it with the JDK option
    before and that didn't work either.
    If anyone can please help I'd be really grateful, this is getting
    quite urgent!

    Hi there!
    Well, try installing java3d in the same directory as ur java(which is c:\jdk1.3.1 for u).
    If i am not mistaken, java3d, by default, installs in c:\jdk1.2.2 directory.
    U also have 2 set the path and classpath in the autoexec.bat to addr to \bin and \lib sub-directories resp.

  • Wrt54gs problem URGENT PLEASE HELP

    hello, i have had the wrt54gs for about 4 months and my internet has been perfect but about a few a days ago, when i play counter strike source online or anything else i get ridiculous lag and it not able to play (500-600 ping), i have not changed settings or anything. when i watch the network monitor it shows about 4-5 bars on signal strength and link quality but every like 30 seconds it says you are connected to the access point but the internet cannot be found then like 30 seconds later it goes back to normal.
    i have upgraded the firmware of my router and linksys helped me change some of the settings on the router but nothing happened.
    can you please help me
    thanks
    pete
    Message Edited by Stelth2k1 on 10-27-2007 07:14 PM

    If it's working well all the while and only have the problem recently, then I guess it can be the problem on Internet connection link, or ISP side.
    Try to connect your computer directly to the DSL/cable modem, then play the game, see anymore lagging..
    picoHat
    Home Network, Wireless Network and Computer Networking Made Easy

  • Session and Refresh problem, Urgent, please help

              Hi, Dear Everyone:
              I have two questions to ask. (Environment: OS: Nt4.0, Server: Weblogic5.1)
              (1). When I use session to store an object in servlet (processed results
              from database) then dispatch to a jsp page to display the results, I got the following
              error message.
              Wed May 16 15:54:31 CDT 2001:<I> <ServletContext-General> Generated java file:
              C:\weblogic\myserver\classfiles\jsp_servlet\_ccproject\_subdisplay.java
              java.lang.NullPointerException
              at jsp_servlet._ccproject._subdisplay._jspService(_subdisplay.java, Comp
              iled Code)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:106)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:124)
              at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
              cherImpl.java:154)
              at com.voy.CCPro.DataDumper.doPost(DataDumper.java:69)
              at com.voy.CCPro.DataDumper.doGet(DataDumper.java:85)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:106)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:907)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:851)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              ContextManager.java:252)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              a:364)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              Here is my servlet code:
              HttpSession session = req.getSession(true);
              Vector temp = buildData.BuildForDisplay(rst);
              session.setAttribute("PostTitlePool", temp);
              String url = "/ccproject/subdisplay.jsp";
              RequestDispatcher dis = getServletContext().getRequestDispatcher(url);
              dis.forward(req, res);
              Here is my jsp
              <%@ page import="com.voy.CCPro.*" %>
              <%@ page import="java.util.*" %>
              <%
              Vector v = new Vector();
              v = (Vector)session.getAttribute("PostTitlePool");
              Enumeration enum = v.elements();
              SequenceData sq = new SequenceData();
              while(enum.hasMoreElements())
                   sq = (SequenceData)enum.nextElement();
                   if(sq.getIndicator()==0)
                        out.println(sq.getTitle());
                   else
                   out.print(sq.getTitle());
              %>
              Please tell me what I did wrong or What more do I need to do?
              (2). If I changed to use request.setAttribute in servlet, it works. But I got another
              strange
              result from browser. That is, if I keep on clicking refresh (IE5.5), the same result
              appending
              the previous one on the same page.
              Here is my code in servlet:
              req.setAttribute("PostTitlePool",temp);
              String url = "/ccproject/subdisplay.jsp";
              RequestDispatcher dis = getServletContext().getRequestDispatcher(url);
              dis.forward(req, res);
              Here is my jsp:
              <%@ page import="com.onvoy.CCPro.*" %>
              <%@ page import="java.util.*" %>
              <%
              Vector v = new Vector();
              v = (Vector)request.getAttribute("PostTitlePool");
              Enumeration enum = v.elements();
              SequenceData sq = new SequenceData();
              while(enum.hasMoreElements())
                   sq = (SequenceData)enum.nextElement();
                   if(sq.getIndicator()==0)
                        out.println(sq.getTitle());
                   else
                   out.print(sq.getTitle());
              %>
              Please explain it to me why that and how to fix it. I appreciate it very much.
              

    I control this as follows
    --> all JSP's don't create session (<@page session="false">)
    --> my FrontServlet checks
    session=request.getSession(false);
    if(session==null)
    //invoke method from LoginHandler (Helper Class)
    //for check logindata and create session
    else
    //invoke method from ProtectedResource (Helper Class)
    //for check, if user logged on
    --> LoginHandler
    //method UserAllowed returns true or false
    if(!UserAllowed())
    //invoke ServiceDispatcher method who displays
    //the 'AccessDenied'Page
    else
    //set loggedIn into the session
    session.setAttribute("loggedIn","OK");
    //invoke ServiceDispatcher method to display the requested Page
    --> ProtectedResource
    //check if user logged in
    Object o=session.getAttribute("loggedIn");
    if(o==null)
    //User not logged in
    //invoke ServiceDispatcher method to display 'Login' Page
    else
    //User logged in
    //invoke ServiceDispatcher method to display the requested Page
    --> URL of the Application
    Welcome: http://localhost:8000/APP/login.jsp
    submitted FORM sent to FrontServlet
    (FORM ACTION="servlet/FrontServlet")
    When everything is alright (username/password)
    new URL http://localhost:8000/APP/servlet/FrontServlet
    and the 'Main' Page is shown
    when session is timed out and i refresh page
    data is sent again (without asking for username and password)and new
    session is created and the 'Main' Page is shown again.
    How can i fix this problem
    thank you in advance :-)

  • Huge icloud problem, urgent please help

    So I broke my old iphone and my dad gave me his old one, i restored it to factory settings and then set about putting my icloud recoery on, I signed into to my apple id and icloud, then i got to a terms and conditions page which I agreed to.
    HOWEVER and here is the problem, after a small wait of 'it may take a few minutes to set up your apple id' i am presented with a screen saying choose your backup, with various dates on it. I click on the latest one, and it it says
    "enter the apple id password for 'email address' to use for store purchases (including the appstore) iTunes store, and iBooks store"
    problem is, the email address isn't one i own, i have never seen this email address before in my life it certainly doesnt belong to me, or anybody I know, and I am really rather concerend as all of my backups are in this persons email from aol...
    HELP!

    Try the following :
    1.convert your string to a unicode format and than
    compress.
    2.decompress and than convert it back to the normal
    format.
    use following code suitably :
    byte []  bytes = null;
    try {
    bytes =     string1.getBytes ("UTF8");//encode
    string2  = new String (bytes, "UTF8");//decode
    } catch (UnsupportedEncodingException e) {
    e.printStackTrace();}
    Unless my understading of Java is completely wrong, after the code you've written, string1.equals(string2) should be true.
    And that is because string1 is a Java String, in unicode format (all Java strings are in unicode format). So, with
    bytes =     string1.getBytes ("UTF8");//encodeyou get the bytes of that String coresponding to it's UTF-8 representation. Then,
    string2 = new String (bytes, "UTF8");//decodeyou create a new String (in unicode) from the UTF8 bytes representation. In my opinion, string1 is always equal with string2.
    Please correct me if I'm wrong...

  • Ipod touch restore problem *URGENT PLEASE HELP*

    Ok well I just inherited an Ipod touch from my friend who upgraded to a iPhone and it has a lock code, which I don't know. I called up my friend and asked him the code, he didn't know it of course... so i just guessed passwords and it said it was locked, I only have one more try until it locks permanently. So, I tried resetting it and it didn,t work. so i put it in recovery mode and it was gonna be ok, but my problem is I have slow dial-up internet and cannot re-download the software because my internet turns off randomly and it takes about 35 hours straight to download the 280MB, my other problem is that every time the download is disrupted, what itunes has already downloaded deletes itself and I have to start over from zero. I cannot fully download the software and have no access to hi-speed internet, I need a solution please otherwise im sitting here with a $300 piece of junk.

    Just bring it over to your friends house and have him reset it for you. Then bring it to your house to put your music on it.
    It is as simple as that. Too bad you have dial-up still. I use broadband and it is very fast.
    Timothy Z.

  • Date format Problem in OAF R12 Urgent Please help!!!

    We have acustom application in OAF which was developed in 11i. Now we migrated the same to R12.
    In this there are two date fileds getting dispayed on the page and the query for the same is
    SELECT TO_CHAR (SYSDATE, 'dd-mm-yyyy') AS CURRENT_DATE, UPPER (TO_CHAR (SYSDATE - 10, 'mon-yy')) AS g_period, UPPER (TO_CHAR (SYSDATE + 5, 'mon-yy')) AS gnext_period, TO_CHAR (sysdate,'dd-mon-yyyy') as today_date, TO_CHAR (sysdate - 1,'dd-mon-yyyy') as yesterday_date FROM DUAL
    In 11i version the output is dispaying correctly but in R12 the current date is dispayed as
    Start Date 04-Nov-5242
    End Date 04-Nov-5241
    As per logic it should be
    Start Date 09-Feb-2012
    End Date 10-Feb-2012
    Please help..Urgent issue.

    Here are the answers to your problems :
    1. Once u restart , the oracle services and the database is not mounting automatically.That is because, when you install the Oracle Oracle8i Standard Edition Release (8.1.7), the two key services namely
    OracleOraHome81TNSListner and
    OracleService<your SID name>
    are configured as manual start ( check the NT --> start>setting>control panel>services. )
    For the database to start automatically the next time you start your machine, these two services will have to be put into "Automatic Start" mode.
    < for this double click on the respective service, select the "Automatic" radio button and click on ok>.
    Now when you restart the machine, your database will be automatically mounted.
    2. this as explained above is a corollory to the above problem. you can start or stop your database on NT using the "Services" window....
    hope this helps.
    bye.
    Hi All,
    I have installed Oracle Oracle8i Standard Edition Release (8.1.7) from technet site.
    I have installed it on windows NT 4.0 .
    Installation is fine.
    I can access or get into SQL prompt .
    I have created a database also.
    1st problem
    My problem is once I restart the Machine and try to access SQL plus .it gives me an error
    ORA-01034: Oracle not available
    ORA-27101: shared memory realm does not exist.
    2nd problem
    I dont know how to start and stop the database , as there is nothing to do that in the start menu of Oracle .
    How do i do this .
    This is very urgent please help.
    regards,
    Preeti

  • Urgent, Please help me in this problem.I am getting problem while installation

    I am using Windows 8 in my system. I am trying to install Sql Server in system . Everything is fine, but finally  when i click on install button i am getting the following error .
    please help me quickly. I well be thankful to you.

    Triple post meanwhile:
    http://social.msdn.microsoft.com/Forums/en-US/7fafa499-ca1e-42f7-a117-73df924d9847/urgent-please-help-me-in-this-problemi-am-getting-problem-while-installation?forum=sqlsetupandupgrade
    http://social.msdn.microsoft.com/Forums/en-US/a1c7978c-2f84-495f-a8b6-9e9fe46654d7/getting-problem-while-installing-sql-server-2012?forum=sqlsetupandupgrade
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Have a big problem with report. Very urgent please help

    I have a report rep1. When I run the report via batch thru command rwclient to create a file it failed. I got the follwoing error message:
    REP-0177: Error while running in remote server
    Job 1413 is terminated due to connection timeout.
    It does not even try for few seconds before gives this message. I ran some other batch reports whihc took 15 minutes and they were fine.
    So, I stopped running the bad report for the day thinking the report is still not dead. I ran the same rep1 next day I still get the same error message. But this time when I ran I looked at the appserver showjobs (which lists the reports that were running and that already ran). The job number is different But still it fails in 3 seconds with the job number 1413 and connection time out. Can any one tell what might be the problem.
    Any number of times I run this job I get the same job number with same error (all this is only if I run it as batch using rwclient). If I run this as online by calling it from a form it returns the results without any problems.
    Please help. Very urgent.
    Thanks in advance.
    Asha

    You might want to delete the report server .dat file and restart the server and try
    his also could be one of the issues we had seen and fixed in 9.0.2.3. Please ensure you have the latest patch applied
    Thanks
    The Oracle Reports team

  • Encrypting and Decrypting Data(Its Very Urgent, Please Help.)

    Hi,
    Can anyone tell me some idea in the below mentioned details.
    Iam creating a Function for Encrypting and Decrypting Data Values using
    DBMS_OBFUSCATION_TOOLKIT with UTL_RAW.CAST_TO_RAW by using
    Key Value as normal.
    But the problem, is it possible to have the key value more than 8.
    Its showing me error when i give the key value less than 8 or more than 8.
    Can u tell me why it happens, is that the limit of the key value or is any other way to do that.
    Its Very Urgent, Please Help.
    Thanks,
    Murali.V

    Is this what you're looking for?
    Usage Notes
    If the input data or key given to the DES3DECRYPT procedure is empty, then the procedure raises the error ORA-28231 "Invalid input to Obfuscation toolkit."
    If the input data given to the DES3DECRYPT procedure is not a multiple of 8 bytes, the procedure raises the error ORA-28232 "Invalid input size for Obfuscation toolkit." ORA-28233 is NOT applicable for the DES3DECRYPT function.
    If the key length is missing or is less than 8 bytes, then the procedure raises the error ORA-28234 "Key length too short." Note that if larger keys are used, extra bytes are ignored. So a 9-byte key will not generate an exception.
    C.

  • Hi guys urgent please help me ASAP my ipod touch 4g reboots/restarts over and over again and i cant enter DFU mode cause my home button is stuck/broken please help guys i cant enter itunes too cause it said it needs my passcode

    hi guys urgent please help me ASAP my ipod touch 4g reboots/restarts over and over again and i cant enter DFU mode cause my home button is stuck/broken please help guys i cant enter itunes too cause it said it needs my passcode the problem is i cant even enter my passcode in my ipod touch cause its rebooting over and over again help please guys

    - See if this program will place it in recovery mode since that erases the iPod and bypasses the passocode.
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    - Next try letting the battery fully drain. The try again.

  • 4 level masetr detail  problem urgent please

    hi all
    i have page with 4 level master detail first as a form and other as tables my problem is when i click on a record at the last table the second table stop the partial triger so when i chose any record in table 2 it didnt change data in table 3 and data still as it in table 3 and 4 without changing i need to solve this problem very very urgent
    please help me
    Edited by: user554540 on 31/12/2009 11:34 ص

    Do you have the partialTriggers set correctly on the 3rd and 4th level tables?
    As an alternative, you could write a custom selection listener for table 2 and programmatically ppr the 3rd and 4th tables..

  • Replication for Data on DEV and QA - bad idea - primary key problem now

    I goofed.  I tried to use replication to keep the data on my dev machine up to date with the live server.  Now when I try to work on the database, adding new stuff, it fails.  It says there is a primary key problem every time I try to add
    a new item to a table with my program.  I should have realized this would happen!  Now, even though I've removed the replication, I'm having the problem.  Can anyone help me get my database functional again :/  Or should I resort to a database
    restore.  Thanks!

    So you have an IDENTITY column in your table? Run a
    DBCC CHECKIDENT (Transact-SQL) command with option RESEED to fix the current identity value to see if it works then.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Please Help!! I deleted the folder System en Macintosh HD and now when i on my mac it says Disk Error Press Any  Key To Restart Please HELP !!

    I deleted the folder System en Macintosh HD and now when i on my mac it says Disk Error Press Any  Key To Restart Please HELP !!

    Reinstall Mac OS X.
    (59450)

Maybe you are looking for

  • How to create a non downloadable pdf in Adobe reader X?

    Hi, How can I create a non downloadble pdf in Adobe Reader X. Please help. Regards, Shreya

  • Chnage pointers for a report

    Hi, I have a requirement where in I have to  modify all the  articles (MARC-MATNR)  which are specified in the selection screen of a report. This report would be running in back ground for every one hour. user would not be entering input in the selec

  • Multiple Value Based hierarchies per MOLAP dimension

    Hi, a) Is it possible to have multiple value based heirarchies in a single MOLAP dimension in OWB and deployed to analytical workspace ? Are there any pitfalls, that we need to be aware of... b) Can we have a mix of Value and level based heirarchies

  • JVM heapsize on solaris

    How to find default heapsize on solaris allocated for jvm? moreover how to increase it? is it stored in any file or any parameter needs to be set? please explain in detail....... thanx in advance

  • Wacom Intuos3 + PM dual 2.5 won't sleep

    Ever since I installed my Intuos3 A4 tablet from Wacom, my Powermac G5 (dual 2.5, 10.4.3) has refused to sleep. It simply wakes up as soon as the screen goes black and the fans click off. Unplugging the tablet solves the issue, but obviously I sort o