Results 1 to 3 of 3

Thread: sql unique id

  1. #1
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default sql unique id

    hi ,
    i have created Qt database ...in this database i was use auto increment unique id....but i want to change unique id formate(like stud001,stud002,stud003,.....)..i don't know how to change formate...please provide some sollutions.....

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: sql unique id

    Qt Database does not support such increment patterns, you will need to write some custom logic to track the latest id in the database and then generate the next id.

    The solution really depends on what you want, if it is as simple as studxxx, then you can just have a id generator which will concatenate the a fixed string ("stud") with a incremental id, where the latest id is taken from database and is tracked further.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: sql unique id

    thank you reddy,
    i understand what u say ...could you please send some sample example ....please

Similar Threads

  1. Unique Id of Qwidget
    By alex1 in forum Qt Programming
    Replies: 7
    Last Post: 5th October 2011, 09:56
  2. Computer unique fingerprint
    By thru in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2010, 06:29
  3. Unique ID for a PC to use for Key Validation
    By nbkhwjm in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2008, 23:13
  4. The unique key
    By igor.alexandrov in forum Qt Programming
    Replies: 9
    Last Post: 26th January 2008, 00:27
  5. ContextMenu Very unique GUI.
    By VireX in forum Qt Programming
    Replies: 14
    Last Post: 15th April 2007, 08:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.