CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 @@identity

Print topic Send  topic

Author Message
Rich
Posted: 05/11/2004, 5:48 AM

I have a table with identity column. I want to query the databas for that identity column value to insert it into another table.

In SQL, you can run the following:

select @@identity and it will give you the value.

I can't seem to get this select to work on the after execute insert option

there is no where clause, or from clause

Any help is appreciated
peterr


Posts: 5971
Posted: 05/11/2004, 7:18 AM

I think that you shouldn't need a WHERE or FROM clause.
We have an example in CCS Example Pack. Search the "ManyToManyCheckbox" page for the text "'Retrieve the last inserted key".
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Stefano Chermaz
Posted: 05/12/2004, 6:42 AM

You must use the same connection object of the query insert
In Codecharge, if your connection name is Connection1 you can use

SQLIdentity="SELECT @@IDENTITY as id"
Set RecordSet1 = DBConnection1.Execute(SQLIdentity)

YourVariable=Recordset1("id")

If Recordset1.State = adStateOpen Then _
Recordset1.Close

Set Recordset1 = Nothing

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.