Auto increment for order numbers

I am not sure on how to approach this and if its a backend or
frontend issue (PHP/MySQL).
Generally when you order something online the site will give
you an order number that is naturally unique from other orders. I
have the order_id field which is a primary key and auto_increments
starting at "1". Is there a way to make it start at a higher number
like 100000 or would that be a bad idea? Basically, I don't want
the user to know they are order #1.
Or would it be more wise (or even possible) to make another
field that auto_increments starting at the higher number and leave
the original order_id starting at 1? If that's the case, how would
I do that? Is it controlled by PHP or MySQL?

Those order numbers are usually segmented. For instance, some
of it is
based on the order date, some of it on your customer ID, some
of it serial,
or perhaps many other things, even your ZIP code or the
dollar amount. You
could construct that number at either end once you decide how
you want it
done.
"Eiolon" <[email protected]> wrote in
message
news:ec2jgf$2hq$[email protected]..
>I am not sure on how to approach this and if its a
backend or frontend
>issue
> (PHP/MySQL).
>
> Generally when you order something online the site will
give you an order
> number that is naturally unique from other orders. I
have the order_id
> field
> which is a primary key and auto_increments starting at
"1". Is there a
> way to
> make it start at a higher number like 100000 or would
that be a bad idea?
> Basically, I don't want the user to know they are order
#1.
>
> Or would it be more wise (or even possible) to make
another field that
> auto_increments starting at the higher number and leave
the original
> order_id
> starting at 1? If that's the case, how would I do that?
Is it controlled
> by
> PHP or MySQL?
>

Similar Messages

  • Bug in auto-increment for MSSQL

    I am using kodo 3.1.0 and have a scenario where I am persisting a new object
    that uses an auto-increment PK and the database has an on-insert trigger
    that inserts a log into an audit table.
    At the database level, what is happing is:
    1) kodo calls "insert into t_timeentry (........)
    2) the database calls "insert into t_timeentrylog (......)
    3) kodo calls @@IDENTITY to get the ID to associate with the new timeentry.
    The problem is, @@IDENTITY is getting back the last identity used,
    regardless of table, so it is returning the id inserted into t_timeentrylog
    and kodo thinks that's the id of the timeentry. In the end, I get a
    optimistic lock exception when I try to update the new timeentry because it
    is trying to update based on the id of the timeentrylog.
    What you need to do is call SCOPE_IDENTITY or IDENT_CURRENT rather than
    @@IDENTITY when you get auto-incremented columns. Unfortunately, those
    functions only exist in SQL 2000 (maybe 7), so people with SQL6.5 (and maybe
    7) are just out luck if they have triggers on inserts.
    Is there a work-around for this? It's causing problems throughout my
    system.
    Nathan

    If the query string you want executed to get the last auto-inc value
    does not rely on context, you can set it easily with:
    kodo.jdbc.DBDictionary: LastGeneratedKeyQuery="<sql>"
    If it is more complex, then you'll need to extend
    kodo.jdbc.sql.SQLServerDictionary and override the following method:
    public long getGeneratedKey (kodo.jdbc.schema.Column col,
    Connection conn)
    throws SQLException
    // if you need the col or table name:
    String colName = col.getName ();
    String tableName = col.getTable ().getName ();
    // execute the necessary SQL to return the last inserted value...
    Then you can plug your dictionary into Kodo with:
    kodo.jdbc.DBDictionary: your.custom.Dictionary

  • Auto increment for file names

    Does anybody know if it is possible to have the 'Open/Create/Replace.vi to search for exsisting files with a specific pattern, like data001.txt, and automatically increment the name so a new file is created called data002.txt
    Thanks
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

    Thanks to both, between the two it looks like I'll be able to do what I want.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • VoIP Auto Dialer for testing numbers

    We are porting several thousand numbers over to SIP connectivity via the carrier in a couple of weeks. I need to find an auto dialer of sorts that will allow me to input a range of phone numbers and then have the dialer dial each number and report back on the status - fast busy, ring, voicemail, or whatever. I would love to rely on the carrier and their reporting information, but many hundreds of these lines are too critical to not actually test with an actual call. Doe anyone know of a good application that can do what I am describing?
    Thanks.
    Tom

    Some carriers use Empirix Hammer, but it is not cheap, will do exactly what you are describing:
    http://www.empirix.com/solutions/products-services/hammer-test.aspx
    HTH,
    Chris

  • Auto Increment for BP code in BP master

    Dear All,
    CAn any one provide FMS for autoincrement of BP as per following manner...
    For Customer : Code must start with C followed by the customer first alphabet and then "000" +1
    for eg the code must be : CA0001, CA0002, CB0001....and so on
    Similarly for Vendor it must be VA0001, VB0001.....
    So when user enters the first alphabet the consecutive increment number must be displayed.
    s.r.p.

    To generate the card code try this FS:
    If $[OCRD.CardType]='C'
    Select 'C'+substring($[$7.1],1,1)
             +substring(str(max(Substring(CardCode,3,4))+10001,5),2,4)
       From OCRD
       Where CardCode like 'C'+substring($[$7.1],1,1)+'%'
    (But the code will be generated after filling the partner  name.)

  • Auto increment variable in foreach loop in ssis

    i know this has been asked N number of times, but still i have a question for you guys
    i have files sitting in FTP location
    i am loading the data from the files into tables (no issues)
    but i need to assign value to a particular column as -99999999 and then auto increment that number while loading the files into the database
    I cannot have auto increment for the that particular column
    should i use a derived column, script component, execute sql task?
    can somebody point me to the right direction
    if it were a single file, assigning the auto incremental number is easy, but with for each loop, i am not able to get the solution
    Thanks

    Hi Jack,
    To achieve your goal, you can use a Row Count Transformation in the Data Flow Task to get row count for each file, and then use an Execute SQL Task after the Data Flow Task to update the total row count variable. Supposing the variable used in the Row Count
    Transformation is InsertCount, the variable used to store the total row count is TotalInsertCount. We need to set the ResultSet of the Execute SQL Task to “Single row”, and the SQLStatement to:
    DECLARE @Insert_Count INT, @Total_Insert_Count INT
    SET @Insert_Count=?
    SET @Total_Insert_Count=?
    SET @Total_Insert_Count=@Total_Insert_Count + @Insert_Count
    SELECT R_Total_Insert_Count=@Total_Insert_Count
    Then, set the Parameter Mapping of the Execute SQL Task, we map variable InsertCount and TotalInsertCount to the parameters in the SQL statement respectively. In the ResultSet page of the Execute SQL Task, map the resultset to variable TotalInsertCount.
    Please refer to the following screenshot:
    Regards,
    Mike Yin
    TechNet Community Support

  • Auto correct of ordinal numbers in Keynote

    I use dates a lot in my Keynote presentations and I was wondering if there is an auto correct for ordinal numbers (e.g. to automatically change the st in 1st to superscript). I know I can do it manually, but it would save time.
    Thank you in advance,
    Yours,
    GG

    Hi !,
    Thanks for the responce. actually when delivery list is displayed it is required to copy those serial numbers and click on tick to get it registered for delivery but problem is it is not accepting the ticked serial numbers so to perform activity copying of serial numbers is used. I hope now u have understood my problem.
    Ashutosh

  • Auto increment pseudo column

    Hi,
    If I have a sql statement like "select e.name from employees e", how can i add a pesudo column which is auto incremented for each row fetched? So something like
    incr_column name
    1 Jack
    2 Michael
    3 Freud
    Thank you

    how can i add a pesudo column which is auto incremented for each row fetched?
    Using ROWNUM Pseudocolumn :
    SELECT   ROWNUM, ename FROM emp;
    Using LEVEL Pseudocolumn :
    select sysdate+1 from dual connect by level <=30
    USing SEQUENCE Pseudocolumn :
    CREATE SEQUENCE emp_seq
       START WITH 1
       INCREMENT BY 1
       MINVALUE 1
       MAXVALUE 2000
       NOCACHE
       NOCYCLE;
    CREATE TABLE emp1 (empno number , ename VARCHAR2 (30), sal  NUMBER);
    INSERT INTO emp1
      VALUES   (emp_seq.NEXTVAL,'BEN', 5000);
    INSERT INTO emp1
      VALUES   (emp_seq.NEXTVAL,'DVEN', 5000);
    INSERT INTO emp1
      VALUES   (emp_seq.NEXTVAL,'EVA', 5000);
    SELECT   * FROM emp1;
    commit;
    SELECT   * FROM emp1;

  • Auto Increment No in Sales Order Title Level UDF

    Dear Experts,
    Please provide me query for Auto Increment No in Sales Order Title Level UDF.
    BR
    Deep

    Hello Friend
    Try this
    Select max(T0.[U_AUN])+1 from ORDR T0 where T0.series = $[ORDR.series]
    and make it referesh.
    Thanks
    Manvendra Singh Niranjan
    Edited by: Manvendra Singh Niranjan on Feb 21, 2012 12:38 PM

  • Report for Material Numbers configured in KMAT Sales Order

    Hi,
    Scenario:
    We are operating with KMAT material type. (e.g. ABC)
    Material "ABC" has Characterstic Char 1 , Char2, Char3, Char 4
    Each Char has Char values.
    Sales Persons create the Sales orders by selecting approprite Char & Char Values. Via MRP, this lead to requirement generation for materials associated to the respective Char & Char Values.
    Requirement:
        For a given list of sales order numbers for the KMAT material (ABC),
            I want to get the list of Material numbers associated to the Char & Char   Values configured in these S.Os.
    Thanks
    Nitin

    For the Function Modules, you would need to go to Transaction SE37.  For  CS_BOM_EXPLOSION I use the following Paramater Values, aukmng = 1, auskz = X, capid = PP01, CUOBJ = from the VBAP Table and line Item of the Sales Document VBAP-cuobj, datuv = current date, emeng = 1, mktls = X, mtnrv = VBAP-matnr, stpst = 0, svwvo = X, werks = VBAP-werks, vbeln = VBAP-vbeln, vbpos = VBAK-posnr, vrsvo = X.
    For the Function Module VC_I_GET_CONFIGURATION use the following Parameter Value, instance = VBAP-cuobj.

  • How to use auto-increment and search option for MS Access DB

    Dear All,
               I have configured our invoice in Adobe Livecycle and connected it to MS Acess 2007 as per http://forms.stefcameron.com/2006/09/18/connecting-a-form-to-a-database/.
    All is working fine, I can insert, retrieve data from DB to invoice and vice versa.
    Now I want few things to be implemented on our invoice.
    When ever I open our invoice, it populate the first entry from DB, Is it possible to populate the last entry ?
    Auto increment invoice number from MS Access DB every time we open our invoice after save.
    How to implement search option from DB for invoice number ?
    Please let me know if someone can provide me help on my scenario, so that I can share more stuff related to invoice and DB.
    Look forward to hearing soon from experts and other team members.
    Thanks & Regards
    Riyad...

    As far as I know there is not any auto increment data type in Oracle. Instead of this you should create a sequence and get the next value of the sequence while creating a row in your table.
    CREATE SEQUENCE Test_Sequence ;
    CREATE TABLE Test_Table ( Id NUMBER , Foo VARCHAR2(4) ) ;
    ALTER TABLE Test_Table ADD CONSTRAINT Test_Table_PK_Id PRIMARY KEY ( Id ) ;
    INSERT INTO Test_Table ( Id , Information ) VALUES ( Test_Sequence.NEXTVAL , 'FOO' ) ;

  • Auto Confirmation for combined order with quantity distribution

    Dear All,
    we need your help that we have using the auto-confirmation for normal production order , but got the problem in combined order confirmation for final operation , in final operation we are not getting quantity distribution with respect to child order.
    please suggest any BAPI is there?

    Not possible in standard system.

  • Utilizing auto-increment/identity fields for primary key with "application" identity

    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?

    To the best of my knowledge, you cannot use auto-increment. Due to the
    differences in the way that identities are generated at the datastore
    (upon insert) vs. JDO (upon makePersistent), this feature of SQLServer is
    not supported yet.
    However, we do provide a variety of other ways of generating identity
    which may provide a closer fit to what you want, and
    our users may have some experience in solving your problem.
    On Tue, 28 Jan 2003 09:56:08 +0000, Sean Ryan wrote:
    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?--
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Two order numbers for preorder of Note 4

    I just called Customer service to ask why I have two different order numbers for my preorder of the Note 4. First of all it would be nice if I could actually understand the women that I spoke to. You would think that would be a prerequisite for someone that had to speak to customers over the phone all day. When asking why I have a separate order number in my confirmation email to that in my Verizon order history I have no idea what her answer was because I couldn't understand her even after asking her to repeat her answer 3 times. Now on to the delivery date. What delivery date? This was an even harder answer to get. Of course she said that it would be shipped out on the 23rd or after. I preodered the device on 09/19 assuming this gives me first come first serve. What a fool I was for thinking that. I then asked if the note would be available tomorrow on the 17th. "Well you know I just cant say for sure because supplies are low". How can they be low when its not out yet? She said that I may be ableto get it faster if I preorder it from a store. ? Terrible CS! You would think that this wasnt Verizons first rodeo with the launching of a upgraded device. We'll see when I receive my Note in the mail. Oh forgot to mention that under my order history page it says on the right hand side of the page that its too late for me to return my device. Again ?.

    Lol wow. No you have 14 days upon receiving phones. Enjoy that beautiful quad display

  • Order numbers for digital subscriptions

    I'm going to be giving my iPad to someone next week and I need to locate the order numbers for my magazine subscriptions. Does anyone know how to do this?

    Lol wow. No you have 14 days upon receiving phones. Enjoy that beautiful quad display

Maybe you are looking for

  • Delivery - Proforma - Invoice

    Hello Experts, During requirement gathering we propose order related billing for Proforma,but the problem is some of the data which require for proforma output is capturing from outbound delivery.also user wants to create proforma with reference to d

  • Checklist for moving from an iPhone 3g to iPhone 4

    I currently have an iPhone 3G that I've used for almost 2 years now, and will be upgrading to the iPhone 4 this coming week. I reserved the phone online at Apple.com for pickup at my local Apple Store (was in queue for only 30-40 minutes, really than

  • Import dialog doesn't appear (OS X)

    When I connect my SanDisk Firewire memory card reader to my Mac Pro, Lightroom doesn't open and the import dialog doesn't appear. This worked fine on my previous G5. iPhoto isn't opening either... nothing happens at all when I plug in the reader.

  • Error in importing Oracle Developer Days apllaince

    Hi, I am trying to import Oracle Developer Days appliance on Windows XP, but failing with the below error. Failed to import appliance C:/Oracle_Developer_Days.ova. Could not create the clone medium 'C:\Documents and Settings\User\VirtualBox VMs\Oracl

  • Mi router lo puedo programar en canal 12 y 13 pero mi nuevo mac book pro no ve estos canales

    mi router lo puedo programar en canal 12 y 13 pero mi nuevo mac book pro no ve estos canales