How can I create a random number and letter in a text field...

Hi All,
I am using application express. I want to get a random number and letter for a text field but not sure how to do this. Say I have a licence form and I want to get the licence number automatically when user wants to create a new licence and it needs to be unique. The format I am looking for is - HQ2631 something like this.
I am thinking I have to create a trigger but not sure how to go about this....
advanced thanks,
Tajuddin

Something to play with:
Your method can generate 26 * 26 * 10000 different licence_ids
Generating one million ids takes 20 seconds but produces between 70000 and 80000 duplicates and is rapidly getting worse (if that is something over 7%, doubling the ids generated that grows to something under 30%)
Just see if you can live with that.
select sum(collisions) all_duplicates,count(*) distinct_duplicates,max(collisions) max_multiple
  from (select licence_id,count(*) - 1 collisions
          from (select DBMS_RANDOM.STRING('',2) || trunc(DBMS_RANDOM.VALUE(1000,9999)) licence_id
                  from dual
                 connect by level <= :to_generate
         group by licence_id
         having count(*) > 1
       )Regards
Etbin

Similar Messages

  • Generate random number and letter in a text field ...

    Hi All,
    I having a bit trouble when trying to generate random number and letter in application express in a text field. Say I have a licence form and when user wants to create a licence, it will provide a random licence number in the licence number field but it has to be unique. the number should be something like HQ2345. I was trying to set the following sql in default value for that text field but it is not working -
    select DBMS_RANDOM.STRING('',2) || trunc(DBMS_RANDOM.VALUE(1000,9999))
    from dual;
    any suggesion !!!!
    thanks

    Put this as default value for your text-item
    DBMS_RANDOM.STRING('',2) || trunc(DBMS_RANDOM.VALUE(1000,9999))
    with type PL/SQL Expression. It have tested it and it works fine.
    DickDral

  • How can I find out the number of lines in a text file?

    How can I find out the number of lines in a text file?

    java.io.BufferedReader in = new java.io.BufferedReader( new java.io.FileReader( "YourFile.txt" ) );
    int lineCount = 0;
    while( in.readLine() != null )
    lineCount ++;
    System.out.println( "Line Count = " + lineCount );

  • How can I create Folders in iPod and keep all bands & artists separate?

    Hi guys,
    How can I create folders for different artists and keep them separate? Is it somthing that I need to do in iTunes in my Mac or import them a certain way?
    Anyone please,
    Thanks in advance,
    Zia

    If you have the artist information entered in iTunes, then they should already be organized like that on iPod.
    Go to music-->artists
    btabz

  • How can I create clearer, sharper images and buttons in Muse?

    How can I create buttons and images that have a vector like clarity? When I upload images (buttons, jpegs and pngs) a lot of the time they seem to have a slightly fuzzy quality to them. I have read previous posts on this matter and none have helped. Any feedback on this will be greatly appreciated. Thanks

    When you place your images in exactly the size you saved them in Photoshop or whatever, Muse doesn’t touch it.
    The quality in this case is the quality you saved the image.
    The best way is, to examine in Muse the available pixel size of the image and then use Photoshop to obtain this size
    A helpful widget to examine the potential size of an image in advance, is the "lore ipsum"-Muse-widget, that you find in the free widget collection "Andrew’s Prototypes":
    Andrew Prototypes | Exchange | Adobe Muse CC

  • How do I create a random number generator?

    I know I've done it before...but I can't remember quite how to get it going. I'm creating a math tutor program, which generates two random numbers and asks the user to add them, and if the answer is right they get a message that gives props and if they get it wrong they're told they got it wrong.
    I can't get too far because I've forgotten how to make the number generator, so what exactly do you put in to get it?
    import java.util.*;
    public class AssignmentFour3 {
         private static Random integer = new Random();
         double number1 = 0;
         Random string1 = new Random();
         }

    DrClap wrote:
    Generally I don't write my own random number generator. I just use the java.util.Random class.I read it as though that that is what he was going to use, but wasn't able to read the API docs to figure out what methods to use. ;-)

  • Help, how can I create the minor number if

    I know my device path is c0t3d2s2. eg. how can create a minor number which will be used as an input to makedevice() based upon the above info. Thanks in advance.

    Hi!
    The primery thing under Solaris is /device tree. The entries in this
    directory, so called device special files or minor nodes, are created when drivers
    attached/loaded, usually in attach routine.
    The device special files are created under /devices with a help of
    ddi_create_minor_node. There is a way to create compatibility links
    under /dev like /dev/dsk/c0t3d2s2. How to do it?
    Each minor node has so called "node type" (see:
    ddi_create_minor_node(9F), /usr/include/sys/sunddi.h).
    Solaris has programs family (devfsadm in S8) to make links into /dev,
    according "node type"
    /usr/sbin/disks - makes links for "node type" = DDI_NT_BLOCK
    /usr/sbin/tapes - makes links for "node type" = DDI_NT_TAPE
    /usr/sbin/ports - makes links for "node type" = DDI_NT_SERIAL
    /usr/sbin/audlinks - for "node type" = DDI_NT_AUDIO
    /usr/sbin/devlinks - for "node type" = DDI_PSEUDO and some other types.
    These programs are called each time the system is reconfiguration-
    booted. They only know predefined "node type" and have some internal
    rools, expressed by regular expressions, e.g. for "audlinks":
    $ strings /usr/lib/devfsadm/linkmod/SUNW_audio_link.so
    ((nt)|(te)|(aux))\,((0)|(0ctl)|(d)|(b1)|(b2)|(mgt)|(dtrace))
    sound,
    sound/([0-9]+)
    isdn/([0-9]+)
    sound,
    sound/
    isdn/
    mgt,mgt
    isdn/
    /mgt
    audio
    ddi_audio
    audio
    ^sound/[0-9]+(ctl)?$
    audio
    ^isdn/[0-9]+/mgt$
    audio
    ^isdn/[0-9]+/aux/0(ctl)?$
    audio
    ^isdn/[0-9]+/(nt)|(te)/((dtrace)|(mgt)|(b1)|(b2)|(d))$
    audio
    ^audio(ctl)?$
    SUNW_audio_link: minor_init: regular expression bad: '%s'
    ((nt)|(te)|(aux))\,((0)|(0ctl)|(d)|(b1)|(b2)|(mgt)|(dtrace))
    audio
    sound/%d
    audioctl
    sound/%dctl
    SUNW_audio_link: audio_process: can't find match for'%s'
    When you buld /dev subtree for your driver you must either to follow
    they demands or create links by hand (by script).
    You can also set the access rights for the device special files from
    within the driver.
    You can do it with a help of "add_drv". See -m key. Information from
    "add_drv -m" fall into "/etc/minor_perm" and will use each time when
    minor node will create.
    Vitaly Filatov
    Moscow, Russia
    [email protected]

  • We have too many apple devices, how can I creat another apple ID and divide the devices among 2 Apple Ids?

    Hello all,
    We started off with the original iPhone a few years ago and now between my wife and I (plus Kids) we have too many apple devices under the same apple-ID (2 X iPhone 6+, 2X macbook Pro, 2X iPod-touch and 1X iPad)
    We are constantly running into issues because everyone in the house is using the same apple id, downloading Apps using the same ID, sharing the same cloud and receiving each other's iMessages.
    I know that I can create another Apple-ID, what I am unclear on is once I do have a new apple ID, how do I assign that to half the devices (1X iPhone 6+, 1 X MBP and 1 Ipad)
    Please respond if you are able to help.
    Thank you

    I'm not sure what they told your at the Apple store, but each Apple ID can only create a single iCloud account.  If you want separate accounts for all these devices, they will have to be created using separate IDs.  Note: you can do this and still share the same ID for other services such as your iTunes store account.  The iCloud ID does not need to be the same as the ID used for other services.
    To create an account, go to Settings>iCloud and sign in with a different Apple ID.  If you want to migrate a copy of the current iCloud data to the different accounts, start by saving any photo stream photos that you want to keep to your camera roll (unless already there) by opening your my photo stream album, tapping Select, tapping the photos, tap the share icon (box with upward facing arrow), then tapping Save to Camera Roll.  If you are syncing notes with iCloud that you want to keep, you'll need to open each of your notes and email them to yourself so you can later copy and paste the text into new notes created in your new account.  Then go to Settings>iCloud, tap Delete Account (which only deletes it from this device, not from iCloud; the devices keeping the current account will not be effected by this), provide the password to turn off Find My iDevice and choose Keep on My iDevice when prompted.  Then sign back in with a different Apple ID to create your new account and choose Merge to upload your data.

  • How can I create a new name and itunes acct

    I want to give my old 2nd generation ipod nano to my son.  Can I create a new device name and itunes for the ipod?

    Yes.  I would suggest creating a separate user account for him on your PC to use to store his own separate iTunes library.  See Method 1 from this Apple support document for more information and assistance.
    How to use multiple iPods, iPads, or iPhones with one computer
    When he connects the iPod to this new iTunes library he'll need to Erase and Sync (or restore) the iPod allowing him to set it up as his own iPod and everything just as if you had just taken it out of the box.
    B-rock

  • How can I create a client console and work together with the Cache Server?

    How can I edit the following Cache-Server.cmd file to create a client console and work together with the Cache Server?
    The following is the cache server file: contacts-cache-server.cmd
    @echo off
    setlocal
    if (%COHERENCE_HOME%)==() (
    set COHERENCE_HOME=c:\coherence
    set CONFIG=C:\home\oracle\coherence\Contacts
    set COH_OPTS=%COH_OPTS% -server -cp %COHERENCE_HOME%\lib\coherence.jar;C:\home\oracle\
    coherence\Contacts;C:\home\oracle\coherence\Contacts\classes;
    set COH_OPTS=%COH_OPTS% -Dtangosol.coherence.cacheconfig=%CONFIG%\contacts-cache-config.xml
    java %COH_OPTS% -Xms1g -Xmx1g -Xloggc: com.tangosol.net.DefaultCacheServer %2 %3 %4 %5 %6 %7
    :exitEdited by: junez on 23-Oct-2009 09:20

    Hi
    To run the console, change DefaultCacheServer to CacheFactory
    Paul

  • How can i create a simple netweaver portal page that shows text and images?

    Hi,
    i have a simple question or maybe it's not so simple.
    I am completly new to SAP Netweaver 2004s Portal. At the moment i'm trying to understand the struture of the whole thing. I already know how to create roles, worksets and pages and i know how to combine the different elements so a user can acces them.
    And now i want to create a simple portal page that shows text and images. Is it possible to create such a simple page with the portal content studio? What iView do i have to use?
    (I just want to create a start page with a welcome text on it.)

    Marc
    Considering that you would any ways go ahead with complex development from this simple start page I recommend create a Web dynpro Iview for your start page (include the Iview in your page).
    For putting the contents use Netweaver Developer studio to build a simple start page application and put your static text on that Iview.
    Please go through the following log after your NWDS development is over - This will make you comfortable for further challenging work.
    http://help.sap.com/saphelp_erp2005/helpdata/en/b7/ca934257a5c96ae10000000a155106/frameset.htm
    Do reward points if this helps and let me know of you want anything more.

  • How can you create a voice recording and save it as an mp3?

    I want to create a voice recording and save it as an mp3.  How can I do that on the MAC?  Right now I can only think of recording the voice in iMovie, but it does not have a choice to save as an mp3.

    Rather that iMovie, you may want to check our Audacity.
    It's a free, open-source audio editor and recorder.
    You can easily save a recording as an MP3.
    http://audacity.sourceforge.net/
    Matt

  • ITunes how can i create a new file and put only some songs on it? I have a hard time understanding iTunes.

    I'm trying to make a new file for iTunes music. I'm really confused on how it all works. can anyone help

    Launch iTunes with the Shift key held down, create a new library, and import your music to it.
    (119794)

  • Re: How can I find my cabinet number and when it w...

    Hi,
    I've been told by BT help chat that my address can get BT Faster Broadband but not Infinity. I'm connected to the Trowbridge SSTRO exchange which is apparently "FTTC available in some areas")  Presumably that's to do with the distance of my house from either the exchange (2.2km) or the street cabinet (not sure which cabinet I'm connected to or where it is). If I've understood correctly, Faster Broadband uses the same fibre infrastructure as Infinity but because the speed can't be guaranteed as above 15Mb/s it can't be sold as Infinity. I am currently a Sky Talk subscriber so many of the BT utilities come back with an "number not recognised" error when I enter the phone number. So I guess I have 2 questions:
    o If I take up Faster Broadband, how can I find out what speed I can actually expect?   
    o How can I find out how long it will be before I can get the full Infinity service?
    I might add that a friend of mine in Trowbridge (1.1km from SSTRO) has full Infinity.
    Thanks for any help, Midsomerjambo

    Hi midsomerjambo,
    BT Infinity and BT Faster Unlimited  Broadband is just BT Retail's brandname for their fibre broadband service.
    The reason why BT Retail say you can't get FTTC BT Infinity is because the FTTC estimation is below 15mbps.
    However you should be able to get BT Faster Unlimited Broadband (FTTC) which is the same as BT Infinity FTTC but for those who have been estimated 15mbps or less on FTTC
    BT Retail set a minimum speed required in order to get BT Infinity which is an FTTC estimation of 15mbps or above, if you have been estimated less than 15mbps for FTTC then you won't be able to get BT Infinity but may be given the choice of BT Faster Unlimited Broadband which still uses the same FTTC Openreach infrastructure and equipment .
    What does it say for your landline number when you go to http://dslchecker.bt.com/adsl , If you don't have a BT Wholesale compatible number then you can check by your address by going to http://dslchecker.bt.com/adsl/ADSLChecker.AddressOutput (won't be as accurate as the landline number checker, but will give you an idea of the estimation speed)
    FTTC fibre broadband uses VDSL or VDSL2 signals that travel from the FTTC cabinet to your property via the existing copper (sometimes aluminium) line. The further away you are from your FTTC cabinet the slower the fibre FTTC broadband will be.
    However VDSL/2 signals used for FTTC broadband connection degrade far quicker in terms of distance than conventional ADSL broadband signal do.
    Generally speaking if your landline is over 1500 meters in length from the FTTC cabinet to your property then you may not be able to get BT Infinity as you may not be able to achieve over 15mbps from an FTTC service, though may be offered BT Retail's sub 15mbps FTTC service called BT Faster Unlimited Broadband.
    Here is a graph that shows the ADSL(G.DMT,ADSL2 and ADSL2+) and VDSL/2 (FTTC) signal with distance. Please be aware that all ADSL connections are depend on distance from local exchange, where as FTTC (VDSL/2) connections are depend on distance from your FTTC (DSLAM) cabinet. Though all connection types are also depend on line quality.
    This graph is also just a general estimation of what the speed could be achieved and not the actual speed you will receive. Also your line maybe longer than you would think as it may not go the direct way to either the cabinet or exchange.
    As to your other question How can I find out how long it will be before I can get the full Infinity service?
    The Openreach Superfast Fibre Broadband Scheme is being rolled out, done and managed by Openreach for ALL ISPs/CPs so BT Retail (a communication provider/ISP whom operates this forum) does not have much input or say whether Openreach will improve the FTTC fibre infrastructre in your area.
    Unless Openreach (who owns and maintain the fibre broadband infrastructure in your exchange area) either installs a new PCP and Dslam cabinet nearer to your property, or you order FTTPoD (Fibre to the Premisies On Demand) [not currently being supported by any ISP] which may cost you thousands, then I'm afraid it may be several years or so until the FTTC fibre infrastructure is improved by Openreach.
    Hope that helps,
    Cheers
    jac_95 | BT.com Help Site | BT Service Status
    Someone Solved Your Question?
    Please let other members know by clicking on ’Mark as Accepted Solution’
    Try a Search
    See if someone in the community had the same problem and how they got it resolved.

  • How can I unregister an old number and stop using it when I imessage or use Facetime?

    Hello!
    I just got a new iPhone and an old number appeared on the list of addresses that can be used while on iMessage or Facetime. How can i unregister it?
    Thanks for the help!

    Hi there WebTee,
    You may find the information in the article below helpful.
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    Unlink a phone number
    To remove a phone number from an Apple ID, sign out of FaceTime and Messages on your iPhone:
    Settings > Messages > Send & Receive. Tap your Apple ID, then tap Sign Out.
    Settings > FaceTime. Tap your Apple ID, then tap Sign Out.
    This should remove your phone number from other devices using the same Apple ID with FaceTime and Messages. If the phone number is still available on other devices after you sign out of FaceTime and iMessage on the iPhone, you may need to sign out of iMessage and FaceTime on all your devices, then sign in to FaceTime and Messages again on devices you want to use.
    Note: If you no longer have access to the iPhone that is using the number you want to remove, reset your Apple ID password.
    -Griff W.

