| ADOdb Library for PHP Manual | ||
|---|---|---|
| Prev | GenID | Next |
Generate a sequence number (an integer except for mssql). Works for interbase, mysql, postgresql, oci8, oci8po, mssql, ODBC based (access,vfp,db2,etc) drivers currently. Uses $seqName as the name of the sequence. GenID() will automatically create the sequence for you if it does not exist (provided the userid has permission to do so). Otherwise you will have to create the sequence yourself.
If your database driver emulates sequences, the name of the table is the sequence name. The table has one column, "id" which should be of type integer, or if you need something larger - numeric(16).
For ODBC and databases that do not support sequences natively (eg mssql, mysql), we create a table for each sequence. If the sequence has not been defined earlier, it is created with the starting value set in $startID.
Note that the mssql driver's GenID() used to generate 16 byte GUID's. We now return integers since 1.90.
| Prev | Home | Next |
| Insert_ID | Up | CreateSequence |