How to generate a Unique key based on a some String value

Hello every one,
I am sorry , If I post this question in wrong group... I have a requirement to generate a unique key ( what every it may be alpha, numeric or alpha numeric) based on some String..
For ex : String str = "AbCX" - Gives a unique key based on "AbCX" value..
Is there any way we can get the unique value using Java ?
Thanks

May be not what you are looking for, but here's may idea:
use a sequence (db sequence) and add it the the string value. This way the value is unique, because the sequence is unique. So you could omit the string theoretically, but your requirement is met.
It's very easy to get a unique sequence number from the db using java, depending of the technology you use (which you did not say :-( )
Timo

Similar Messages

  • How to generate a unique 8 byte number for a String in DES

    Hi All,
    Is there any way to generate a unique 8 byte number representation of String?
    I know it can be done with DES encryption (while MD5 gives 16 bytes number). My requirement is:
    Every time a String is passed - my static method should return the same unique number - all the time.
    i.e A String "AAAAAA" will return same unique number all the time. How can I achieve this (8 byte number) by DES Encryption or any other encryption?
    Thanking all in advance.

    Thanks for your reply. Won't there be any loss of data if I consider only first 8 bytes? Will Integrity be maintained.?
    In some cases my Strings can be unusually long - having length of 400 to 500.
    I want 8 bytes as I want to map the number with MySQL bigint field.

  • How to create a unique key using two or more attributes?

    how to create a unique key using two or more attributes ?

    The following example illustrate how to create a unique key using two or more attributes/fields
    Scenario: Implementing Unique Key on ManagerID & Location ID in DepartmentEO(Department Table)
    Step#1: Open the Desired Entity Object “DepartmentEO”. Go to Overview tab & Click “General” Finger tab.
    Step#2: Expand “Alternate Keys” section & click “+”.
    Step#3: In the Pop-up wizard, Enter a name for alternate Key “Unique_Manager_X_Location”.
    Step#4: Select the desired attributes/fields from available list & Shuffle to right side.
    Step#5: Now go to “Business Rules” finger tab.
    Step#6: Select “Entity Validators” in the list & click “+” to add a new entity level validation rule.
    Step#7: In the Pop-up, Select “Rule Type” as Unique Key
    Step#8: In the “Rule Definition” tab select the key “Unique_Manager_X_Location”created.
    Step#9: Now go to “Failure Handling” tab, and click the Magnifier Icon .
    Step#10: If the key is not already created then in the “Select Text Resource” Popup, Using the functional design document, Enter display value, Key and Description. And click “Save & Select” Button.
    Step#11: Now Click “OK”.

  • How to find the Org.key based on Job key and Org Unit.

    Hi,
      Please Let me know how to find the Org.Key based on the Job Key and org Unit.
    Regards
    nagendra.

    On recent ThinkPad, the Product ID Key sticker has been moved from the bottom of the unit to behind the battery.
    You need to contact Lenovo technical support directly to ask about recovery media.

  • How to generate a PDF 417 Barcode by assigning a dynamic value at runtime?

    PDF 417 Barcode Description given in the Livecycle Designer 8.2
    : PDF 417 Non-Scriptable Barcode. Value must be assigned to this barcode at design time, and this barcode will not update after form object value changes.
    And my question is how to generate a PDF 417 Barcode by assigning a dynamic value at runtime?

    All the information you described points to the problem that reports seems can't generate to a file which already exist. You can verify that by simply doing
    r30run32 C:\AC_REPORT.REP DESTYPE = FILE DESFORMAT = PDF BATCH = YES' desname=c:\temp\ac_report.pdf
    several times. If first time the report is successfully generated in c:\temp\ac_report.pdf, but not the second, third time, then it looks like there is a bug on reports r30run32 executable.
    You may try to find any latest patch for Reports 3.0 to see if patch can solve you problem. But keep in mind Reports 3.0 is de-supported, you are better to move to 6i or 9i reports.
    Thanks,
    -Shaun

  • How to generate external network number based on WBS element number

    Hi all(experts)
    I am new to PS and I have a requirment.
    <u>To derive network no. from WBS identifier.</u>
    Enhancement is CNEXOO12
    Function module is EXIT_SAPLCOKO_002(data transfer for Network number).
    I wnat to know how to use the above enhancement to generate external network number based on the WBS element  number. We have to take the Project number and extract the part of the name from it and then assign it to NETWORK and ACTIVITIY under it. The above also depends upon the project type.
    Please let me know the fields\structures\tables that are needed and available during runtime in this Function module exit. If possible with some examples.
    Thanks for your time.
    SH

    Hi Karthik
    Thanks for sending me the table relations.
    Can you please help me with the following.
    1) Can you please expand the table relations with an example because when I am doing a relation I am not able to get the AUFNR fromAUFK-->PSPEL because the there are four levels of WBS in the Project and if I plug the first level WBS from the PRPS there are no table entries found. if I put directly the WBS(fourth level X-yyyyyyy95.xxxx10.10.2) in the AUFK-PSPEL table it works and I get the AUFNR.
    2) Can I do retrieve the network number from the sales order(KDUAF).
    Please suggest.
    By enhancing this CNEX0012(EXIT_SAPLCCOKO_002) which transactions in PS are affected.
    Please reply at your earliest.
    As always thanks for your time and your help
    SH.

  • How to generate the primary key item automatically in form region?.

    Hi,
    The primary key item is generated automatically in report region.I already give the pl/sql function for generating of primary key.but I want to generate the primary key value automatically in form region only?.how to do this?.Pls help me..
    Thanks and Regards.

    One of the guidelines when selecting column for a primary key is:
    Choose a column whose data values are never changed. A primary key value is only used to identify a row in the table, and its data should never be used for any other purpose. Therefore, primary key values should rarely or never be changed.
    Cheers!

  • How to generate all possible keys for DES algorithm

    Hello every one,
    I want to generate all the possible key combinations for the DES algorithm 56-bit "actuallly 64 but the last 8 bits are just padding", so can anyone plz help how can i do that? or give me article or something that might help me?
    Thanks in advance,
    Amr M. Kamel.

    I know that but who said that it will be one
    processor it will be on distributed and clustered
    environment :). I just want to know how to generate
    the keys "or write binary".
    Thans again for your helpA cluster of 2285 machines will still take a year! The simplest algorithm is to just count from 0 to 2^56 .
    If you are thinking of cracking DES then there is a Book I have on my shelf 'Cracking DES' published by the 'Electronic Frontier Foundation' ISBN 1-56592-520-3 . It contains the C code and describes the hardware used. The hardware cost was about $100,000 and it cracks DES in about 3.5 days.
    Assuming Moore's law ( http://en.wikipedia.org/wiki/Moore's_law ) applies then it should now take about much less than a day and cost much less than $100,000. BUT - it will take a long time using basic computers.

  • Get Hardware Info to generate computer unique key

    Hello,
    I am trying to port a desktop app I have in  c# .net framework to adobe AIR.
    One of the things I need to do is generate a computer unique key to identify the computer on the server.
    In C# i would use the System.Management.Management class and get the Motherboard Serial number, CPU ID, etc... Is this possible in ActionScript? What alternatives do I have? I can't find any reference of this on the web...
    Thanks

    Unfortunately there isn't any way to do this in AIR currently.
    The only option I can think of is to use another external program to get that data and communicate it back to the AIR app. (Currently to communicate with external apps you need some sort of bridge such as Merapi for Java. In AIR 2.0 you will be able to execute external applications directly.)

  • How to generate a unique WSDL for two webservices ?

    Hi ,
    Does anyone know if there is a way to generate a unique WSDL file for two webservices ?
    Actually, the problem is more general. I have two EJB that are exposed through web services. They both contain a simple data structure that is passed back and forth.
    The Client is a C# GUI and it is having problems with that data structure. Even if it is the same data structure with the same namespace, it seems it as two different objects and so creates two different stubs ...
    I am trying to work around that from the server side, bc it does not seem that we can do it from the C# application.
    First, I am trying to generate just one WSDL that would include both webservices but I can't seem to find an easy way of doing that.
    Second, I have heard that the complex types could be referenced externaly and I think that it would do the trick as well. I don't know how to do that either.
    I am using ServiceGen Ant tags to generate my web services from an EJB.
    Did anyone encounter that issue ?
    Can any one help ?
    Thanks a lot
    Farez

    hi,
    go to t-code SNRO and create a number range from 0 to 99999999.
    call the below fm in the report by passing the created number range name to fm to generate the new number every time..
    see
    NUMBER_GET_NEXT Get next free number in a range
    CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
    NR_RANGE_NR = '01'
    OBJECT = 'YPOLLID'        "number range name created in SNRO.
    IMPORTING
    NUMBER = LS_NUMBER.       "new number with one increment..
    or
    you can try..
    you can use following code.
    select max( num ) from z_table into v_max_num.
    v_max_num = v_max_num+1.
    Regards,
    prabhudas

  • How to Get the Unique Key results from OWB Tables after Profile

    Hi,
    We are using OWB 10gR2(Paris) Beta Version.
    In this version the new feature is introduced is Data Profiling.
    We are using this feature to analylize the data in terms of stanadards.
    We have done profiling for our tables and we are able to see the results for each table in OWB Profile Results Canvas. In this window one Unique Key tab is there to see the Unique results.
    Now my question is where these results will be stored in standard tables of OWB. I want to know those exact standard tables to extract thoes Unique results in to my reports.
    After profiling we are generating HTML-DB reports to view all these profile results. But we are not able to find the Uique Key tables where these results are stored.
    So pls can anybody provide help on this to get these tables...
    Thanks in advance...,
    Ramesh P.

    You can use DatabaseMetaData#getPrimaryKeys.

  • How to generate Serial(Unique) Number for finished goods?

    Guru's,
    How do i generate Serial(Unique) Numbers for finished goods.Suppose,if we get an order for a finished good A of 10 qty.We want to generate unique number to identify each and every A item separately for quality purpose.Any help is much appreciated.
    thanks Guru's

    Depending on serial control of item, you will need to generate serial numbers at the time of WIP Completion transaction using Serial Entry window (i.e. if serial control is At Receipt) or at the time of job creation (i.e. if you are using serial control as predefined)
    In latter case, you will have to use MES or MSCA screens to perform serialized WIP completion.
    Thanks,
    Hrishi

  • How to generate a Yearly report based on a calculation at the Month level

    Have the need to create a report as follows. Any ideas on how this can be accomplished in OBI is appreciated. I have already tried different ways but non worked for me.
    The data is stored in a table at day level as follows:
    Day Amount_A Amouont_B
    1/1/2008     100     100
    1/15/2008     200     100
    2/1/2008     100     400
    2/15/2008     300     200
    1/1/2009     100     300
    1/15/2009     100     200
    2/1/2009     200     100
    2/15/2009     400     300
    The report should be displayed at Year level. Amount_A is just the summation of Amount_A from the table at daily level rolled up to the Year level in the Time dimension. The same thing for Amount_B.
    The formula for Absolute_Error is Absolute(Amount_A - Amount_B). But the problem is that it has to be calculated at the Month level instead of Day Level. So following is the logic for Absolute_Error:
    Month     Amount_A Amount_B     Absolute_Error
    Jan-2008     300     200     100
    Feb-2008     400     600     200
    Jan-2009     200     500     300
    Feb-2009     600     400     200
    The report should be displayed as follows:
    Year Amount_A Amount_B     Absolute_Error
    2008     700     800     300
    2009     800     900     500
    Note that the calculation of Absolute_Error results in a different value if it is calculated at the Month level and summed up to Year than if it were calculated at the Day level and then summed up to Year. It is required to be based on Month level for this report.
    Is there a way to do this without having to build an aggregated fact table at the Month level?

    Hi.
    Do this:
    1. Create Amount_A and Amount_B in BMM without SUM as default aggregation rule.
    2. Now, just go to Answers and make report with three columns:
    YEAR -- EXPRESSION 1 -- EXPRESSION 2
    EXPRESSION 1 is:
    sum(Amount_A) - sum(Amount_B)
    EXPRESSION 2 is:
    sum
    abs
    sum(Amount_A by MONTH)
    sum(Amount_B by MONTH)
    My example in Answers:
    TIMES.CALENDAR_YEAR
    sum(SALES.QUANTITY_SOLD_NORMAL) - sum(SALES.AMOUNT_SOLD_NORMAL)
    sum( abs(sum(SALES.QUANTITY_SOLD_NORMAL by TIMES.CALENDAR_MONTH_DESC) - sum(SALES.AMOUNT_SOLD_NORMAL by TIMES.CALENDAR_MONTH_DESC) ) )
    This will first summarize amount A and amount B on a month level and then do a difference, after that ABS and then sum on the year level.
    This is workaround to avoid larger RPD changes.
    Regards,
    Goran O
    http://108obiee.blogspot.com/

  • How to generate a unique random number in a MySQL db

    I'm creating a volunteer and also a separate vendor application form for an airshow. The volunteer and vendor info is stored in separate tables in a MySQL db, one row per volunteer or vendor. There will be about 100 volunteers and 50 vendors. When the application is submitted it should immediately be printed by the applicant, then signed and mailed in. This past year we had problems with some people who didn't immediately print their application so I'd like to still give them the option to immediately print but also send them an e-mail with a link to their specific row in the MySQL db. I have an autoincrement field as the primary key for each table, but I think sending this key to the applicant in an e-mail would be too easy for them to guess another id and access other people's info.
    I'm thinking I should add a column to each table which would contain a unique random number and I would then send this key in the e-mail to the applicant. So, can anyone suggest a simple way to do this or suggest a better way of giving the applicant a way to access their own application and no-one elses after they have submitted their form?
    Thanks all.
    Tony Babb

    Thanks so much, that was very helpful. I added the code you suggested to create and display the random number - I called it "vollink" and that worked fine. Then I added the hidden field toward the bottom of the form - it shows at line 311 when I do a "View Source in Int Explorer and then tried adding the code to add it to the table and when I tested it failed with "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1" . The test version of the page is here www.hollisterairshow.com/volunteerapp2.php . The changes I made to add it to the table is shown below , I must be missing something blindingly obvious, if you could suggest a fix I'd really appreciate it. I did add the field to the MySQL table also.
    Thanks again
    Tony
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO volunteers (firstname, lastname, email, thursday, friday, saturday, sunday, monday, activity, talents, specialrequests, tshirt, phone, street, city, st, zip, updatedby, vollink) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, $s)",
                           GetSQLValueString($_POST['firstname'], "text"),
                           GetSQLValueString($_POST['lastname'], "text"),
                           GetSQLValueString($_POST['email'], "text"),
                           GetSQLValueString($_POST['thursday'], "text"),
                           GetSQLValueString($_POST['friday'], "text"),
                           GetSQLValueString($_POST['saturday'], "text"),
                           GetSQLValueString($_POST['sunday'], "text"),
                           GetSQLValueString($_POST['monday'], "text"),
                           GetSQLValueString($_POST['activity'], "text"),
                           GetSQLValueString($_POST['specialtalents'], "text"),
                           GetSQLValueString($_POST['specialrequests'], "text"),
                           GetSQLValueString($_POST['tshirt'], "text"),
                           GetSQLValueString($_POST['phone'], "text"),
                           GetSQLValueString($_POST['street'], "text"),
                           GetSQLValueString($_POST['city'], "text"),
                           GetSQLValueString($_POST['st'], "text"),
                           GetSQLValueString($_POST['zip'], "text"),
            GetSQLValueString($_POST['vollink'], "text"),
                           GetSQLValueString($_POST['lastname'], "text"));
      mysql_select_db($database_adminconnection, $adminconnection);
      $Result1 = mysql_query($insertSQL, $adminconnection) or die(mysql_error());

  • How to generate an unique proforma document when different sales employees.

    Hi,
    I am trying to generate a proforma document from an outbound delivery. The problem is that this outbound delivery has different positions and every position has a different sales employee associated, so in the end it generates as many proforma documents as sales employees. What shoud i do in order to obtain an unique proforma document with all the positions?
    Thanks in advance,
    Luis.

    Hi
    As per your question it seems to be your output form (smartform) is dependent with employee master or role... you need to change this and form will be only one for all employee... check with your ABAPer
    Muthu

