|
If you have worked with MS SQL Server, MS Access, you are
probably familiar with Identity columns.
The main purpose of these columns is to provide a primary key to the table, when
a primary key can not be defined using other fields in the table. The Identity
columns are like any other column except that their value is not inserted by the
user, but by the system itself.
One of the common question is "How can I get the value of
Identity column in the inserted record?" In this topic we will describe the
procedures you should follow to extract the value of the Identity column using
the Database Manager.
1. In the Field Extractor create an extra field (for example,
ID) where Source -
Blank Value.

Click OK.
2.
Open the
Database Manager and set it as follows:

Select the database, select
Action Type - Insert into Table
and select your table.
Click OK.
3. Click Identity tab
on the Database Manager window. Check Get
Identity after insert SQL is executed option and type:
select @@identity as [%ID%] from Mail_list (name of your
table)

When a record is inserted into a table with the Identity
column, the function @@IDENTITY (or the
global variable @@IDENTITY as in SQL Server 6.5) returns the last identity value
that was inserted in the database.
Click OK.
ATTENTION!
|
|
If your database does not support
@@IDENTITY function, you can type
your own SQL text to extract the value of Identity column, for instance:
Select ID From Mail_list
where email=[%Email%] |
|