Maybe you are looking for

  • Windows Vista 32 bit and also 64 bit driver available for my HP-deskjet 5650 color inkjet ?

    I have an HP-deskjet 5650 printer connected to my desktop pc that is running Windows XP and it prints fine. I have 2-other laptops on same network with Vista-32 bit on one and the newest laptop has Vista-64 bit. When I set up the network print connec

  • SQL Query produces different results when inserting into a table

    I have an SQL query which produces different results when run as a simple query to when it is run as an INSERT INTO table SELECT ... The query is: SELECT   mhldr.account_number ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,

  • A Few Suggestions for The i3-wm

    I've been a user of i3 wm some time. Now that am new at using (only) a wm for my everyday work, I can say that am quite satisfied the way it significantly speeds up switching between different windows and workspaces. i3 has been so far quite nice wit

  • Acrobat X doesn't release files

    Even when I close all open documents from Acrobat X, it doesn't release the files! Is there a way to make it release the files? I mean, I don't understand why it doesn't by default, but I'm hoping there's a solution? thx

  • Ora - 01536 Tablespace Quota

    I am getting an error ORA - 01536 : Space Quota exceeded for tablespace 'Tablespacename'; I have tried options like alter user <username> quota unlimited on <Tablespacename>; Grant resource to <username>; I am still getting the same error Please can