Maybe you are looking for

  • Regarding high input resistance in the FP-AI-110

    Hello. I'm struggling to measure the uA or low mA level of current from my micro power source by means of FP-AI-110. However, current values produced with less than 100 ohm of the external load applied is not correct since it is influenced by the mod

  • IOS Advance Privacy Settings

    Hi! Question: Is there a way to do any of the following: 1. Advanced Auto Purge call history, messages, browser history, notes, photos, photos metadata, events, .. etc based on single or multiple criteria 2. Advanced Auto Block calls/messages from/to

  • Error Cluster Source and Explanatio​n differ

    I have a routine that unbundles the error cluster and is supposed to append the 'source' string to some status information that had occurred before that point.  I ran some tests and found that the "Source" string differs (provides less information) t

  • How to get pictures organised the same way on the iPad as they are on the PC?

    When syncing pictures from my PC to my iPad the same albums are shown on my iPad as on my PC, but the pictures seems to be organised in random order within the albums, i.e. they are not organised the same way as on my PC. I've named all pictures on m

  • MPEG2 output

    In FCP 4.5 MPEG2 appears as a quicktime export format choice. I have done a clean install on a new computer of FCP Studio 5.0 and MPEG2 is no longer an option. Is there a way to restore this? Is this their way of forcing use of Compressor?