Difference between revisions of "SYNCNUM()"

From Recital Documentation Wiki
Jump to: navigation, search
(Products)
Line 1: Line 1:
==Class==
 
Pseudo Columns
 
 
 
 
==Purpose==
 
==Purpose==
 
Return the unique sequence number assigned to a row from the specified table
 
Return the unique sequence number assigned to a row from the specified table
Line 20: Line 16:
 
The SYNCNUM pseudo column will return the unique sequence number assigned to a row from the specified table. Each new row inserted into a table will be assigned a unique sequence number for that table. Even if the row is deleted later or if all the rows are deleted from the table, that number will not be issued again.
 
The SYNCNUM pseudo column will return the unique sequence number assigned to a row from the specified table. Each new row inserted into a table will be assigned a unique sequence number for that table. Even if the row is deleted later or if all the rows are deleted from the table, that number will not be issued again.
  
Note: The SYNCNUM pseudo column for existing Recital 9 tables can be populated using the [[dbconvert]] utility and the [[CONVERT]] command.
+
Note: The SYNCNUM pseudo column for existing Recital tables can be populated using the [[recitalconvert]] utility and the [[CONVERT]] command.
  
  

Revision as of 14:54, 16 December 2009

Purpose

Return the unique sequence number assigned to a row from the specified table


Syntax

SYNCNUM


See Also

INSERT, Optimizing Indexes using SYNCNUM, PSEUDO COLUMNS, SELECT, UPDATE


Description

A Pseudo Column behaves like a table column, but is not actually stored in the table. You can select from Pseudo Columns, but they cannot be updated. Pseudo Columns provide extra information about a SELECT row set.

The SYNCNUM pseudo column will return the unique sequence number assigned to a row from the specified table. Each new row inserted into a table will be assigned a unique sequence number for that table. Even if the row is deleted later or if all the rows are deleted from the table, that number will not be issued again.

Note: The SYNCNUM pseudo column for existing Recital tables can be populated using the recitalconvert utility and the CONVERT command.


Example

// Display all overdue accounts with 15% commission in
// Sorted "name" and "paid date" order with the unique row sequence number.
EXEC SQL
 SELECT SYNCNUM, name, address, balance, cost*1.15
 FROM accounts
 WHERE paid_date < date()
 ORDER BY name, paid_date;


Products

Recital, Recital Server