Rebol Talk Forum  |  REBOL Discussions  |  REBOL Sand Box  |  RebDB  |  Topic: how to create the ID as auto-number?
Pages: [1] Print
Author Topic: how to create the ID as auto-number?  (Read 760 times)
newbie
Guest


Email
how to create the ID as auto-number?
« on: April 08, 2004, 03:52:34 AM »

Hi may I ask how to create the ID as auto-number when creating the table. Thank you
Logged
Ashley
Newbie
*
Offline Offline

Posts: 37


View Profile
how to create the ID as auto-number?
« Reply #1 on: April 08, 2004, 06:49:51 PM »

Use 'next, as in:
Code:
>> db-insert my-table [next 1-Jan-2000 "Note"]
== [11 1-Jan-2000 "Note"]
Refer to the RebDB Guide for further information.
Logged
newbie
Guest


Email
how to create the ID as auto-number?
« Reply #2 on: April 11, 2004, 09:58:48 PM »

But how you create the datatype for your ID like

Code: db-create my-table [ID Name][integer! string!][3 12]

 Is it something like that or wrong? cos if I try the next, it may have problem on it..  
Logged
Ashley
Newbie
*
Offline Offline

Posts: 37


View Profile
how to create the ID as auto-number?
« Reply #3 on: April 20, 2004, 07:37:29 PM »

Next, added in RebDB v1.2, is just a token used in lieu of an integer! value. Try the following code to see how it works:
Code:
db-create test [id][integer!][1]
db-insert test [next]
db-insert test [next]
db-select * test
Logged
Pages: [1] Print 
Rebol Talk Forum  |  REBOL Discussions  |  REBOL Sand Box  |  RebDB  |  Topic: how to create the ID as auto-number?
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 17, 2008, 05:57:06 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2169 Posts in 562 Topics by 1224 Members
Latest Member: thyptoste

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc