How to retrieve an auto generated id in a table, urgent, please have a look

say I insert an empty row in a table, say I have 3 columns which are ID, name, address.
ID is an auto incremental column, so if I insert an row with no name and no address the system still will generate an unique ID for me, so I can't use method like select ID where name = xxx and address = xxx tp get the ID. I wonder what is the best way to retrieve that ID that system just generated ?
I hope I make this question clear...
thanks

check if the method getGeneratedKeys for java.sql.statement is supported by your database driver.
If not you might be able to run another sql specific to your DB to get the generated keys
Hope this helps

Similar Messages

  • How can we give a placeholder to the complex table like "Please Select" in WPF

    How can we give a placeholder to the complex table like "Please Select" in WPF. Actually i have to give a default value like "please select" to the complex table in WPF. I tried with placeholder but its not working.
    Tags edited by: Michael Appleby

    Manu,
    What version of Agentry and WPF client?  If placeholder is not working, it is probably a WPF bug in your version.  There is no other way to do it.  Try it on a current release, and if still broken then file a bug ticket so this can be fixed.
    Jason Latko - Senior Product Developer at SAP

  • How to Create a Auto Generated number with some preceding text in Sharepoint 2010

    I am trying to create a auto generated number field in Sharepoint 2010 list item. My requirement is to have the following format number generated when new request is created in Sharepoint using form. Auto generated Ticket ID should be in the following format
    "IR13000" "IR13001" "IR13002"....... Please let me know how to get this done. I tried to use combination of default ID and Characters but its not working for new requests, its only reflecting for existing uploaded requests. I
    am trying this for taking up Ticket requests by filling up some fields in the form. Any quick help is much appreciated.
    Thanx

    Here are the steps:
    1 - Open your SharePoint site in SP Designer 2010.
    2 - Click Workflows and add a List workflow. Associate this workflow on the list where you want the Random Text to be generated.
    3 - Inside the workflow editor, select the Action "Update list item"
    4 -  Select 'Current Item'.
    5 - Click Add.. and select the field which needs to be updated with the Random Text. Make sure this column is not of type "Calculated" type, otherwise you won't see it in the list of the fields within the workflow.
    6 - Click "..." button in the next textbox which will open String Builder dialog box.
    7 - Type IR and then click 'Add or Change Lookup and select ID column from "Field from source". Hit OK.
    8 - It should look like IR[%Current Item:ID%]
    9 - Hit OK.
    10 - Save and publish the workflow. (Please note that currently this workflow is not set to auto run on creating new items. That's because we want to test it at this point of time).
    11 - Go to your list in SharePoint and create a new item. After creating, select the item and click Workflows and then run this workflow.
    12 - You should be able to see the text "IR1" in the designated column.
    13 - Once you see that it's working, go to SPD and set the workflow to run automatically on creation of the new item. Save and publish and then return to your list in SharePoint.
    14 - Create a new item there and you should see the Random value in the column.
    15 - You will also see the column in the New form. In order to remove it, go to List settings > content types > Item content type > and select Hidden for this column so that it doesn't showup in any form.
    Try it and let me know how it goes.
    Thanks,
    Ashish

  • How to make the auto generated java script not to have any html comments.

    Hello BEA Experts, As you know that auto generated javascript functions like getNetuiTagNames in Workshop are included with in the the HTML comment tags like <b><!--
    --!></b> its another thing they should be generated correctly as follows <b><!--
    //--!></b>, to hide it from browsers not supporting javascript.
    My question is there any way to stop generation of the HTML comment tags and just genrate the javascript with in teh script elements..
    Please let me know..
    Thanks in advance..
    -Bob F.

    Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
    If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
    Please clarify?

  • How to remove an auto generated ActionPreformed Event from Netbeans?

    Hi,
    How do I remove an auto generated ActionPreformed Event from my code? I accidentally created one and want to remove it. I tried to right click on the event and refactor/delete all the dependencies in the source but it wouldn't let me remove it. There shouldn't be any DEPENDENCIES it was just created.
    Thanks,
    V$H3r

    NetBeans | Help | Help Contents | Java Applications | Building Java GUIs | Designing Java GUIs | Managing Component Events | Removing Event Handlers:
    1. In the Inspector window, select the component whose event handler you want to remove.
    2. Click the Events button at the top of the Properties window.
    3. Select the event in the property sheet and click the ellipsis (...) button to display the Handlers dialog box. Alternately, you can simply delete the name of the handler you want to remove in the Properties window.
    4. In the Handlers dialog box, select the handler to remove from the list and click Remove.
    When you remove an event handler, the corresponding code block is also deleted. If more than one handler uses the same name and same block of code, deleting a single reference to the code does not delete the code itself. Only deleting all references will delete the corresponding code block, and a confirmation dialog box is displayed first.

  • HOW TO RETRIEVE A LONG RAW COLUMN FROM A TABLE AND WRITE TO OS FILE

    Good evening.
    Please how can I read a long raw datatype from a table and insert into an operating system file using PL/SQL.
    Thank you.

    What does this have to do with LONG RAW? It is about UTL_FILE and not especially great code.
    The question is how to retrieve and write LONG RAW and that is quite a different matter.
    First you must convert it to BLOB.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:13213885403654
    Then you can write it out to the file system
    http://www.morganslibrary.org/reference/utl_file.html
    Look at the "Extract Blob" demo

  • Auto generate CRUD packages for tables

    Hi there
    Is there any tool which can auto generate select/insert/update/delete packaged procedures in PL/SQL? I know that JPublisher can then create Java wrapper classes based on these packages, but it seems that the first step wouln't be that hard to implement. In fact, maybe I'll od it myself if nobody did it so far...

    Hi SQL nevigator has this fecility. you can get the crud matrix using following menu option.
    EDIT -> Insert ->Crud MAtrix
    Regards

  • How to change the auto generated thumbnail images for a clip?

    When iMovie created all the thumbnails for my clips it got most of them right, but on some of them it has choosen a frame that doens't really represent that clip.
    Is there any way to change the poster frame for each clip?

    Hi,
         Afte uploaded record it create internal number (Personal ID), and it get stored in table MESSTAB. And that internal number is stored in field MESSTAB-MSGV1. Use this MESSTAB-MSGV1 field for the further use.
    Hope, it will help you.
    Thanks & Regads,
    Poonam.

  • How to retrieve values in XML into a plsql table type

    Hi
    I have an XML doc like below which is a Web Service response message.
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
    <GetOrgInput xmlns="http://www.example.org/ComplianceServices">
    <ProgramName>PgmA-PgmB</ProgramName>
    <ItemName>800 ADSL</ItemName>
    <Orgs>923</Orgs>
    <Orgs>1163</Orgs>
    <Orgs>1103</Orgs>
    </GetOrgInput>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    From the above doc you could see that i have multiple occurrences of "Orgs" element. Usually i am using the .extract and .getSTringVal() to retrieve the values as below.
    l_string_variable := p_response.doc.extract('//'||p_name||'/child::text()',p_namespace).getStringVal();
    But in this case if i do that, i am getting value as 92311631103. I need to get them into a table type of number. Pls advice me on how to achieve this.
    Thanks
    PKV

    I'm guessing this is a bug that Oracle fixed when 10.2 came out. I can reproduce your lack of results on 10.1.0.4 and as my post above shows, it works correctly on 10.2.0.4.
    Here's a modification to the script that shows what is going on as I was debugging this. (It took me a bit to realize the difference as it wasn't what I was expecting)
    declare
       p_response_doc XMLTYPE;
       l_new_doc      XMLTYPE;
    begin
       p_response_doc := XMLTYPE('<?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <GetOrgOutput xmlns="http://www.example.org/ComplianceServices">
    <CompliantOrgs>1163</CompliantOrgs>
    <CompliantOrgs>1103</CompliantOrgs>
    </GetOrgOutput>
    </soapenv:Body>
    </soapenv:Envelope>');
       SELECT p_response_doc.extract('/*/*/*/CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
         INTO l_new_doc
          FROM dual;
       dbms_output.put_line(l_new_doc.getStringVal());
       dbms_output.put_line('before loop');
       FOR r_rec IN (SELECT value(t) val
    --   FOR r_rec IN (SELECT extractvalue(value(t)
    --      , '/CompliantOrgs'
    --      , 'xmlns="http://www.example.org/ComplianceServices"' ) val
          -- BULK COLLECT INTO l_nm_array
          FROM TABLE(
            XMLSequence(
              p_response_doc.extract('/*/*/*/CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
            ) t
       ) LOOP
          dbms_output.put_line(r_rec.val.getStringVal());
    --      dbms_output.put_line(r_rec.val);
       END LOOP;
       dbms_output.put_line('After output');
    end;On 10.2.0.4 this produces
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1163</CompliantOrgs>
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1103</CompliantOrgs>
    before loop
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1163</CompliantOrgs>
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1103</CompliantOrgs>
    After outputOn 10.1.0.4 it produces
    <CompliantOrgs xmlns="http://www.example.org/ComplianceServices">1163</CompliantOrgs>
    <Complian tOrgs xmlns="http://www.example.org/ComplianceServices">1103</CompliantOrgs>
    before loop
    <CompliantOrgs>1163</CompliantOrgs>
    <CompliantOrgs>1103</CompliantOrgs>
    After outputAs you can see, Oracle is removing (well technically not adding) the default namespace to the extracted nodes. To compensate, you need to change your loop to look like
       FOR r_rec IN (SELECT extractvalue(value(t)
          , '/CompliantOrgs') val
    --      , 'xmlns="http://www.example.org/ComplianceServices"' ) val
          -- BULK COLLECT INTO l_nm_array
          FROM TABLE(
            XMLSequence(
              p_response_doc.extract('//CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
            ) t
       ) LOOPso that extractValue is not expecting any namespaces associated with the nodes.
    I would suggest you document this so you will know why things break if you upgrade to 10.2 or later at some point in the future.

  • How to retrieve text messages that I mistakenly deleted??(Please help!!)

    I've had the Verizon VX8300 for 3 years since 2007 and I have upgraded to the HTC Incredible Droid and received it as a Christmas gift on Christmas morning. When my dad was disconnecting the old phone, I figured that it would be automatically transferable because everything else transferred like my contacts, voice messages, pics, etc. I was looking through old texts and accidentally deleted all of my texts that I've kept for souvenir and they were very memorable and special to me from friends/family. Now I was wondering if there's anyway I can get this data back whether it's getting a printout or using an online free trial of a text message retriever like Asfotech, Bitpim, or Wondershare Data Recovery. I've went to 3 different Verizon stores and none were helpful and didn't even bother looking at my old phone.
    PS: I know you need like a court order or a subpoena but that is extremely silly and unnecessary because would I honestly need a court order just to retrieve harmless innocent messages like "What's Up?" or "How's it going, man?". Someone said that Verizon archives the messages and it's my privacy so I should have the right to get a printout of MY messages and it would be so messed up if Verizon wouldn't let someone look at their OWN text messages on their OWN phone if they deleted them on accident. It's not like they would be invading my privacy anyways all they would need to do is print them out without looking at them. I have nothing to hide anyways so it wouldn't be a big deal to me.

    I understand what you are saying but whats to say for example the account owner (a parent) decided to have all the messages retrieved for them of their child who is on the account??? Verizon has NO IDEA if that person is their child, relation, boyfriend, employee..... That is why court orders are necessary.
    But in your case unless the messages you want are from the last 6-10 days, they are (as Ernie Harwell used to say) "LONG GONE" from Verizon's servers.
    I know the feeling of losing texts you planned to keep. A few months ago, I was playing with force closing apps and in doing so deleted a bunch I was keeping. That is why I found an app to sand messages to an email address also.

  • How to retrieve invoice details from the sales order .. urgent..

    hi,
    i am retrieving  vbak-vbeln with this i should retreive invoice details
    how to relate vbak with abrk table
    i have vbak -vbeln,erdat,VBAK- VKORG,VBAK-KUNNR,VBAK-VTWEG,VBAK- SPART.
    its urgent..

    Hi
    U can see the sales order number in VBRP table, fields:
    VBRP-AUBEL and VBRP-AUPOS.
    But if u have the sales order number it's better to use VBFA table.
    SELECT * FROM VBFA WHERE VBELV = VBAK-VBELN
                         AND VBTYP_N = 'M'
      SELECT SINGLE * VBRK WHERE VBELN = VBFA-VBELN.
      IF SY-SUBRC = 0.
        WRITE: 'Bill number:', VBRK-VBELN.
      ENDIF.
    ENDSELECT.
    U have to make sure to use the right document type:
    M = Invoice
    N = Invoice cancellation
    So the bill type depends on the sales order type
    Max

  • How to retrieve notes and contacts from iCloud backup account? Please help

    How can I retrieve data ( contacts, notes, photos) after erased all after update by accident??
    I tried but can't manage. It's like a new phone now, nothing left.. Very upset(((

    Bump.
    Anybody want to help me?
    Now my iCloud storage is full and I can't backup my device because I'm afraid to loose my old backup.

  • How to retrieve a statistic sample from a database table

    Hi experts,
    Let's say I have a 100.000 rows table and I want to take a representative statistical sample from that table.
    Say, it should be 5% (or 5000 rows).
    Question is: How to ensure that the sample is representative?
    This is not guaranteed by UP TO N ROWS because the database selects without having an order by  or WHERE starting reading the first db blocks until it reaches  the limit of 5000 rows.
    SELECT * UP TO 5000 rows into table .... from ZSAMPLE.
    This means I miss mostly of the records in the table, hence the sample is not representative.
    Do you ever encounter such a problem?

    You could SELECT (with package size if desired) into an internal table.  Then:
    Select * from table into internal table........
      package size 10000.  "not really necessary for 100000 row table
    *Initialize a counter of type i.
      lv_counter = 0.
    loop at the internal table.
      lv_counter = lv_counter + 1.
       if lv_counter lt 20. "1 in 20 = 5%
         delete internal table. "drop this row.
       elseif lv_counter eq 20.
         lv_counter = 0. 
    endif.
    endloop.
    endselect.  "if you used package size.
    at the end you would have kept every 1 out of every 20 records from your original table select.  Be sure to use a package size (if needed ) that is an exact multiple of 20.  To futher randomize the table, you could sort on some field that has random values, etc. before doing the every 20th record retention.

  • How to retrieve the data from the data base,-- its urgent!

    public class UserInfo extends GenericServlet
    public void service(ServletRequest req,ServletResponse res)throws ServletException,IOException
    res.setContentType("text/html");
    PrintWriter out=res.getWriter();
    Connection con=null;
    PreparedStatement pst=null;
    ResultSet rs=null;
    try{
    con=DriverManager.getConnection("jdbc:mysql://localhost/userdetails","mysql","xxxx");
    pst=con.prepareStatement("select * from user_info where ufn=? and uln=? and ueid=? and uname=? and upass=? and urd=? and uage=? and sem=?; ");
    rs=pst.executeQuery();
    if (rs.next())
    {out.println("first name"+rs.getString(1)+"Last name"+rs.getString(2)+"email ID"+rs.getString(3)+"Login name"+rs.getString(4)+"password: masked <br>Registration Date "+rs.getString(7)+"Users age"+rs.getString(8)+"Employed or not if yes 1 and for No 0"+rs.getString(6)   );
    return  ;
    catch(Exception e){out.println(e);}
    finally{try{con.close();}catch(Exception e){out.println(e);}}
    exception : is http method not found ......
    please help me

    1) When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
    2) I don't know what you are saying is not found. More information would be helpful.
    3) You had better think of binding some parameters to your PreparedStatement/.
    4) Please close your ResultSets and Statements as well as your Connections.

  • How to include text items in a block...urgent please.

    I have one form, basically at the first level, it in turns calls other forms too. However, I have add two columns i.e. sales_no, and date_closed at job level. The form is at project level. When the user apply ENTER_QUERY mode on project, then all the projects already closed should display sales_no and date_closed otherwise leave them bank. Project comes from project_master and sales_no, date_closed comes from job and both are linked via project_no, and entity. Could anyone help please?

    Hi Jhon,
    You have my thanks for your reply and then let me explain the stuff I am doing. The method you have suggested, I am already applying the same techniques. The items are there in the block along with other items. However, when I add my two text items which comes from another table which has relationship with the table being used by the block, though the block is couple of other inter-related tables too. Now when I add my text items I dont apply any triggers, but when I run the form it gives me error, invalid field item. My question is where I can add the triggers for the two items, and how can it be successfully embedded inside the block. I dont know if that makes sense. I'll appreciate your help in this matter. Thanks
    Zahir

Maybe you are looking for

  • Print issue with Photoshop CS4 and Officejet 6500

    I have a Windows 7 Business 64 bits desktop computer. After  installing the Officejet Pro 6500 multifunctional drivers all was  working OK. Images were being printed nice and with the correct size  using Windows print option. After installing Adobe C

  • How do i save Page 5 to 6 from a big Document in a new Document?

    I need a little sample Code for VBA. Thank you for support

  • Conditional Page breaks In Adobe forms

    hi experts... I have to do conditional page break for item table for each VBELN. if  vbeln has more than 5 line items ...Have to do page break and remaining items have to display on next page.. thanks in advance bala...

  • SWF goes white at end despite stop command

    The title says it all really; I've got a simple FLA that just slides some content into place. It's got a stop frame at the start because it's actually a submovie of a parent movie (and the stop on the first frame accommodates the preloader in the par

  • PLEASE HELP - No Audio or video on new iMac

    Hello all. I have a new iMac. 3.5months old. Just this week it started acting up on me. I cannot play any audio or video files. itunes won't play songs, YouTube won't play videos, etc. I can't figure it out. I've tried renewing Quicktime but it says