Getting the ID

Hello,
There is a way to know the ID of the data that you are inserting, because my program insert data about peoples in database( MySql ) and some fields are optional like photo, so if people fill the photo field the photo will be stored in photo table that has 2 fields ( person_id and photo_field ),
so after someone fill the fields my program check if the photo field was filled then it insert data about the people in database and do a search
in the database to get the ID to insert the id in photo table and the photo, the problem is after register i need to do a search in database and sometimes i get the wrong ID;
Thanks You.

I am assuming that the person_id is an automatically generated (autonumber). How do you go about getting the correct ID in the first place (if you get the wrong id sometimes, that means your search key is not unique)?
I have not answer to how you could get the ID immediately after inserting in the main table. However, I could suggest something. Is is a 'real' business application or a case study? If this is just a case study and a stand-alone apps, you could get a timestamp and use it to read the main table so you would be able to get the correct person id.
insert person(including timestamp and store the value)
read person using timestamp to get id
insert picture table using id

Similar Messages

  • I am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier

    i am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier photo please help me to recover my photos

    Well I'll guess you're using iPhoto 11:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • Unable to get the values from ISearchResultList

    Hi,
    I am working on KM Indexmanagemnt API for searching with TREX, to build a search similar to msn or google.
    I am following the example of Thilo Brandt, and after building the query, I am unable to retrieve the result from ISearchResultList, the results size its displaying is zero. But session.getTotalNumberResultKeys() is retrieving a value 20.
    Here is the code I am using, please tell me where I am doing wrong.
    public class SearchComponetOne extends AbstractPortalComponent {
         public void doContent(IPortalComponentRequest request,     IPortalComponentResponse response) {
      com.sap.security.api.IUser nwUser =
                   UMFactory.getAuthenticator().getLoggedInUser();
    com.sapportals.portal.security.usermanagement.IUser user = null;
    try {
          user = WPUMFactory.getUserFactory().getEP5User(nwUser);
         } catch (UserManagementException e) {
                   response.write(e.getMessage());
       response.write("<html><head><title>Search</title></head><body>");
      ResourceContext c = new ResourceContext(user);
      try {
        IIndexService indexService = (IIndexService) ResourceFactory
                             .getInstance()
                             .getServiceFactory()
                             .getService(
                             IServiceTypesConst.INDEX_SERVICE);
       SearchQueryListBuilder sqb = new SearchQueryListBuilder();
       sqb.setSearchTerm("sap");
      IQueryEntryList qel = sqb.buildSearchQueryList();
      // get an instance of federated search
    IFederatedSearch federatedSearch =
                   (IFederatedSearch) indexService.getObjectInstance(
              IWcmIndexConst.FEDERATED_SEARCH_INSTANCE);
         List indexList = new ArrayList();
         String index = null;
         if (index != null && index.length() > 0) {
              // take a specified index from index= parameter
              indexList.add(indexService.getIndex(index));
         } else {
              // take all available indexes
              indexList = indexService.getActiveIndexes();
         // it is recommended to use a search session object
         // for searching execution
         ISearchSession session = null;
         if (session == null)
         session = federatedSearch.searchWithSession(qel, indexList, c);
    response.write("Inside doContent session.getNumberResultKeys() => " + session.getNumberResultKeys()); // output as 20
         this.renderResultHeader(response, session, indexList);
         // get all results from the search session
    ISearchResultList results =     session.getSearchResults(1, session.getTotalNumberResultKeys());
    response.write(" from session => " + results.size() + " and size is : " + results.toString());  // I am getting the results.size() as zero
    Thanks

    I think the problem is UME related. I had the same problem once. Try using a system user for searching, instead of the logged on user.
    Like this:
    com.sapportals.portal.security.usermanagement.IUser user = WPUMFactory.getUserFactory().getUser("cmadmin_service");
    Please reward the points if this helps.

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • How to get the values from a html form embedded in a swing container

    Hi all,
    I am developing an application in which i have to read a html file and display it in a swing container.That task i made it with the help of a tool.But now i want to get the values from that page.ie when the submit button is clicked all the values of that form should be retrived by a servlet/standalone application.I don't know how to proceed further.Any help in this regard will be very greatful
    Thanks in advance,
    Prakash

    By parsing the HTML.

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • Get the values from a table comparing fields of different data types

    Hi Experts,
    I want to fetch AFVC-AUFPL and AFVC- APLZL by passing WBS element from a ztable.
    select aufpl aplzl
      from  afvc
      into TABLE gt_afvc
      FOR ALL ENTRIES IN gt_boq
      where projn = gt_boq-posid.
    AFVC-PROJN - NUMC 8  (WBC ELEMENT)
    ZTABLE-POSID - CHAR24 (WBC ELEMENT)
    How to get aufpl and aplzl by comparing those 2?
    Regards
    Mani

    WBS element does have an conversion routine at the domain level. So sometimes you work with one format (8 digits) and sometimes with 24 digits.
    You use FMs
    CONVERSION_EXIT_ABPSP_INPUT
    CONVERSION_EXIT_ABPSP_OUTPUT
    to convert between values. Do your conversion before your select and do not forget to use a large enough data element for the field, which gets the 24-digits long value of the field.

  • Get the values from Exception class

    Hi all ..
    In class i have raised one exception
    when i catch this exception in my program i m able to get the
    error message but i need to get all the parameters that i pass
    when i raise the exception ...
    i have raised like this
          RAISE EXCEPTION TYPE cx_bapi_error
            EXPORTING
              textid = cx_bapi_error=>cx_bo_error
              class_name = 'ZHS_'
              log_no = wa_bapi_return-log_no
              log_msg_no = wa_bapi_return-log_msg_no
              t100_msgid = wa_bapi_return-id
              t100_msgno = wa_bapi_return-number
              t100_msgv1 = wa_bapi_return-message_v1
              t100_msgv2 = wa_bapi_return-message_v2
              t100_msgv3 = wa_bapi_return-message_v3
              t100_msgv4 = wa_bapi_return-message_v4
              STATUS = lt_status
    and caught the exception like this in my program
        CATCH cx_bapi_error INTO go_error.
          gd_text = go_error->get_text( ).
          EXIT.
      ENDTRY.
    in this i m just getting the class name which i have passed in exception
    i need all other parameters that i have passed ..
    if u have any idea pls let me know ..
    Thanks in advance ...

    Hello Jayakumar
    Usually the attributes of standard exception classes are defines as <b>public</b> and <b>read-only</b>. Thus, you should be able to use the following coding:
    DATA:
      go_error   TYPE REF TO cx_bapi_error.  " specific exception class !!!
    TRY.
    RAISE EXCEPTION TYPE cx_bapi_error
    EXPORTING
    textid = cx_bapi_error=>cx_bo_error
    class_name = 'ZHS_'
    log_no = wa_bapi_return-log_no
    log_msg_no = wa_bapi_return-log_msg_no
    t100_msgid = wa_bapi_return-id
    t100_msgno = wa_bapi_return-number
    t100_msgv1 = wa_bapi_return-message_v1
    t100_msgv2 = wa_bapi_return-message_v2
    t100_msgv3 = wa_bapi_return-message_v3
    t100_msgv4 = wa_bapi_return-message_v4
    STATUS = lt_status.
    CATCH cx_bapi_error INTO go_error.
    gd_text = go_error->get_text( ).
    WRITE: go_error->t100_msgid,  " perhaps the attributes have different name
                go_error->t100_msgno, " check attribute names in SE24
    EXIT.
    ENDTRY.
    Regards
      Uwe

  • When I login to my bank, I get the message: 403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied. Have new MacBook Air with Yosemite. How to solve this problem?

    When I try to login to the website of my bank, I get the following error message:
    403 - Forbidden: Access is denied.
    You do not have permission to view this directory or page using the credentials that you supplied.
    I have a new MacBook Air with OS Yosemite installed.
    What is the problem and how can I solve it?

    Some websites require a special client certficate for access. If you don't have that certficate, you'll have to contact the site operator to find out how to get one.
    Sometimes the problem is caused by a web server that is configured to request an optional client certificate. Safari treats the request as mandatory. In that case, other browsers such as Firefox and Chrome may be able to connect to the site, because they ignore the request.
    The first time you were prompted for a certificate, you may have clicked through a dialog that requested access to the Apple certificate in your keychain that is used to secure the iMessage service. In that case, you may be able to regain access to the site in Safari by doing as follows.
    Back up all data.
    Double-click anywhere in the line below on this page to select it:
    com.apple.idms.appleid.prd
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Keychain Access in the icon grid.
    Paste into the search field in the Keychain Access window by clicking in it and pressing the key combination command-V. An item may appear in the list of keychain items. The Name will begin with string you searched for, and the Kind will be "certificate."
    Delete the item by selecting it and pressing the delete key. It will be recreated automatically the next time you launch the Messages or FaceTime application.
    The next time you visit a site that prompts for an optional client certificate, cancel out of the prompt. You may have to do this several times before the server stops asking.
    Credit for this idea to Christian Braukmueller of SAP.

  • I'm trying to get the ios 4.2.1 on my second generation iPod . Is there a way to install it directly on my iPod touch because my iTunes on my computer is not working. Please help Apple! I need the update. Just give me a link.

    Im trying to get the ios 4.1.2 on my iPod touch 2nd generation. Can I install it directly on my iPod . My iTunes on my computer isn't working!

    you have to have itunes installed but check out http://support.apple.com/kb/ht4623.

  • How to get the last revision quote to SSRS report

    HI,
    My report current result like this
    Qoute ID
    Revision
    Q1
    1
    Q1
    2
    Q1
    3
    Q2
    1
    Q3
    1
    I would like to filter if the quote ID is same , only get the last revision quote into report
    Qoute ID
    Revision
    Q1
    3
    Q2
    1
    Q3
    1
    How can i compare the Quote ID and Revision in fetchxml or dataset filter ?
    Thank You

    <fetch distinct='false' mapping='logical' aggregate='true'> 
        <entity name='Quote'> 
           <attribute name='revisionnumber' alias='estimatedvalue_max' aggregate='max' /> 
           <attribute name='quotenumber' alias='quoteid' groupby='true' /> 
        </entity> 
    </fetch>"
    Regards, Saad

  • I am trying to open my iTunes on a Windows XP laptop and get the error message 42404 "iTunes application could not be opened.  Please repair or reinstall QuickTime".  I did that and it did not help.  Any ideas?

    I am trying to open my iTunes on a Windows XP laptop and get the error message 42404 "iTunes application could not be opened.  Please repair or reinstall QuickTime".  I did that and it did not help.  Any ideas?

    Let's see if a more rigorous uninstall/reinstall procedure gets us past that, nancy. See the following troubleshooting document:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP

  • Can't get itunes.  I get the following message when I click on either the shortcut or the program.  It says ITunes has stopped working and I can either check on line for a solution and close the program or just close the program.

    When I click on the itunes shortcut or the program  I get the following message:
    ITunes has stopped working.  My two options are:  Windows can check on line for a solution to the problem or close the program. 
    It seems that my entire library is not there.  If I sync my ipod will it add it back into my library on the computer? 
    I've even tried installing again and nothing works.  Tried the "repair" and it says that ITunes is loaded but I stil get the above error when I try to open the program.
    Thanks

    Let's try the following user tip with that one:
    iTunes for Windows 10.7.0.21: "iTunes has stopped working" error messages when playing videos, video podcasts, movies and TV shows

  • How can I get the e-mail address (reply addr.) once connected to a server

    My application ask the user to enter the POP3 server host name (+ port) more the
    POP3 server userId and password .... I can get the e-mails and show the to the user ....
    Now, the user want to send a message from that "account" and what I need
    is to know the "reply address" (the "from address") to set to the outgoing message ...
    I would like to get it somehow (from the API or in anotherway) without asking the
    user to enter it ...
    So, oonce connected to the POP3 mail server (successful login) is it
    possible to get the e-mail address of that guy ??
    please let me know if you have a solution ....
    many thanks / regards / Max

    You are of course trying to get an email address in the format of [email protected] You already have "username" the trick is the somedomain.com. I don't believe that the pop3 server has anyway to tell you this. Unless your host name is "fully qualified", i.e. pop3.somedomain.com, I don't know that you can get this information. Maybe you could take the IP address and do a reverse DNS lookup? Still you wouldn't really know if that is the domain the user really wants. For example I retrieve and send my email from aaa.com, but my domain for my reply-to is bbb.com. Your goal is noble, but perhaps not practical. That is why Outlook Express requires the user to enter their email address when setting up an account. Hope this helps.

  • How can I quickly get the same album art for all tracks on an album without manually doing them one at a time?

    I am having trouble with album art linked to each track. My library is ripped from my own cd's and ITunes only provides some of the artwork from a find artwork search. The rest must be found and added one at a time manually from web. This process is tedious and time consuming for me. Is there a file in iTunes related to each album that I can just drop the art once and it shows up linked to all the tracks from that album when they play? I've tried selecting all songs from an album and dragging the artwork to the artwork window once in hopes of all tracks getting the artwork at the same time with no luck. Any advice for this paltry artwork dilemma would be appreciated. If Cassidy & Greene still owned this ******* child of SoundJam I know I would not be having this problem! HaHa...Thanks for any advice/help with this problem.

    Thx 4 quick reply alexbird. Your method will work and after a little experimenting so will this: Just go to the album art view option and highlight the album you want artwork for. Drag the artwork from your album art web search page to bottom left hand album art window in iTunes and just drop it there. A small progress window then appears showing each album track adopting the dropped artwork one by one. It only takes 10-15 seconds for all of the tracks on your album to adopt the new artwork. I then went back and removed unwanted artwork(from the albums that had it) track by track from the get info menu. This goes pretty quick as you just pick track>get info>artwork>highlight art>delete>ok for each track.
    This drag/drop to the album art view page has been the simplest and most effective way I have discovered to manually import album artwork into iTunes so far. Hope this helps someone else out there. Any other methods or suggestions to do this task added to this thread will be duly noted. Thx... Oh, I am currently using iTunes 10.5.1

  • How to get the results in one line

    Hi
    if i use the script below i get the name of path and then : and in next line i get the results.is there a way to get the results from every path after the : and not in the next line?
    another question - is there a way that the script will not show the server name on every path?
    (Get-Counter -ListSet LogicalDisk).PathsWithInstances | Get-Counter
    THC

    If you take you script and pipe it to get member, it will give you a list of various script properties.
    (Get-Counter -ListSet LogicalDisk).PathsWithInstances | Get-Counter | get-member
    You will see that the object type returned by "Get-Counter" is Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet.
    TypeName:
    Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet
    Name MemberType Definition
    Equals Method bool Equals(System.Object obj)
    GetHashCode Method int GetHashCode()
    GetType Method type GetType()
    ToString Method string ToString()
    CounterSamples Property Microsoft.PowerShell.Commands.GetCounter.Perfo...
    Timestamp Property datetime Timestamp {get;set;}
    Readings ScriptProperty System.Object Readings {get=$strPaths = ""...
    You can try grabbing different properties, and they will print out differently, displaying the data on the same line in some cases. For example, pipe your output to a "foreach-object" block, and then for each object print out the CounterSamples property.
    (Get-Counter -ListSet LogicalDisk).PathsWithInstances | Get-Counter | foreach-object { ($_).CounterSamples }
    This should all print on one line now. However, you also asked if there was a way to not have the server print out on every line. The way to control the format of these outputs is to use the "format-table" cmdlet. So you would pipe your output to format-table
    and then give it various options. This is how you would pipe it (without any options).
    (Get-Counter -ListSet LogicalDisk).PathsWithInstances |
    Get-Counter | object { ($_).CounterSamples | format-table }#OR USE YOUR ORIGINAL CODE(Get-Counter -ListSet LogicalDisk).PathsWithInstances |
    Get-Counter | format-table }
    Now, it's up to you to give format-table the options you want. With no options, output will look unchanged. To see what options are available to you, use get-help.
    get-help format-table
    I hope this helps!
    Thank for all the info...

Maybe you are looking for

  • Purchase Order Open quantity calculation.

    Hi All.. I would like your help in finding out the logic behind calculating the open quantity for a given line item of a purchase order. Iam aware that i should go to the EKBE table to see purchase order history. Can someone tell me what are all the

  • Find product name and version using JNDI

    Is there any consistent way to find the directory servers product name and version using JNDI. Our software is being used with iPlanet 5.1 and SunOne Directory Server and I need to distinguish between them. Currently I use some code (see below) to lo

  • Where to learn about the java bytecode?

    I want to learn the JAVA bytecode. Where to find information about that?

  • Advanced editing in Adobe Forms?

    Hi, I'm struggling to create a form in which a person will be able to add dynamic strings upon necessity. For example, in a process of filling a form a person wants to add an additional text string to be filled and saved further. Is there any feature

  • Edge Animate will not open a recent project.

    I was designing a website for a class final. I closed the project for about an hour. When I came back, Edge Animate could no longer open up the project file. Does anyone know how I can fix this?