Assigning a Unique Number to a Row

Greetings,
I saw this discussion once before but can't find it now.
I'm looking for a way to assign a unique ID to a new record without using the 'auto-increment' function of MySQL.  I considered having a one-record table with fields <last_cust>, <last_mbr>, <last_order>, <last_item>, etc. and upon 'submitting' my new record form data, first go and get the <last...> simultaneously adding 1 to the old data (or add 1 to <last...> then subtract 1 before adding the new record.  I suspect I can't do this with one query thus leaving the possibility of simultaneous overlapping queries from 2 users.
By simultaneous overlapping, I mean:
User 1 executes the increase by 1
User 2 does the same before User 1 retrieves his/her updated value
Possible? Suggestions?
Thanks in advance.
Tom

bregent, shocker:  Thanks for replies.
My concern was that when using an auto-increment for my membership and inventory files I would not be able to capture the new 'id_nbr' without a query based upon the inventory description or member name.  The inventory display page, especially, needs to be able to show a photo of the item (maybe also a member photo on the membership page!).  I thought that if I could immediately capture the new item/member id_nbr, I would not have to cycle too far to present the opportunity for user to upload the photo and the photo file name would be the same as the id_nbr (make sense?).
bregent:  With the possibility that my (or a future host) won't support 'isolation', I'll probably not look at this; However, your suggestion on table format makes sense, so thanks.
While awaiting a reply, I considered writing the 'session_id' to the membership and inventory file(s) as the new record is added.  Since I have it ongoing thru pages as the user proceeds, the page to upload the photo could have the session_id as the getRecords query WHERE CLAUSE thus ensuring they only get 'their newly added' record.
Tom

Similar Messages

  • How to assign a unique number to the name column of a document set?

    How can I assign a unique number to the name column of a document set preferably with workflows? (Perhaps this number can increase by one each time a new document set is created)
    When a user attempts to create a new document set, this unique number should be already there as the name of the document set.
    (However, It seems that access and edit the Name column is more tricky than the other columns)

    Hi,
    To use document ID instead of Name column, you can
    Modify View and hide Name column. Then make Document ID to display at the left column.
    By default, document ID will be assigned to both document items and document sets. You may
    experience delay before you can see document ID assigned to existing document items and document sets because the scheduled document ID assignment timer jobs haven't finished yet.
    Miles LI TechNet Community Support

  • Assign unique ID to each row in Cube

    Hi All
    I want to assign a unique requestID to each row in cube. I was thinking of assigning a unique id using number range. For this i need to read the buffer and update the buffer with new requestid value
    Can anyone help me out as to how to update buffer value

    Hi,
    you can use a characteristic relationship of type exit to achieve your requirement
    https://help.sap.com/saphelp_nw73/helpdata/en/4c/b82d6b54182102e10000000a42189e/content.htm
    hope it helps.

  • A unique company code has not been assigned to company number 1000

    Dear Friends,
    When I do Inter-Company Transaction thro Transaction Code FB60 it is giving me Error.
    For Example: if I have 2 Company Codes - 8001 & 8002
    I want to Post One Vendor Invoice
    Ex:
    Vendor - 301 ABC Ltd., 5000 Credit
    400020 - Expenses 2000 Debit - Company Code - NGLC
    (Then Debit Expenses G/L Account 460000 for Company Code NGLC1)
    400020 - Expenses 3000 Debit - Company Code - 1000
    (Then Debit Expenses G/L Account 460100 for Company Code 1000)
    When I am going to POST it is giving me an Error please sees below.
    Error Message
    A unique company code has not been assigned to company number 1000
    Message no. GLT0001
    Diagnosis
    Document breakdown is active in your system. In certain cases, a company code is derived from the company ID number, and this must lead to the assignment of a unique company code.
    A unique company code could not be assigned to company number 1000.
    System Response
    You cannot carry out the required posting.
    Procedure
    Assign one company code to company number 1000.
    Please tell me How to solve this issue.
    Thanks in Advance,
    Ranga

    Hi Ranga
    Can you please check OBY6 settings (Additional details) for the co. codes, as it seems either multiple co. codes have been assinged to company number 1000 or none of the relevant co. codes have been assigned with company ID.
    Regards

  • Unique company code has not been assigned to company number

    Dear Experts,
    When I am posting the customer advance amount in FBCJ I am getting the below mentioned error.
    Unique company code has not been assigned to company number
    Message no. GLT0001
    Diagnosis
    Document breakdown is active in your system. In certain cases, a company code is derived from the company ID number, and this must lead to the assignment of a unique company code.
    A unique company code could not be assigned to company number .
    System Response
    You cannot carry out the required posting.
    Procedure
    Assign one company code to company number .
    Did I miss any config settings.
    Thanks in advance,
    Regards
    Aswin

    Hi,
    We faced the same issue and we managed to solve it thanks to SAP Support assistance. The system at the time of posting is looking for a value in the Field "Trading Partner" in the FBCJ Transaction code. That field is required because the item is like a Company Code clearing therefore if the field is not filled it cannot determine the Company code during posting.
    To solve this you have two approaches:
    To treat each Cash journal separately you need to Fill the Trading Partner field individually in the FBCJ with the respective value. Select the same Trading Partner as your original company code (even if you select other company code you cannot post Inter company through FBCJ).
    Go to FS01/FS02 of the particular account you face this issue and define a Trading Partner in the Type/Description Tab under Consolidation data in Chart of accounts. With this way the Trading Partner will apply for all postings concerning that particular GL Account and there will be no need for the first approach described above.
    I hope this helps.
    Regards,
    Athos Kyriakides

  • The unique company code has not been assigned to company number

    Hi,
    When i am posting invoice (MIRO) the following error is coming "The unique company code has not been assigned to company number" message number GLT0001, (origin - Post). We have only one company code and i have given six digit unique number also and assigned it to the company, still i am unable to post invoice.
    Awaiting valuable suggestions
    Sudheer

    Hi,
    Please check in Company Code's Global parameter whether company has been entered in Accounting Organisation section.
    Award points, if found helpful.
    Regards,
    Harish

  • The number of the rows in a tabular style

    hello to all
    i have a problem creating a column that gives me the # of the row in tabular with form builder
    can anybody give me help with that please?

    The rownum pseudo-column hold the number of the row but it doesn't work like you expect. It is assigned before sorting for example and it is not absolute. SQL conceptually deals with sets and sets have no inherent order. See http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    If you want to have an absolute number in a row you will need to maintain it yourself with PLSQL code.

  • How to force SQL*Loader to assign the same SYSDATE for all rows?

    I want to use SQL*Loader to load some rows and a "SYSDATE" generated column, but making sure this date is THE SAME for all rows. I have seen that if I load HUNDREDS of rows there is a little difference between them (in terms of seconds). I guess it is "the moment each row entered the DB", but I need the same value for all rows (preferably, "the moment SQL*Loader was launched"). Is there any way to achieve this?
    Thank you very much.

    Hello user2393320.
    Given some thought, using a date value to identify all records from a single load isn't very wise.
    Are you able to create a procedure on the database that could be executed during SQL*Loader's execution? If so, you could develop the procedure to take in the record number of the row being loaded as an input parameter and output this unique date value for all rows loaded. The procedure would need to store the date value in a table when the first row is being loaded and return the stored date value as its output. This obviously assumes that only one sqlldr session is running at any time.
    I highly recommend using a numeric sequence in the control file instead of a date to identify each file load:
    , file_load_seq SEQUENCE(MAX, 1)
    Another approach would be to load the record number being loaded in addition to the sysdate:
    , record_number RECNUM
    Hope this helps,
    Luke

  • How to select  random and unique number

    hi all
    suppose i have millions of rows in emp table
    i want to select group of empno
    group of records would be 10
    all records uniquely selected
    make sure all records are selected in any Group
    thanks

    BluShadow wrote:
    Solomon Yakobson wrote:
    3360 wrote:
    It is the definition of random that the each value generated has an equal chance of being generated again. A coin toss is random despite the result only having two values.Absolutely. Except one little thing. The above applies if we randomly pick from same set. Now OP asked to randomly select group of objects. This is same as you have a set of unique objects and you randomly pick one and put it in your pocket. Then you randomly pick another object and put it in your pocket. So you end up with a UNIQUE set of randomly picked objects in your pocket. Now DBMS_RANDOM allows to specify low & high value but it doesn't allow to provide something like "pick N values" or except list to mimick "put in your pocket" part. That is why we have to write something like I suggested to OP.
    SY.In that case it should just be an answer like...
    select * from tablename where rownum <= 10because the order is not guaranteed without an order by clause and therefore that's just as random as needed to meet the requirements. ;)hi BluShadow
    rownum surely give unique number of records but it will not A RANDOM....
    thanks

  • Number of visible rows

    hi,
    I want to display all the records of the table without restriction. Normally If I have 1000 records then the number of visible rows will be equal to the length of the table and we get scroll option to see the other records. If I want to make the number of visible rows equal to number of records is it possible?
    thanks,

    Hi,
    Assign the count of records to the 'No of rows' property of the table.
    Regards
    Basheer

  • Need unique number ranges for self billing, retro billing, and manual credi

    Need unique number ranges for self billing, retro billing, and manual credit/debit memos.

    Hi,
    I guess you are using different document types for normal billing, self billing and retro.  So maintain different numbers for these document types in VN01 and assign the number range in VFOA (document type)
    ~Thanks!
    Rajesh

  • How Can I Print A Unique Number on a Series of PDF documents?

    I have a weird question that I could not find an answer for via search previous questions. I essentaily have a PDF flyer that I want to print X copies of (where as X is a number, 50, 150, whateve amount I need at the moment). I want to have a unqiue number printed on each copy (sort of like a serial number). So Copy 1 would have a number of  909, copy 2 would have a new numbe,r say 910. The unique number could be random or in series (not important which). I'm wondering if this is possible within Adobe Acrobat X or InDesign CS5?

    Yes, it's possible with Acrobat, but it requires a bit of scripting. You'll
    need to set up:
    - A print-only text field
    - A script that will launch before the file is printed and update that
    field (either by incrementing it or by giving it a random value)
    - A script that sends the same file X times to the printer (you can't just
    print X copies, because then the field won't update)

  • While creation of a equipment and assignment of personnel number

    Hi
    I have activated partner function to the Equipment catagery.
    While creating equipment using T.code IE01,  I am assigning personnel number to the person responsible partnerfunction.
    After that personnel number getting defaulted to operator field as per config setting.
    I can create equipment and assign person responsible succussfully.
    But at the time of assignment of personnel number with partner function person responsible,  I am getting information messege always like
                     " No customer master record exists for customer 10003511"
    I would request you please suggest how  to "delink the above message" while creation of a new equipment and assigning the personnel number.
    Thanks & Regards
    CHSR

    Hello
    Please check the personal Number is active or exists in HR Master with its validity.Use TC for checking PA20 for checking the same.
    Regards,
    Rakesh

  • Creation of Unique Number Ranges for Organizational Objects

    Hi Gurus,
    As per our client's requirements, We need to create unique number ranges for Organizational Objects such as O,S,P to distinguish based on the Object ID. Could you please help me out to create the same.
    And also to create unique number ranges for Personnel Development Objects such as QK & Q.
    Thanks in Advance
    Regards
    Vinoth Kumar.R

    Hi,
    To maintain object specific number ranges, go to customising node Personnel management --> Org. management --> Basic settings --> Number range manitenance --> Maintain Number ranges
    Here there will already be a default entry as $$$$.
    To create different range for object say O you can use the following options:
    Create entry as $$O - number range applicable to all Org units across all plan versions.
    Create entry as 01O - number range applicable to all Org units under plan version "01"
    Then under Interval maintenance create the desired number ranges under IN for internal or EX for external (check the external tick box for external number ranges)
    In the similar manner you can create the number ranges for objects C, S , Q & QK.
    Hope this is helpful.
    Regards,
    Shreyasi.

  • How to retrieve the number of "free" rows in a table?

    Hi,
    if in a client only environment (no sync to mobile server) rows are inserted and deleted into a table,
    is there a way to retrieve the number of "free" rows in a table? Number of "Free" rows stands for
    number of rows that can be inserted again, before the table extents in size.
    Is there a way in OLite 10.3.0.2.0 to retrieve the size of tables and indexes? ALL_TABLES is not
    a place that really works.
    Best regards and many thanks,
    Gerd

    Hi Gary,
    many thanks, the partner uses a Lite client db without sync. The db runs inside an laboratory device and collects measures. There must be a way to estimate the the number of "measures" rows, that stil can be stored in the db.
    Than we need to make the deleted space available for new rows. The partner tested defrag.exe and found that it
    needs very long time to run, especially if the db is bigger than 2GB. ... and that this run sometimes fails.
    Is there any recommendation the partner can follow on?
    Thanks,
    Gerd

Maybe you are looking for