 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Claude Guest
|
Posted: Fri May 21, 2004 2:41 pm Post subject: SQLServer, Identity(autoincriment), and returning value |
|
|
How do I retrieve the value of an identity column
after it is inserted into a table?
Select max will is bad because other records my be
inserted at the same time.
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Fri May 21, 2004 2:46 pm Post subject: Re: SQLServer, Identity(autoincriment), and returning value |
|
|
Select @@Identity
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Claude" <claude (AT) dev (DOT) scomage.com> сообщил/сообщила в новостях следующее:
news:40ae1529$1 (AT) newsgroups (DOT) borland.com...
| Quote: | How do I retrieve the value of an identity column
after it is inserted into a table?
Select max will is bad because other records my be
inserted at the same time.
|
|
|
| Back to top |
|
 |
Claude Guest
|
Posted: Fri May 21, 2004 3:32 pm Post subject: Re: SQLServer, Identity(autoincriment), and returning value |
|
|
Thanks for the reply.
Is there a way that it could be implemented also for Access and Oracle?
Claude
"Viatcheslav V. Vassiliev" <support (AT) oledbdirect (DOT) com> wrote
| Quote: | Select @@Identity
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Claude" <claude (AT) dev (DOT) scomage.com> сообщил/сообщила в новостях следующее:
news:40ae1529$1 (AT) newsgroups (DOT) borland.com...
How do I retrieve the value of an identity column
after it is inserted into a table?
Select max will is bad because other records my be
inserted at the same time.
|
|
|
| Back to top |
|
 |
OKusmen Guest
|
Posted: Mon Aug 16, 2004 5:01 am Post subject: Re: SQLServer, Identity(autoincriment), and returning value |
|
|
Table->Insert();
......
Table->Post();
int newId = Table->FieldValues["IdentityField"];
"Claude" <claude (AT) dev (DOT) scomage.com> wrote
| Quote: | Thanks for the reply.
Is there a way that it could be implemented also for Access and Oracle?
Claude
"Viatcheslav V. Vassiliev" <support (AT) oledbdirect (DOT) com> wrote in message
news:40ae165d$1 (AT) newsgroups (DOT) borland.com...
Select @@Identity
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Claude" <claude (AT) dev (DOT) scomage.com> сообщил/сообщила в новостях следующее:
news:40ae1529$1 (AT) newsgroups (DOT) borland.com...
How do I retrieve the value of an identity column
after it is inserted into a table?
Select max will is bad because other records my be
inserted at the same time.
|
|
|
| Back to top |
|
 |
OKusmen Guest
|
Posted: Mon Aug 16, 2004 5:02 am Post subject: Re: SQLServer, Identity(autoincriment), and returning value |
|
|
sorry. It is not for Oracle.
For Oracle, You can query "object.curval".
"Select object.curval FROM DUAL"
"Claude" <claude (AT) dev (DOT) scomage.com> wrote
| Quote: | Thanks for the reply.
Is there a way that it could be implemented also for Access and Oracle?
Claude
"Viatcheslav V. Vassiliev" <support (AT) oledbdirect (DOT) com> wrote in message
news:40ae165d$1 (AT) newsgroups (DOT) borland.com...
Select @@Identity
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Claude" <claude (AT) dev (DOT) scomage.com> сообщил/сообщила в новостях следующее:
news:40ae1529$1 (AT) newsgroups (DOT) borland.com...
How do I retrieve the value of an identity column
after it is inserted into a table?
Select max will is bad because other records my be
inserted at the same time.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|